Build with the API
Build with the API
Send documents from your own system and get structured JSON back. Two routes — inline for small files, upload-and-poll for everything else.
Everything the interface does is available over HTTP. Same Parsli's parsing engine, same field definitions, same results.
Base URL and authentication
https://parsli.co/api/v1
Every request carries an API key as a bearer token. A key is scoped to one Parser — which parser is inferred from the key, so no request needs a parser id.
Authorization: Bearer ext_YOUR_API_KEY
Create keys in the parser's Settings. See authentication.
Choose the right route
This is the decision that matters, and getting it wrong is the most common integration bug.
| Inline | Upload and poll | |
|---|---|---|
| How | Base64 the file into the request | Get an upload URL, PUT the bytes, submit the path |
| Response | The result, in the same response | A document_id to poll |
| Requests | 1 | 3 |
| Use for | Small files that extract quickly | Large files, multi-page scans, anything slow |
Inline is simpler, and it is a trap for anything big. The whole file has to fit in a JSON request body, and the extraction has to finish inside one HTTP request. A forty-page scan will not.
Upload-and-poll has no such ceiling. The bytes go straight to storage without passing through the API, and a worker does the extraction, so nothing is bounded by request wall-clock. Files over 300MB must use this route.
If you are building something that accepts documents from users, use upload-and-poll. You cannot predict what they will send you.
The shortest possible integration
curl -X POST https://parsli.co/api/v1/extract \
-H "Authorization: Bearer ext_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": {
"name": "invoice.pdf",
"type": "application/pdf",
"data": "'"$(base64 -i invoice.pdf)"'"
}
}'
{
"success": true,
"parser_id": "6f3a…",
"document_id": "b71c…",
"results": {
"invoice_number": "INV-2026-0417",
"total_amount": 1284.5,
"line_items": [
{ "description": "Steel brackets", "quantity": 40, "unit_price": 12.5 }
]
}
}
results keys are your field names. Whatever you called a field is the key you get back.
Getting results without polling
Polling is not the only option. A parser can push results to you instead — configure an outbound Webhook and Parsli calls your endpoint the moment a document finishes, whatever route it came in by.
That is usually the better shape for a queue: submit and forget, handle results as they arrive. See receiving results.
Read this next
- Authentication — creating, scoping, and rotating keys
- Extract a document — the inline route in full
- Large and slow files — upload-and-poll in full
- Receiving results — webhooks and polling
- Errors — every status code and what to do about it
Tip: The whole vocabulary — every object, field, and payload key — is available as structured data at /docs/dictionary.json. If you are pointing a coding agent at this API, give it that first.
Something here wrong or missing? Tell us — we treat it as a bug.