Tools
Contract to JSON API
Turn contracts into structured JSON
Upload a contract PDF or submit a URL, get structured JSON back.
What is Exabase's contract to JSON API?
Submit a contract PDF to the Exabase Extract API and get structured JSON back. The API detects the document type automatically and extracts contract-specific fields: the parties involved, effective date, expiration date, governing law, and a list of clauses with titles and summaries. 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 a contract, it sets extraction.document.documentType to contract and populates extraction.document.structured with the extracted fields. No template configuration, no clause library setup, 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 contract-specific structured data. The structured object contains parties (an array of party names), effectiveDate, expirationDate, governingLaw, and clauses (each with a title and summary). 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. Contracts, invoices, 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 contract data gives you a machine-readable starting point for review workflows. Build a contract intake pipeline that extracts parties, dates, and governing law without manual reading. Surface expiring contracts by querying the expirationDate field across a batch. Search across all clause summaries to find agreements with specific terms or provisions.
The text chunks work in RAG pipelines too. Store processed contracts as Resources in a Base and search across all of them through Deep Search at the paragraph level. Your agent can answer questions about specific clauses by citing the page and paragraph where the language appears. Workers can process new contracts as they arrive, keeping your contract repository indexed without manual work.
Beyond contract 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 terms into Memory so your agent retains contract details 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 a contract 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 clause library, no training.
Why Exabase
Comparisons
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 contract types?
No. The API detects contracts and extracts structured fields automatically. No template setup, no per-format configuration.
What fields does it extract?
Parties (as an array of names), effective date, expiration date, governing law, and clauses (each with a title and summary). 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 contracts?
Yes. OCR is built in. Submit a scanned contract 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 structure. Well-formatted contracts with clear section headings produce the most reliable output. The structured fields are a starting point: your own legal review sits on top. Validate critical terms in your application logic before acting on them.
What if the API doesn't recognise the PDF as a contract?
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.
Is the extraction suitable for legal decisions?
The API extracts structured data from the document. Legal interpretation, compliance determinations, and binding decisions are your responsibility. The extraction output is a data layer, not legal advice.
Can I use the extracted content with other Exabase features?
Yes. Store processed contracts as a Resource in a Base and the content becomes searchable through Deep Search. Extract key terms into Memory so your agent retains contract details. Workers can process new contracts 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?
Invoices and resumes also get structured field extraction. See the Invoice 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.