Skip to main content
The Extract API accepts Markdown, a schema that names the fields to pull, an optional model, and an optional options object. The same core fields work whether you call it synchronously or create an Extract Job, which takes a few additional parameters of its own.

Sample Request

Create an Extract Job on the standard service tier, then collect the extraction from the finished job. Replace YOUR_API_KEY with your API key and parse-output.md with the path to your Markdown file.

Parameters

Provide the Markdown

The Extract API works on a Markdown string. That Markdown can come from any source: the Parse API, a third-party parser, a web scraper, or a hand-authored document. For the best results, use Markdown produced by the Parse API. Parse output preserves the document’s reading order and structure, which improves extraction accuracy, and it embeds a <!-- doc_id=<id> --> comment that Extract reads automatically and echoes back as metadata.doc_id. This links each extraction to the parse job it came from. Pass the Markdown in one of two ways:
  • markdown: the Markdown content, sent as a string or an uploaded file.
  • markdown_url: a public URL that the API fetches the Markdown from.
Provide exactly one of these fields per request.

Set the Extraction Schema

Set the extraction schema in the schema field. The schema is a JSON object with a properties map that names each field and describes what to extract. The schema must meet specific format and property requirements. For detailed guidance, see Extraction Schema (JSON).

Options

Pass optional settings in the options field as a JSON object. The Extract API accepts one option: To enable strict mode, add it to your request. In cURL, pass the options form field; the client libraries expose it as the top-level strict parameter:

Model Version

By default, requests use the latest snapshot of the extraction model. To pin to a specific snapshot, supply it in the model form field. The resolved version is returned in metadata.model_version. Use the -latest alias for development or when you want continuous improvements; pin to a dated snapshot for production workloads where consistent results matter. To set the model, add the model field to your request:
Some snapshots have been superseded: a newer snapshot replaced them, and they no longer appear in the table above. If you pin a superseded snapshot, your requests still succeed. The API resolves the name to the current snapshot and reports the current version in metadata.model_version. Update pinned code to a value from the table.