API Documentation
Integrate FreeOCR.AI into your applications with our powerful API.
Authentication
All API requests require an API key passed in the Authorization header as a Bearer token.
Create and manage your API keys in the API Keys page.
Rate Limits
Default rate limit: 200 requests per minute per API key.
Rate limits can be adjusted per key. Contact support for custom limits.
POST /ocr
Live demoExtract text from images with layout preservation.
Parameters
image(required) - Image fileformat(optional) - Response format: json (default), text, docxversion(optional) - Model version: 261029 (default), 260428Response
{
"text": "# Document Title\n\nExtracted markdown content..."
}Returns GitHub Flavored Markdown with layout preservation, including HTML tables and LaTeX formulas.
{
"text": "Document Title\n\nExtracted plain text content..."
}Markdown is stripped to plain text via internal conversion.
Binary file download. Content-Disposition: attachment; filename="result.docx"
Example
curl -X POST "https://freeocr.ai/api/v1/platform/ocr" \
-H "Authorization: Bearer focr_your_key" \
-F "image=@document.png"POST /table
Live demoExtract tables from images into structured data.
Parameters
image(required) - Image fileformat(optional) - Response format: json (default), csv, xlsxversion(optional) - Model version: 261029 (default), 260428Response
{
"tables": [
{
"title": "Sales Report",
"html": "<table><tr><th>Item</th><th>Qty</th></tr><tr><td>Apple</td><td>10</td></tr></table>"
}
]
}Each table includes a title and its content as an HTML table string.
Plain-text CSV download. Multiple tables are separated by --- SheetName --- delimiters. Content-Disposition: attachment; filename="tables.csv"
Binary XLSX file download. Each table becomes a separate sheet named after its title. Content-Disposition: attachment; filename="tables.xlsx"
Example
curl -X POST "https://freeocr.ai/api/v1/platform/table" \
-H "Authorization: Bearer focr_your_key" \
-F "image=@spreadsheet.png"POST /extract
Live demoExtract specific fields from images using AI.
Parameters
image(required) - Image filefields(required) - Fields to extract (repeat or JSON array)format(optional) - Response format: json (default), csv, xlsxversion(optional) - Model version: 261029 (default), 260428Response
{
"result": [
{ "key": "name", "values": ["John Doe"] },
{ "key": "date", "values": ["2024-03-15"] },
{ "key": "amount", "values": ["$1,234.56"] }
]
}Each requested field is returned as a key with an array of extracted values.
CSV file with field keys as column headers and extracted values as rows. Content-Disposition: attachment; filename="extraction.csv"
XLSX file with a single "Results" sheet, same layout as CSV. Content-Disposition: attachment; filename="extraction.xlsx"
Example
curl -X POST "https://freeocr.ai/api/v1/platform/extract?fields=name&fields=date&fields=amount" \
-H "Authorization: Bearer focr_your_key" \
-F "image=@invoice.png"Error Responses
Unauthorized
{ "error": { "code": "unauthorized", "message": "Invalid API key" } }Insufficient Balance
{ "error": { "code": "insufficient_credits", "message": "Insufficient balance. Please top up." } }Rate Limit Exceeded
{ "error": { "code": "rate_limit_exceeded", "message": "Rate limit exceeded. Try again later." } }Internal Error
{ "error": { "code": "internal_error", "message": "Failed to process image" } }