API Documentation
Translate PDFs programmatically with our simple REST API. Get an API key from your settings and start translating PDFs in minutes.
Authentication
Include your API key in requests using either an Authorization header (Bearer token) or an X-API-Key header. Create and manage your keys in Settings → API Keys.
Endpoint
https://translatepdfonline.com/api/v1/translate
Request Body
{
"document_id": "string (required)",
"source_lang": "string (required) — en|zh|es|fr|it|el|ja|ko|de|ru",
"target_lang": "string (required) — en|zh|es|fr|it|el|ja|ko|de|ru",
"page_range": "string (optional) — e.g. '1-10' or '5'"
}cURL
curl -X POST https://translatepdfonline.com/api/v1/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_id": "doc_xxx",
"source_lang": "en",
"target_lang": "zh",
"page_range": "1-10"
}'Python
import requests
url = "https://translatepdfonline.com/api/v1/translate"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"document_id": "doc_xxx",
"source_lang": "en",
"target_lang": "zh",
"page_range": "1-10"
}
response = requests.post(url, json=data, headers=headers)
print(response.json()) # {"task_id": "...", "status": "queued"}Node.js
const response = await fetch(
"https://translatepdfonline.com/api/v1/translate",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
document_id: "doc_xxx",
source_lang: "en",
target_lang: "zh",
page_range: "1-10"
})
}
);
const data = await response.json();
console.log(data); // { task_id: "...", status: "queued" }Rate Limiting
Each API key is limited to 60 requests per minute. Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining) are included in every response.
Pricing
Translation consumes 10 credits per page. Check your credit balance in Settings → Credits. Purchase more credits or subscribe for regular top-ups.
Frequently Asked Questions
How do I get an API key for PDF translation?
Sign up at translatepdfonline.com, go to Settings → API Keys, and click "Create API Key". Copy your key immediately — it will not be shown again.
What languages does the translation API support?
The API supports 10 languages: English (en), Chinese (zh), Spanish (es), French (fr), Italian (it), Greek (el), Japanese (ja), Korean (ko), German (de), and Russian (ru).
How much does it cost to use the API?
Each translated page costs 10 credits. New users receive free trial credits. You can purchase credits or subscribe for monthly top-ups.
How do I check the status of my translation?
After submitting a translation, you receive a task_id. Poll GET /api/tasks/{task_id} to check the status (queued → processing → completed/failed).
Is there a rate limit on the API?
Yes, each API key is limited to 60 requests per minute. If you exceed this limit, you will receive a 429 response. Contact us if you need a higher limit.