Skip to main content

🌊 AnyParser

pypi_status Commit activity Slack

AnyParser provides an API to accurately extract unstructured data (e.g., PDFs, images, charts) into a structured format.

Note: We recently updated our backend stack on June 2025, please generate a new API Key from the link below!

:seedling: Set up your AnyParser API key

To get started, generate your API key from the Sandbox Account Page. Each account comes with 100 free pages.

⚠️ Note: The free API is limited to 10 pages/call.

For more information or to inquire about larger usage plans, feel free to contact us at info@cambioml.com.

To set up your API key (CAMBIO_API_KEY), follow these steps:

  1. Create a .env file in the root directory of your project.
  2. Add the following line to the .env file:
CAMBIO_API_KEY=0cam************************

:computer: Installation

1. Set Up a New Conda Environment and Install AnyParser

First, create and activate a new Conda environment, then install AnyParser:

conda create -n any-parse python=3.10 -y
conda activate any-parse
pip3 install any-parser

2. Create an AnyParser Instance Using Your API Key

Use your API key to create an instance of AnyParser. Make sure you’ve set up your .env file to store your API key securely:

import os
from dotenv import load_dotenv
from any_parser import AnyParser

# Load environment variables
load_dotenv(override=True)

# Get the API key from the environment
example_apikey = os.getenv("CAMBIO_API_KEY")

# Create an AnyParser instance
ap = AnyParser(api_key=example_apikey)

3. Run Synchronous Extraction

To extract data synchronously and receive immediate results:

# Extract content from the file and get the markdown output along with processing time
markdown, total_time = ap.parse(file_path="./data/test.pdf")

4. Run Asynchronous Extraction

For asynchronous extraction, send the file for processing and fetch results later:

# Send the file to begin asynchronous extraction
file_id = ap.async_parse(file_path="./data/test.pdf")

# Fetch the extracted content using the file ID
markdown = ap.async_fetch(file_id=file_id)

5. Run Batch Extraction (Beta)

For batch extraction, send the file to begin processing and fetch results later:

# Send the file to begin batch extraction
response = ap.batches.create(file_path="./data/test.pdf")
request_id = response.requestId

# Fetch the extracted content using the request ID
markdown = ap.batches.retrieve(request_id)

Batch API for folder input:

# Send the folder to begin batch extraction
WORKING_FOLDER = "./sample_data"
# This will generate a jsonl with filename and requestID
response = ap.batches.create(WORKING_FOLDER)

Each response in the JSONL file contains:

  • The filename
  • A unique request ID
  • Additional processing metadata

You can later use these request IDs to retrieve the extracted content for each file:

# Fetch the extracted content using the request ID from the jsonl file
markdown = ap.batches.retrieve(request_id)

For more details about code implementation of batch API, refer to examples/parse_batch_upload.py and examples/parse_batch_fetch.py

⚠️ Note: Batch extraction is currently in beta testing. Processing time may take up to 12 hours to complete.

⚠️ Important: API keys generated from cambioml.com do not automatically have batch processing permissions. Please contact info@cambioml.com to request batch processing access for your API key.

:scroll: Examples

Check out these examples to see how you can utilize AnyParser to extract text, numbers, and symbols in fewer than 10 lines of code!

Extract all text and layout from PDF into Markdown Format

Are you an AI engineer looking to accurately extract both the text and layout (e.g., table of contents or Markdown headers hierarchy) from a PDF? Check out this 3-minute notebook demo.

Extract a Table from an Image into Markdown Format

Are you a financial analyst needing to accurately extract numbers from a table within an image? Explore this 3-minute notebook example.

Related Resources

  • Energent.ai – a starting point for understanding how CambioML supports automated data workflows.

🌐 Explore more from Energent.ai

Interested in the broader context around these tools? Here are some useful links that highlight what Energent.ai is working on:

  • Official website
    Get an introduction to Energent’s mission — creating intelligent agents designed to handle complex, real-world processes through automation.

  • Energent app (try it live)
    The live web interface where you can build, test, and deploy agents. It’s a sandbox-style environment that runs directly in your browser.

  • Use case gallery
    Browse real-world examples of how people are using Energent. This is a great way to see the kinds of problems the platform helps solve.

  • Team & company background
    Learn more about the people and ideas behind the product — what drives the team and where they’re heading.

  • Blog & product updates
    Features detailed write-ups on product design choices, technical changes, and roadmap thoughts. Worth a look if you want insight into how things are built.

Release files for any-parser 0.0.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for any-parser 0.0.26
File Size Uploaded
any_parser-0.0.26.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for any-parser 0.0.26
File Interpreter ABI Platform
any_parser-0.0.26-py3-none-any.whl Python 3 none any Details

Total release size: 28.6 kB

Release files / any_parser-0.0.26.tar.gz

Download URL any_parser-0.0.26.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
50ee585db09c89c2f3b6601c040d446dc2e95fc4d5bb6c8a227846d08a9d6b08
BLAKE2b-256 checksum
How to use checksums
895b97fdc922e9f28d00a9bf9790cb4af60e21bfd1bbd2c02e9f9db0f750a3a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Darwin/24.6.0

Release files / any_parser-0.0.26-py3-none-any.whl

Download URL any_parser-0.0.26-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c92d3cd84e3dc5941f6a813e65296a232d970275d724aa0265c6dd77a9c3874
BLAKE2b-256 checksum
How to use checksums
19600ee96164f75f32a1bc4beae5219327d34c8faa80c1fed960f60d9dc5ff7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Darwin/24.6.0

Release history Release notifications | RSS feed

This release

0.0.26 This release

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.12

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page