API Documentation
Integrate PDF analysis into your applications with our REST API
Quick Start
Create an Account
Sign up for a free PDFCheck account to get started.
Generate an API Token
Go to API Tokens and create a new token.
Make Your First Request
Use your token to authenticate API requests.
Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_TOKEN
Base URL
https://pdf.businesspress.io/api/v1
Rate Limits
Free accounts are limited to 50 PDF analyses per day. The remaining checks are included in each API response.
Endpoints
/user
Get information about the authenticated user including daily usage limits.
Example Response
{
"success": true,
"data": {
"name": "John Doe",
"email": "john@example.com",
"daily_limit": 50,
"remaining_checks": 47,
"checks_used_today": 3
}
}
/pdf/analyze
Upload and analyze a PDF file. Returns detailed metadata extracted from the PDF.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| file | file | Required | PDF file to analyze (max 100MB) |
Example Request
curl -X POST https://pdf.businesspress.io/api/v1/pdf/analyze \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "file=@document.pdf"
Example Response
{
"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
}
/pdf
List all PDF analyses for the authenticated user with pagination.
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| per_page | integer | 20 | Number of results per page (1-100) |
Example Response
{
"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
}
}
/pdf/{id}
Get detailed analysis results by the analysis ID (share token).
Example Request
curl https://pdf.businesspress.io/api/v1/pdf/abc123xyz789 \
-H "Authorization: Bearer YOUR_API_TOKEN"
Token Management
/tokens
List all API tokens for the authenticated user.
/tokens
Create a new API token. The token is only shown once in the response.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | A descriptive name for the token |
/tokens/{id}
Revoke (delete) an API token permanently.
Error Codes
| HTTP Code | Error Code | Description |
|---|---|---|
| 401 | unauthenticated | Invalid or missing API token |
| 404 | not_found | Resource not found or access denied |
| 422 | analysis_failed | PDF could not be processed (invalid or corrupted file) |
| 429 | daily_limit_exceeded | Daily limit exceeded, try again tomorrow |
Code Examples
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');
Ready to Get Started?
Create a free account and generate your first API token to start integrating.