ParserBee

Extract data from a document

POST
/api/v1/extract

Upload a document (PDF, image, Word, PowerPoint, Excel, CSV, TXT, RTF, ODT, HTML, or EML) and extract structured data using a template. Each extraction costs 1 credit.

The template defines the fields to extract. You must create a template first from the dashboard before using this endpoint.

Note: You can provide either a file (upload) or file_url (URL to document). At least one is required.

Authorization

ApiKeyAuth
x-api-key<token>

Your ParserBee API key. Generate one from Settings in your dashboard. The key starts with pk_.

In: header

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/extract" \  -H "Content-Type: application/json" \  -d '{    "template_id": "abc123def456"  }'
{  "success": true,  "request_id": "req_abc123",  "data": {    "invoice_number": "INV-2026-001",    "total_amount": 1500,    "vendor_name": "Acme Corp"  },  "credits_remaining": 449,  "processing_time_ms": 2400,  "usage": {    "pages_processed": 1,    "doc_size_bytes": 204800  }}

{  "error": "File is required",  "code": "MISSING_FILE"}

{  "error": "Invalid API key",  "code": "INVALID_API_KEY"}
{  "error": "Insufficient credits. Please purchase more credits.",  "code": "INSUFFICIENT_CREDITS",  "credits_remaining": 0}
{  "error": "No active subscription. Please subscribe to use this API.",  "code": "SUBSCRIPTION_INACTIVE"}
{  "error": "Template not found or you don't have access to it",  "code": "TEMPLATE_NOT_FOUND"}
{  "error": "Failed to process document",  "code": "PROCESSING_FAILED"}