API Documentation
Integrate Free OLM OCR into your applications with REST APIs, API key authentication, and AI client workflows.
API Key AuthenticationMultiple Upload MethodsREST API
1
Get API Key
Sign in to your account and generate an API key from the settings page.
Go to Settings2
Choose Upload Method
Send PDFs or images as Base64 data URLs for synchronous OCR processing.
3
Start Processing
Send images or PDFs to the OCR API and receive structured text data.
OCR Processing
Extract text from images and PDFs.
Method 1: Base64 Upload
{
"fileName": "document.pdf",
"mimeType": "application/pdf",
"dataUrl": "data:application/pdf;base64,JVBERi0x..."
}Method 2: Image Data URL Upload
{
"fileName": "receipt.png",
"mimeType": "image/png",
"dataUrl": "data:image/png;base64,iVBORw0KGgo..."
}Response
{
"code": 0,
"message": "ok",
"data": {
"text": "Extracted readable content...",
"structured": {
"text": "Extracted readable content...",
"markdown": "# Document title",
"tables": [],
"language": "en",
"warnings": []
},
"model": "deepseek-v3.2",
"fileName": "document.pdf",
"mimeType": "application/pdf",
"bytes": 248120
}
}Authentication
Include your API key in requests.
AI Client Resources
Integration notes for AI agents and OCR client workflows.
REST Endpoint
POST /api/ocrSynchronous Endpoint
Use /api/ocr for synchronous OCRHTTPS Request
- JSON over HTTPS POST
- API key or signed-in session
- PDF, JPEG, PNG, WebP
- Text and structured JSON output
Available OCR Tool
Extract text from documents and images using OCR. Supports PDF files, JPEG, PNG, and WebP images. Send files as Base64 data URLs.
Client Integrations
Build your own OCR client or integrate Free OLM OCR into AI tools through the synchronous REST endpoint.
- Call POST /api/ocr from server-side application code.
- Authenticate with x-api-key or Authorization: Bearer.
- Send PDF and image files as Base64 data URLs.
- Use the response text or structured JSON in downstream AI workflows.
Code Examples
Ready-to-use code snippets.
Python
import base64
import requests
with open("document.pdf", "rb") as f:
file_data = base64.b64encode(f.read()).decode()
response = requests.post(
"https://www.freeolmocr.com/api/ocr",
headers={"x-api-key": "sk_your_api_key"},
json={
"fileName": "document.pdf",
"mimeType": "application/pdf",
"dataUrl": f"data:application/pdf;base64,{file_data}",
},
)
print(response.json()["data"]["text"])cURL
IMAGE_DATA=$(base64 -i document.pdf)
curl -X POST https://www.freeolmocr.com/api/ocr \
-H "x-api-key: sk_your_api_key" \
-H "Content-Type: application/json" \
-d "{
\"fileName\": \"document.pdf\",
\"mimeType\": \"application/pdf\",
\"dataUrl\": \"data:application/pdf;base64,$IMAGE_DATA\"
}"Need Help?
Get started quickly with our API or reach out for support.