Tools
Invoice to JSON API
Submit an invoice PDF. Get back vendor, line items, totals, dates, and full text content as structured JSON. No templates, no training.
Try it below:
Turn invoices into structured JSON
Upload an invoice PDF or submit a URL, get structured JSON back.
What is Exabase's invoice to JSON API?
Submit an invoice PDF to the Exabase Extract API and get structured JSON back. The API detects the document type automatically and extracts invoice-specific fields: vendor name, invoice number, issue date, due date, line items with quantities and amounts, and total. You also get the full text content split into searchable chunks, page count, author, creation date, and a CDN-hosted thumbnail and rendered PDF.
This is the same POST /v2/extract endpoint used for all document types. When the API recognises an invoice, it sets extraction.document.documentType to invoice and populates extraction.document.structured with the extracted fields. No template configuration, no field mapping, no training step. Submit the PDF and read the output.
What you get back
The response includes the standard document metadata (page count, author, title, creation date, MIME type, file size) alongside the invoice-specific structured data. The structured object contains vendor, invoiceNumber, issueDate, dueDate, lineItems (each with description, quantity, unit price, and amount), and total. Full text content is split into searchable chunks with page numbers. You also get a CDN-hosted thumbnail and a rendered version of the PDF. The API reference has the complete response schema.
One multi-modal API
The same POST /v2/extract endpoint handles every content type Exabase supports. For PDFs, it returns page count, author, title, and structured field extraction when it recognises the document type. Invoices, contracts, and resumes each get their own set of extracted fields. For images, it runs OCR. For audio and video, it generates full transcripts with timestamps. For web pages, it renders JavaScript and extracts the content.
The submission flow is identical across all types: one endpoint, one SDK method, one webhook configuration. You learn the pattern once and use it for everything. The Extract docs cover each content type in detail.
What you can build with it
The structured invoice data maps directly to the fields your system needs. Build an accounts payable pipeline that extracts vendor, line items, and totals without manual data entry. Feed the structured output into your ERP or accounting system. Run spend analysis across a batch of invoices by querying the extracted fields. Flag invoices where the line item amounts don't sum to the stated total.
The text chunks work in RAG pipelines too. Store processed invoices as Resources in a Base and search across all of them through Deep Search at the paragraph level. Workers can process new invoices as they arrive, keeping your accounts payable data current without manual work.
Beyond invoice parsing
The Extract API returns more than structured fields. You get the full text as chunks, a CDN-hosted thumbnail, a rendered PDF, and standard document metadata. Store the output as a Resource and it's searchable through Deep Search immediately. Extract key details into Memory so your agent retains invoice history between sessions. The Submitting Jobs guide at https://exabase.io/docs/developer-guide/extraction/submitting-jobs walks through the full flow.
How do I use it?
Get your API key
Free, no credit card:
Sign up at exabase.io and copy your API key from the dashboard.
Submit an invoice PDF
Using the SDK (Node.js):
Get the result
Poll the job until state reaches completed, or skip polling entirely with webhooks.
One API call. No templates, no field mapping, no training.
Why Exabase
Works with other Exabase features
Use cases
FAQs
What is Exabase?
Exabase is infrastructure for AI agents. It gives your agents memory, versioned file storage, AI deep search, and context automation through a set of APIs. Store what your agent learns, search inside any content type, and keep knowledge bases current automatically. Built for production use. Give your agent precise context and cut your token spend by up to 81%.
Who uses Exabase?
Developers and teams building AI agents, copilots, and RAG applications. If your agent needs to remember things between sessions, store and retrieve files, search across documents and media, or stay up to date without manual maintenance, Exabase handles that infrastructure so you can focus on your product.
Do I need to configure templates for different invoice layouts?
No. The API detects invoices and extracts structured fields automatically. No template setup, no per-vendor configuration.
What fields does it extract?
Vendor name, invoice number, issue date, due date, line items (with description, quantity, unit price, and amount), and total. The exact fields depend on the document content. Treat the structured object as a free-form object and access only the keys you need.
Does it handle scanned invoices?
Yes. OCR is built in. Submit a scanned invoice the same way you'd submit a digital PDF. The API detects the content type and processes accordingly.
How accurate is the extraction?
Accuracy depends on the document quality and layout. Digital PDFs with clear formatting produce the most reliable output. The structured fields are best treated as a starting point: validate critical values (like totals) in your application logic before acting on them.
What if the API doesn't recognise the PDF as an invoice?
The documentType field will be set to other and the structured object may be absent or empty. You still get the full text as chunks, page count, author, creation date, thumbnail, and rendered PDF.
Can I submit a URL instead of uploading a file?
Yes. Pass a url field in the request body pointing to a publicly accessible PDF. Exabase fetches and processes it.
Do I have to poll for results?
No. You can configure a webhook URL and Exabase will POST the full result to your server when processing completes. The webhooks guide covers setup.
What happens if extraction fails?
The job state moves to failed. You can call the reprocess endpoint to retry without re-uploading the original file.
How long are files retained?
Stored files are retained for 1 day from job creation, then permanently deleted. Download or copy anything you need before the retention window expires.
Does it work with password-protected PDFs?
No. Password-protected PDFs cannot be processed. Remove the password before submitting.
Can I use the extracted content with other Exabase features?
Yes. Store processed invoices as a Resource in a Base and the content becomes searchable through Deep Search. Extract key details into Memory so your agent retains invoice history. Workers can process new invoices automatically as they arrive.
Is there an SDK?
Yes. The @exabase/sdk package for Node.js/TypeScript handles file streaming, job polling, and chunk retrieval. Install with npm install @exabase/sdk. Or call the REST API directly from any language.
What other document types does Extract recognise?
Contracts and resumes also get structured field extraction. See the Contract to JSON and Resume to JSON tool pages. General PDFs return text chunks and metadata without the structured object. The same endpoint also handles images, audio, video, and web pages.