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.
Result
Base URL
The base URL for all API requests is:
Authentication
To authenticate API requests, you need to include your API key in the Authorization
header. The format should be:
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
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)
Example Response
2. POST /batch-parse
This endpoint allows you to parse multiple files in a single request.
Request
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)
Example Response
3. GET /models
This endpoint returns the available parsing models and their descriptions.
Request
Example Response
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
Common Error Codes
Code | Description |
---|---|
invalid_api_key | The API key provided is invalid. |
invalid_file_type | The uploaded file type is not supported. |
model_not_found | The specified model is not available or is misspelled. |
too_large | The 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.