Extract data from a document: invoice, receipt, contract fields as JSON
Extract named fields from a document as JSON: give a PDF, Word, Excel or PowerPoint file, a scan or a photo (PNG, JPEG, WebP) by URL or in a POST body (up to 10 MB; images 3 MB) and the field names you want, such as invoice_number, total, due_date. An AI model reads the file, scans by OCR, and returns one JSON object, with null where a value is not stated. Use to turn invoices, receipts, orders and contracts into rows.
Inputs
| Name | Type | Description |
|---|---|---|
url (required) | string | Absolute public http(s) URL of the file (or send the file in a POST body instead) |
fields (required) | string | Comma-separated field names to extract (1-30) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/document/extract?url=https%3A%2F%2Fcalibre-ebook.com%2Fdownloads%2Fdemos%2Fdemo.docx&fields=title%2Cebook_formats%2Cpens_needed%2Cscissors_needed"
Or one of your 3 free calls, no key:
curl "https://agent-data-tools.revmesh2074.workers.dev/document/extract?url=https%3A%2F%2Fcalibre-ebook.com%2Fdownloads%2Fdemos%2Fdemo.docx&fields=title%2Cebook_formats%2Cpens_needed%2Cscissors_needed&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"url": "https://calibre-ebook.com/downloads/demos/demo.docx",
"type": "docx",
"data": {
"title": "Demonstration of DOCX support in calibre",
"ebook_formats": [
"EPUB",
"AZW3"
],
"pens_needed": 3,
"scissors_needed": 1
},
"missing": [],
"model": "@cf/meta/llama-4-scout-17b-16e-instruct",
"charsRead": 8934,
"truncated": false
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is document_extract, and the first 25 successful calls are free:
https://agent-data-tools.revmesh2074.workers.dev/mcp