본문으로 건너뛰기

API 문서

REST API를 통해 PDF 분석을 애플리케이션에 통합하세요

빠른 시작

1

계정 만들기

무료 PDFCheck 계정에 가입하여 시작하세요.

2

API 토큰 생성

API 토큰으로 이동하여 새 토큰을 생성하세요.

3

첫 번째 요청 보내기

토큰을 사용하여 API 요청을 인증하세요.

인증

모든 API 요청은 Authorization 헤더에 Bearer 토큰을 사용한 인증이 필요합니다.

Authorization: Bearer YOUR_API_TOKEN

기본 URL

https://pdf.businesspress.io/api/v1

요청 제한

무료 계정은 하루 50건의 PDF 분석으로 제한됩니다. 남은 횟수는 각 API 응답에 포함됩니다.

엔드포인트

GET /user

일일 사용 제한을 포함한 인증된 사용자 정보를 가져옵니다.

응답 예시

{
  "success": true,
  "data": {
    "name": "John Doe",
    "email": "john@example.com",
    "daily_limit": 50,
    "remaining_checks": 47,
    "checks_used_today": 3
  }
}
POST /pdf/analyze

PDF 파일을 업로드하고 분석합니다. PDF에서 추출된 상세 메타데이터를 반환합니다.

요청 본문

이름 유형 필수 설명
file file 필수 분석할 PDF 파일(최대 100MB)

요청 예시

curl -X POST https://pdf.businesspress.io/api/v1/pdf/analyze \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@document.pdf"

응답 예시

{
  "success": true,
  "data": {
    "id": "abc123xyz789",
    "filename": "document.pdf",
    "file_size": 1048576,
    "file_size_formatted": "1.00 MB",
    "metadata": {
      "title": "My Document",
      "author": "John Doe",
      "creator": "Microsoft Word",
      "producer": "Adobe PDF Library",
      "page_count": 10,
      "pdf_version": "1.7",
      "dates": {
        "created": "2025-01-15T10:30:00Z",
        "modified": "2025-01-16T14:22:00Z",
        "was_modified": true
      }
    },
    "analyzed_at": "2025-01-17T18:00:00Z"
  },
  "remaining_checks": 46
}
GET /pdf

인증된 사용자의 모든 PDF 분석 결과를 페이지네이션과 함께 나열합니다.

쿼리 매개변수

이름 유형 기본값 설명
per_page integer 20 페이지당 결과 수(1-100)

응답 예시

{
  "success": true,
  "data": [
    {
      "id": "abc123xyz789",
      "filename": "document.pdf",
      "file_size": 1048576,
      "file_size_formatted": "1.00 MB",
      "analyzed_at": "2025-01-17T18:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 20,
    "total": 1
  }
}
GET /pdf/{id}

분석 ID(공유 토큰)로 상세 분석 결과를 가져옵니다.

요청 예시

curl https://pdf.businesspress.io/api/v1/pdf/abc123xyz789 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

토큰 관리

GET /tokens

인증된 사용자의 모든 API 토큰을 나열합니다.

POST /tokens

새 API 토큰을 생성합니다. 토큰은 응답에서 한 번만 표시됩니다.

요청 본문

이름 유형 필수 설명
name string 필수 토큰에 대한 설명적인 이름
DELETE /tokens/{id}

API 토큰을 영구적으로 폐기(삭제)합니다.

오류 코드

HTTP 코드 오류 코드 설명
401 unauthenticated 유효하지 않거나 누락된 API 토큰
404 not_found 리소스를 찾을 수 없거나 접근이 거부됨
422 analysis_failed PDF를 처리할 수 없음(유효하지 않거나 손상된 파일)
429 daily_limit_exceeded 일일 제한 초과, 내일 다시 시도해 주세요

코드 예시

cURL

# Analyze a PDF
curl -X POST https://pdf.businesspress.io/api/v1/pdf/analyze \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@/path/to/document.pdf"

# Get analysis result
curl https://pdf.businesspress.io/api/v1/pdf/abc123xyz789 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# List all analyses
curl https://pdf.businesspress.io/api/v1/pdf \
  -H "Authorization: Bearer YOUR_API_TOKEN"

PHP

<?php
$apiToken = 'YOUR_API_TOKEN';
$filePath = '/path/to/document.pdf';

// Analyze PDF
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => 'https://pdf.businesspress.io/api/v1/pdf/analyze',
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $apiToken,
    ],
    CURLOPT_POSTFIELDS => [
        'file' => new CURLFile($filePath, 'application/pdf'),
    ],
]);

$response = curl_exec($ch);
$result = json_decode($response, true);

if ($result['success']) {
    echo "Analysis ID: " . $result['data']['id'] . "\n";
    echo "Pages: " . $result['data']['metadata']['page_count'] . "\n";
    echo "Remaining checks: " . $result['remaining_checks'] . "\n";
}

curl_close($ch);

Python

import requests

API_TOKEN = 'YOUR_API_TOKEN'
BASE_URL = 'https://pdf.businesspress.io/api/v1'

headers = {
    'Authorization': f'Bearer {API_TOKEN}'
}

# Analyze PDF
with open('/path/to/document.pdf', 'rb') as f:
    response = requests.post(
        f'{BASE_URL}/pdf/analyze',
        headers=headers,
        files={'file': ('document.pdf', f, 'application/pdf')}
    )

result = response.json()

if result['success']:
    print(f"Analysis ID: {result['data']['id']}")
    print(f"Pages: {result['data']['metadata']['page_count']}")
    print(f"Remaining checks: {result['remaining_checks']}")

# Get analysis by ID
response = requests.get(
    f"{BASE_URL}/pdf/{result['data']['id']}",
    headers=headers
)
print(response.json())

JavaScript (Node.js)

const fs = require('fs');
const FormData = require('form-data');

const API_TOKEN = 'YOUR_API_TOKEN';
const BASE_URL = 'https://pdf.businesspress.io/api/v1';

async function analyzePdf(filePath) {
    const form = new FormData();
    form.append('file', fs.createReadStream(filePath));

    const response = await fetch(`${BASE_URL}/pdf/analyze`, {
        method: 'POST',
        headers: {
            'Authorization': `Bearer ${API_TOKEN}`,
        },
        body: form
    });

    const result = await response.json();
    
    if (result.success) {
        console.log(`Analysis ID: ${result.data.id}`);
        console.log(`Pages: ${result.data.metadata.page_count}`);
        console.log(`Remaining checks: ${result.remaining_checks}`);
    }
    
    return result;
}

// Usage
analyzePdf('/path/to/document.pdf');

시작할 준비가 되셨나요?

무료 계정을 만들고 첫 번째 API 토큰을 생성하여 통합을 시작하세요.