PDF processing API for conversion, extraction, merging, splitting and more
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
All-in-one PDF processing API. Convert, extract, merge, split, compress PDFs and more. Supports OCR for scanned documents.
Official docs: https://docs.pdf.co/
Use this skill when you need to:
Set environment variable:
export PDFCO_API_KEY="your-email@example.com_your-api-key"
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
Extract text from PDF with OCR support:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/convert/to/text'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf",
"inline": true
}'"'"' | jq .'
With specific pages (1-indexed):
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/convert/to/text'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf",
"pages": "1-3",
"inline": true
}'"'"' | jq .'
Convert PDF tables to CSV:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/convert/to/csv'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-csv/sample.pdf",
"inline": true
}'"'"' | jq .'
Combine multiple PDFs into one:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/merge'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-merge/sample1.pdf,https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-merge/sample2.pdf",
"name": "merged.pdf"
}'"'"' | jq .'
Split PDF by page ranges:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/split'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-split/sample.pdf",
"pages": "1-2,3-"
}'"'"' | jq .'
Reduce PDF file size:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/optimize'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-optimize/sample.pdf",
"name": "compressed.pdf"
}'"'"' | jq .'
Convert HTML or URL to PDF:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/convert/from/html'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"html": "<h1>Hello World</h1><p>This is a test.</p>",
"name": "output.pdf"
}'"'"' | jq .'
From URL:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/pdf/convert/from/url'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://example.com",
"name": "webpage.pdf"
}'"'"' | jq .'
Extract structured data from invoices:
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/ai-invoice-parser'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw '"'"'{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/ai-invoice-parser/sample-invoice.pdf",
"inline": true
}'"'"' | jq .'
Upload a local file first, then use the returned URL:
# Step 1: Get presigned upload URL
UPLOAD_RESPONSE=$(curl -s "https://api.pdf.co/v1/file/upload/get-presigned-url?name=myfile.pdf&contenttype=application/pdf" --header "x-api-key: ${PDFCO_API_KEY}")
PRESIGNED_URL=$(echo $UPLOAD_RESPONSE | jq -r '.presignedUrl')
FILE_URL=$(echo $UPLOAD_RESPONSE | jq -r '.url')
# Step 2: Upload file
curl -X PUT "$PRESIGNED_URL" --header "Content-Type: application/pdf" --data-binary @/path/to/your/file.pdf
# Step 3: Use FILE_URL in subsequent API calls
echo "Use this URL: $FILE_URL"
For large files, use async mode to avoid timeouts:
# Start async job
RESPONSE=$(curl -s --location --request POST 'https://api.pdf.co/v1/pdf/convert/to/text' --header "x-api-key: ${PDFCO_API_KEY}" --header 'Content-Type: application/json' --data-raw '{
"url": "https://example.com/large-file.pdf",
"async": true
}')
JOB_ID=$(echo $RESPONSE | jq -r '.jobId')
# Check job status
bash -c 'curl --location --request POST '"'"'https://api.pdf.co/v1/job/check'"'"' --header "x-api-key: ${PDFCO_API_KEY}" --header '"'"'Content-Type: application/json'"'"' --data-raw "{\"jobid\": \"$JOB_ID\"}"' | jq .
| Parameter | Type | Description |
|---|---|---|
url | string | URL to source file (required) |
inline | boolean | Return result in response body |
async | boolean | Run as background job |
pages | string | Page range, 1-indexed (e.g., "1-3", "1,3,5", "2-") |
name | string | Output filename |
password | string | PDF password if protected |
expiration | integer | Output link expiration in minutes (default: 60) |
{
"url": "https://pdf-temp-files.s3.amazonaws.com/.../result.pdf",
"pageCount": 5,
"error": false,
"status": 200,
"name": "result.pdf",
"credits": 10,
"remainingCredits": 9990
}
With inline: true, the response includes body field with extracted content.
| Endpoint | Description |
|---|---|
/pdf/convert/to/text | PDF to text (OCR supported) |
/pdf/convert/to/csv | PDF to CSV |
/pdf/convert/to/json | PDF to JSON |
/pdf/merge | Merge multiple PDFs |
/pdf/split | Split PDF by pages |
/pdf/optimize | Compress PDF |
/pdf/convert/from/html | HTML to PDF |
/pdf/convert/from/url | URL to PDF |
/ai-invoice-parser | AI-powered invoice parsing |
/document-parser | Template-based document parsing |
/file/upload/get-presigned-url | Get upload URL |
/job/check | Check async job status |
async: true for files over 40 pages or 10MBlang for non-English)remainingCredits in response