Skip to content

Anyparser API Reference

Anyparser provides a REST API that allows you to integrate document parsing capabilities into your applications. The API supports multiple file types and parsing models, and it returns structured data in Markdown and JSON formats.

Select the endpoint nearest to you.
Get your free API key with unlimited developer usage. No credit card required. Get Free API Key

or drag and drop

PDF, DOC up to 10MB

Tables
Images

Result

No documents processed yet.

Base URL

The base URL for all API requests is:

https://api.anyparser.com/v1

Authentication

To authenticate API requests, you need to include your API key in the Authorization header. The format should be:

Authorization: Bearer <your-api-key>

You can obtain your API key from your account dashboard.

API Endpoints

1. POST /parse

This endpoint processes a document and returns the parsed content in the specified output format (Markdown or JSON).

Request

Terminal window
POST /v1/parse

Request Parameters

  • file (form-data): The document to be parsed. Supports PDFs, Word documents, Excel files, images (OCR), audio, and more.
  • model (optional, query): Choose the parsing model. Supported values:
    • text: Basic text extraction (fast).
    • ocr: OCR for images and scanned documents.
    • vlm: Vision Language Model for complex or diverse data (slower but more accurate).

Example Request (cURL)

Terminal window
curl -X POST https://api.anyparser.com/v1/parse \
-H "Authorization: Bearer your-api-key" \
-F "file=@/path/to/document.pdf" \
-F "model=text"

Example Response

{
"markdown": "# Sample Document\n\nThis is the content of the document..."
}

2. POST /batch-parse

This endpoint allows you to parse multiple files in a single request.

Request

Terminal window
POST /v1/batch-parse

Request Parameters

  • files (form-data): An array of documents to be parsed. Supports the same formats as the /parse endpoint.
  • model (optional, query): Choose the parsing model (text, ocr, vlm).

Example Request (cURL)

Terminal window
curl -X POST https://api.anyparser.com/v1/batch-parse \
-H "Authorization: Bearer your-api-key" \
-F "files[]=@/path/to/document1.pdf" \
-F "files[]=@/path/to/document2.pdf" \
-F "model=text"

Example Response

[
{
"markdown": "# Document 1\n\nThis is the first document."
},
{
"markdown": "# Document 2\n\nThis is the second document."
}
]

3. GET /models

This endpoint returns the available parsing models and their descriptions.

Request

Terminal window
GET /v1/models

Example Response

{
"models": [
{
"name": "text",
"description": "Basic text extraction, ideal for documents without tables."
},
{
"name": "ocr",
"description": "OCR for extracting text from images and scanned documents."
},
{
"name": "vlm",
"description": "Vision Language Model (VLM) for diverse and complex data extraction."
}
]
}

Error Handling

If the API encounters an error, it will return a structured error response. The response will include a status code, error message, and an optional error description.

Example Error Response

{
"error": {
"code": "invalid_file_type",
"message": "The uploaded file type is not supported. Please upload a PDF, Word, or image file."
}
}

Common Error Codes

CodeDescription
invalid_api_keyThe API key provided is invalid.
invalid_file_typeThe uploaded file type is not supported.
model_not_foundThe specified model is not available or is misspelled.
too_largeThe uploaded file exceeds the size limit.

Rate Limits

Anyparser enforces rate limits to ensure fair usage. The current rate limit is:

  • Requests per minute: 60
  • Requests per day: 1,000

If you exceed the rate limit, you will receive a 429 Too Many Requests error.