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

POST /api/v1/translate

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 uses the current per-page credit rate shown in the product. Check the live rate and your balance in Settings → Credits before submitting a task.

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?

The per-page rate comes from the current runtime configuration and is shown in the product. Starter credits may be available when enabled; check Settings → Credits for the live balance and offer.

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.