Quickstart Code Example
Run an extraction pipeline over a manifest — in Python
The Extract API runs a named pipeline over a set of documents listed in a manifest in your own S3 bucket. Like the Prep API it reads and writes your storage directly, so a job needs storage credentials as well as your API key.
Create a session
Authentication is an API key in the X-API-Key header.
Find a pipeline
Pipelines are named, and which ones exist depends on your deployment — so ask rather than hard-coding a name.
Each pipeline takes its own parameters, which you can inspect before submitting:
Create a job
manifest_key is the object key of the manifest within your input bucket, and
aws_region is the region that bucket lives in.
No bucket name appears in the request. Your input and output buckets are fixed during onboarding and resolved from your API key, so a job names only the key inside them — the credentials you send are what lets the service read and write those buckets on your behalf.
These credentials are used by the service to read your documents and write your results. Scope them to the buckets this job needs.
Wait for it to finish
A job moves through queued, validating, ingesting and running before it
reaches completed, failed or cancelled; it can also sit at paused.
Collecting adds three more — see below. Once the retention window has passed the
job reports output_expired: it succeeded, but its output can no longer be
collected, so treat that as terminal too or a polling loop will never exit.
Collect the output
Collecting is a transfer, not a download: the service copies the results into
your bucket under output_prefix, with the job id appended, so it needs the
credentials and region again.
The job then reports transferring, and finishes at transfer_completed or
transfer_failed. Your results land in your output bucket — again the one from
onboarding, not named here — under extract-output/<job_id>/.
