Skip to main content
Copy and adapt these examples for your own parsing tasks. All examples use the REST API with the requests library and read credentials from environment variables.
See Configuration for all available options and Response Format for the full response structure.

Parse a PDF

Convert a PDF document to Markdown and structured elements.

Parse from a URL

Parse a document directly from a hosted URL without uploading the file.

Parse specific pages

Use page_range to parse only selected pages.

Extract tables

Enable include_table_structure to return structured row, column, and cell data.

Extract formulas

Enable include_inline_objects to detect inline formulas, and read standalone Formula elements directly.

Parse scanned documents

Use preprocessing options only when the document needs them.

Extract images

Enable include_image_data to return image URLs for Image elements.

Parse a password-protected PDF

Pass the PDF password in the document section of the config.

Convert coordinates to pixels

Element coordinates are normalized to the page width and height.

Build a RAG pipeline

Parse a document into Markdown, split it into chunks, and prepare it for embedding.

Process large files asynchronously

For large or complex documents, use the asynchronous API. See Async Processing for the complete guide.

Handle errors

Check the response code and handle common failures.
See Errors for the complete error code reference.

Configuration

Customize parsing behavior.

Response Format

Understand the response structure.

Async Processing

Process large documents asynchronously.