API reference

Base URL https://api.extract.pageindex.ai/v1. Send your API key as a bearer token: Authorization: Bearer $PAGEINDEX_EXTRACT_API_KEY.

EndpointWhat it does
POST /extractStart an extraction.
GET /extract/{id}A job, with its result once completed.
GET /extractYour jobs, newest first.
POST /extract/{id}/cancelStop a job.
DELETE /extract/{id}Delete a job and its result.

A document is extracted from by its id. Upload PDFs with POST https://api.search.pageindex.ai/v1/documents (up to 100 MB; the same key), as in the quick start; the Python SDK uploads for you, to your Page Extract collection (pass collection to choose another).

Start an extraction

POST /extract starts a job and answers it at once, PENDING.

curl https://api.extract.pageindex.ai/v1/extract \
  -H "Authorization: Bearer $PAGEINDEX_EXTRACT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"document": "doc_60a07bcef3094b68806070f2",
       "configuration": {"data_schema": {...}, "tier": "standard", "cite_sources": true}}'
FieldWhat it is
documentRequired. The id of one of your documents, ready to read.
configuration.data_schemaRequired. The JSON Schema of the result, an object at the top, up to 1 MB. See Writing a schema.
configuration.tierstandard ($0.03 a page, the default) or pro ($0.05 a page).
configuration.target_pagesOnly these pages, such as 5 or 3-12; only they are charged. The full range must be within the document. All pages when left out.
configuration.cite_sourcestrue to also give the page each list item is on, in extract_metadata. Default false.
configuration.system_promptInstructions about the whole document, such as "Amounts are in thousands". Up to 4,000 characters.

Starting a job needs credit for its pages at its tier; it is charged only when the job completes.

Get a job

GET /extract/{id} answers the job; once it is COMPLETED, with its result.

{
  "id": "ext_7b56d419dd0a4d7eafa68e4c",
  "status": "COMPLETED",
  "document": "doc_60a07bcef3094b68806070f2",
  "configuration": {"data_schema": {…}, "tier": "standard", "cite_sources": true},
  "extract_result": {"company": "…", "segments": [{"name": "…", "revenue_usd_millions": …}, …]},
  "extract_metadata": {"field_metadata": {"/segments/0": {"page": 34}, "/segments/1": {"page": 34}, …}},
  "usage": {"pages": 93, "credits": 2.79},
  "created_at": "2026-11-08T12:07:53Z",
  "updated_at": "2026-11-08T12:08:12Z"
}
FieldWhat it is
idThe job's id, ext_….
statusPENDING, RUNNING, COMPLETED, FAILED or CANCELLED. See Jobs.
documentThe document's id.
configurationThe configuration it was started with.
extract_resultOnce completed: the data, fitting the schema. A value the document does not give is null.
extract_metadata.field_metadataWith cite_sources: the page of each list item, by its path in the result (a JSON Pointer).
usageOnce completed: the pages charged and their cost, in dollars of credit.
error_messageWhy a job failed.
created_at, updated_atWhen it was started, and last changed.

List jobs

GET /extract lists your jobs, newest first, without their results. limit is 1 to 100 (default 20); pass the answer's next as after for the jobs after them.

{"jobs": [{"id": "ext_…", "status": "COMPLETED", …}, …], "next": "ext_…"}

Cancel a job

POST /extract/{id}/cancel stops a job that is PENDING or RUNNING and answers it, CANCELLED. Nothing is charged.

Delete a job

DELETE /extract/{id} deletes a job and its result, stopping it first if it is running. Answers {"id": "ext_…", "deleted": true}.

Errors

An error answers its status and a code:

{"error": {"code": "insufficient_credit", "message": "Extracting 93 pages at the standard tier takes $2.79 of credit; add credit in the console."}}
StatusCodeWhen
400invalid_schemaThe schema is not valid JSON Schema, or its top is not an object.
400schema_too_largeThe schema is larger than 1 MB.
400invalid_target_pagesThe pages are not within the document.
401unauthorizedNo API key, or one that is not valid.
402insufficient_creditNot enough credit for the job's pages; add some in the console.
404document_not_found, job_not_foundNo such document or job of yours.
409document_not_readyThe document is still being processed; try again once it is ready.
409job_finishedThe job is already done, so it cannot be cancelled.
422invalid_requestA required field is missing, invalid, or too long.