This page is the definitive guide to the Indox Python client for Docs and Media. It covers setup, response shapes, status codes, and end-to-end flows you can copy into your app.
Install & Configure
Code
Env vars the client reads:
INDOX_API_KEY(required)INDOX_DOCS_URL(defaulthttps://indox.org/docs)INDOX_MEDIA_URL(defaulthttps://indox.org/media)- Optional
timeoutwhen constructing the client (number or(connect, read)tuple).
Create a client:
Code
Response Shapes You’ll See
Create (Docs/Media): convert_* methods return an accepted job payload.
Code
Status (poll or wait):
Code
- Pending jobs return HTTP
202with the same shape butsuccess: falseand nodownload_url. - Failed jobs set
success: falseand include an error message/code when available.
Downloads: download_media / docs.download stream the file to disk and return the saved Path. HTTP status 200 streams the file; 404 means the job or format is unavailable; 401/403 mean the API key is missing or lacks scope.
Status Codes Cheat Sheet (server + client expectations)
- GET single (status/info/download):
200(ready),202(processing),401,403,404. - POST create (convert):
202(accepted) or201(synchronous),400(validation),401,403,409(quota/duplicate),429(rate limit). - Downloads:
200,401,403,404. - Batch collect:
202,400,401,403,409. - Deletions/hide endpoints (when enabled):
204,401,403,404. The Python client treats non-success statuses asIndoxHTTPError; includestatusandrequest_idin your logs.
Example Flows
Convert a document from S3 and wait
Code
Convert an image via upload
Code
Handle errors gracefully
Code
Field Notes & Options
target_formatsis always required; strings are normalized (e.g.,"PDF","pdf",".pdf"all work).- Choose one source per request:
file_pathorfile_urlors3_key. destination:aws(default),google_drive,dropbox,box,onedrive.redirect_url: set to receive a callback/redirect after completion.options: pass structured JSON for engine-specific tweaks; the client will serialize for you.- Timeouts: pass
timeout=(connect, read)when building the client for large uploads/videos. - Close sessions in long-running processes:
client.close().
Where to Explore the APIs
- Auth:
/api/indox-auth(sidebar) - Docs Conversion:
/api/indox-docs - Media Conversion:
/api/indox-media
Last modified on