API Reference
ParseFlow extracts text, forms, and tables from PDFs and images using a single REST API. Compatible with AWS Textract and Google Document AI response formats.
# Quick Start
Try it now โ copy and run this command to extract data from a document:
Estimated response time: 300โ800 ms for single images, longer for multi-page PDFs (parallel processing).
curl -X POST https://parseflow.cc/v1/document/analyze \
-H "Authorization: Bearer ocrg_live_key" \
-F "document=@invoice.pdf" \
-F 'featureTypes=["FORMS","TABLES"]'
{
"DocumentMetadata": { "Pages": 1 },
"Text": "Invoice #1042\nBilled to: Acme Corp...",
"Forms": [
{ "key": "Invoice Number", "value": "1042", "confidence": 0.98 }
],
"Tables": [{ "rows": [["Item", "Qty", "Price"]] }],
"Confidence": 0.97,
"Billing": { "totalCostCents": 1, "pages": 1 }
}
# At a Glance
# How It Works
# Common Use Cases
# Typical Performance
| Document Type | Typical Latency |
|---|---|
| Single image (PNG/JPG) | 300โ800 ms |
| Multi-page PDF (10 pages) | ~3โ8 seconds (parallel) |
| Multi-page PDF (50 pages) | ~15โ30 seconds (parallel) |
# Authentication
Every request requires an API key. Generate one from your dashboard. Each key is shown in full only once โ store it securely.
Pass the key in one of two ways:
| Method | Header | Example |
|---|---|---|
| Bearer | Authorization | Bearer ocrg_live_key |
| Header | x-api-key | oc rg_live_key |
# Required Headers
| Header | Required | Value |
|---|---|---|
| Authorization | Yes | Bearer <api_key> |
| Content-Type | For JSON | application/json (for base64 requests) |
For multipart uploads, the Content-Type is set automatically by your HTTP client.
# Endpoint
/v1/document/analyze
Base URL: https://parseflow.cc
Response: application/json | API Version: v1 (stable, breaking changes will bump to v2)
# Supported Formats
| Format | MIME Type | Max Size | Max Pages |
|---|---|---|---|
| application/pdf | 40 MB | 50 | |
| PNG | image/png | 40 MB | โ |
| JPEG / JPG | image/jpeg | 40 MB | โ |
The 40 MB limit is the raw upload size (multer config). PDFs are decoded internally โ the rendered image sent to the vision model is smaller.
# Request
Send your document as a multipart file upload or as JSON with base64-encoded bytes.
Multipart (file upload)
curl -X POST https://parseflow.cc/v1/document/analyze \
-H "Authorization: Bearer ocrg_live_key" \
-F "document=@invoice.pdf" \
-F 'featureTypes=["FORMS","TABLES"]'
JSON (base64 bytes)
curl -X POST https://parseflow.cc/v1/document/analyze \
-H "Authorization: Bearer ocrg_live_key" \
-H "Content-Type: application/json" \
-d '{
"document": { "bytes": "iVBORw0KGgo...", "mimeType": "image/png" },
"featureTypes": ["FORMS", "TABLES"]
}'
Request Parameters
| Parameter | Type | Req. | Description |
|---|---|---|---|
| document | file / object | Yes | The document file (multipart) or { bytes, mimeType } object |
| document.bytes | string | With JSON | Base64-encoded document content |
| document.mimeType | string | No | MIME type (default: image/png). Use application/pdf for PDFs |
| featureTypes | string[] | No | Features to enable (FORMS, TABLES, EXPENSE) |
# Response (Native Format)
The native response includes both an aggregate view and per-page detail. Only successful pages are billed โ pages that fail to render are reported with an Error field and not charged.
Switch to Textract or DocAI formats from dashboard settings.
{
"DocumentMetadata": { "Pages": 1 },
"Text": "Invoice #1042\nBilled to: Acme Corp...",
"Forms": [
{ "key": "Invoice Number", "value": "1042", "confidence": 0.98, "page": 1 }
],
"Tables": [{ "rows": [["Item", "Qty", "Price"]], "page": 1 }],
"Confidence": 0.97,
"NeedsReview": false,
"Pages": [{ /* per-page detail */ }],
"Billing": { "totalCostCents": 1, "pages": 1, "failedPages": 0 }
}
# Response Formats
Switch between three response formats from Dashboard โ Settings โ Response format. No API changes needed.
Structured JSON with Text, Forms, Tables, per-page Pages, and Billing.
Returns Blocks[] with PAGE, LINE, KEY_VALUE_SET, TABLE, CELL block types. Drop-in replacement.
Returns document.text, pages[].formFields, entities[], and documentLayout.blocks.
# Feature Types
The featureTypes array controls extraction features. Billing is at the rate of the most expensive tier requested.
| Feature | Price / 1K pages | Description |
|---|---|---|
| "TEXT" (default) | $1.00 | Plain text extraction in reading order |
| "FORMS" | $8.00 | Key-value field pairs with per-field confidence |
| "TABLES" | $5.00 | Table detection and cell extraction |
| "EXPENSE" | $4.00 | Receipt / expense-specific field extraction |
# Multi-Page PDFs
PDFs are auto-detected (by MIME type or file header) and split into one image per page. Each page runs through the same extraction pipeline independently.
- Up to 50 pages per request (safety cap)
- Processed in parallel with configurable concurrency (default 3)
- Per-page confidence check and escalation
- Only successful pages are billed โ failed pages (render errors) return
"Error"and are not charged - Scanned/image-based PDFs and embedded-font PDFs work best
# Billing & Wallet
Prepaid wallet model. Credits are deducted after each successful extraction.
- Free trial โ $5.00 credits on first signup
- Top up from dashboard via Razorpay Checkout
- 402 insufficient_balance if wallet can't cover estimated cost
- Failed pages are not billed
- Full transaction history in dashboard
# Error Codes
| Status | Error | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key |
| 402 | insufficient_balance | Wallet balance too low. Top up. |
| 400 | bad_request | Invalid request format or missing parameters |
| 429 | too_many_requests | Rate limit exceeded. Retry after the window resets. |
| 502 | extraction_failed | Vision API error. Check document and retry. |
Example Error Responses
// 401 Unauthorized
{ "error": "unauthorized", "message": "Missing API key." }
// 402 Insufficient Balance
{ "error": "insufficient_balance",
"message": "Insufficient wallet balance. You have $0.00 but this request needs at least $0.01.",
"balanceCents": 0, "requiredCents": 1 }
// 400 Bad Request (missing document)
{ "error": "bad_request",
"message": "Provide a file under the "document" field, or JSON body." }
// 413 File Too Large
{ "error": "entity_too_large",
"message": "File exceeds the 40 MB size limit." }
// 429 Rate Limited
{ "error": "too_many_requests",
"message": "Rate limit exceeded. Try again later." }
// 500 Internal Error
{ "error": "internal_error",
"message": "Something went wrong. Please try again." }
// 502 Extraction Failed
{ "error": "extraction_failed",
"message": "Document extraction failed. Check the document format or try again later." }
# Rate Limits
The extraction and usage endpoints are rate-limited to 60 requests per minute per IP address. Exceeded requests return HTTP 429 with a Retry-After header.
# Migration from Competitors
ParseFlow is designed as a drop-in replacement for AWS Textract and Google Document AI. Change your response format in dashboard settings โ your existing integration code continues to work.
From AWS Textract
- Generate a ParseFlow API key from the dashboard
- Set response format to "AWS Textract-compatible" in settings
- Replace your Textract endpoint URL with
https://parseflow.cc/v1/document/analyze - Replace your AWS credentials with the Bearer token
- That's it โ your existing code that parses
Blocks[]works unchanged
Note: ParseFlow does not require S3 buckets, IAM roles, Lambda functions, or complex infrastructure setup.
From Google Document AI
- Generate a ParseFlow API key from the dashboard
- Set response format to "Google Document AI-compatible" in settings
- Replace your Document AI endpoint with
https://parseflow.cc/v1/document/analyze - Replace your GCP credentials with the Bearer token
- Your existing code that parses
document.textandentities[]works unchanged
# FAQ
What file types are supported?
PDF, PNG, JPG/JPEG. TIFF support is available on request.
What is the maximum file size?
40 MB per upload.
What is the maximum number of pages?
50 pages per request. Split larger documents client-side.
Is handwriting supported?
Depends on the underlying model. Gemini 2.5 Flash handles some handwriting, but typed/printed text is preferred.
Are scanned PDFs supported?
Yes โ scanned PDFs are image-based and work with the same vision pipeline.
Are password-protected PDFs supported?
No. Remove password protection before uploading.
How do I migrate from AWS Textract?
See the Migration section above. Set your response format to Textract-compatible in settings, update your endpoint and auth, and your existing code works.
# Need Help?
Have questions or ran into an issue? Reach out to us: