API Documentation
Everything you need to integrate AIbit Translator — a fast, affordable REST API for translating text, JSON, and HTML across 190+ languages. Send your first request in two minutes.
Base URLhttps://aibit-translator.p.rapidapi.com/api/v1/translator
Getting Started
The AIbit Translator API turns any text, JSON document, or HTML page into 190+ languages with a single REST call. No SDK, no lock-in — if your language can make an HTTP request, you can use it. You'll send your first translation in under two minutes.
1. Get an API key
The API is distributed through RapidAPI. Create a free account, subscribe to the free tier (1,000 requests/month, no credit card required), and copy your key from the X-RapidAPI-Key field.
2. Base URL
Every endpoint is a path under one base URL:
https://aibit-translator.p.rapidapi.com/api/v1/translator
3. Your first request
Send a POST to /text with a form-encoded body. This translates “Hello, world” from English to Vietnamese:
curl -X POST "https://aibit-translator.p.rapidapi.com/api/v1/translator/text" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com" \-H "Content-Type: application/x-www-form-urlencoded" \--data-urlencode "from=en" \--data-urlencode "to=vi" \--data-urlencode "text=Hello, world"
You'll get back a clean JSON response:
{"trans": "Xin chào thế giới"}
application/x-www-form-urlencoded, not JSON. Every language's HTTP client has a helper for this (URLSearchParams, requests data dict,http_build_query). See Code Examples for ready-to-paste snippets.Authentication
Authentication is handled entirely through RapidAPI headers. Attach these two headers to every request — RapidAPI validates your key and forwards the call to AIbit:
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-RapidAPI-Key | string | required | Your personal API key from the RapidAPI dashboard. |
| X-RapidAPI-Host | string | required | Always aibit-translator.p.rapidapi.com |
X-RapidAPI-Key: YOUR_API_KEYX-RapidAPI-Host: aibit-translator.p.rapidapi.comContent-Type: application/x-www-form-urlencoded
X-RapidAPI-Key in client-side code — call the API from your backend and proxy the result. A missing or invalid key returns an HTTP 302 redirect to the pricing page.Translate Text
Translate a plain string between any two supported languages.
https://aibit-translator.p.rapidapi.com/api/v1/translator/textBody parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Source language code, or auto to detect it automatically. |
| to | string | required | Target language code. |
| text | string | required | Text to translate. Up to 1,037,299 characters per request. |
| provider | string | optional | Translation engine: google (default), baidu, yandex, or microsoft. |
Request
curl -X POST "https://aibit-translator.p.rapidapi.com/api/v1/translator/text" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com" \-H "Content-Type: application/x-www-form-urlencoded" \--data-urlencode "from=en" \--data-urlencode "to=vi" \--data-urlencode "text=Hello, world"
Response
{"trans": "Xin chào thế giới"}
Auto-detecting the source language
Set from=auto and the API detects the source language for you. When (and only when) you use auto, the response also includes detection metadata:
{"trans": "Xin chào thế giới","source_language_code": "en","source_language": "English","trust_level": 1}
| Response field | Description |
|---|---|
| trans | The translated text. |
| source_language_code | Detected source code (only when from=auto). |
| source_language | Human-readable source language (only when from=auto). |
| trust_level | Detection confidence 0–1 (only when from=auto). |
| dict | Dictionary data for single words, when available (usually null). |
Translate JSON
Translate a JSON document while preserving its exact structure. Only string values are translated — keys, numbers, booleans, arrays, and nesting are returned untouched. Perfect for app localization and CMS content.
https://aibit-translator.p.rapidapi.com/api/v1/translator/jsonBody parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Source language code, or auto. |
| to | string | required | Target language code. |
| json | string (JSON) | required | A stringified JSON object or array. Only string values are translated; keys, numbers, booleans and structure are preserved. |
| protected_paths | string (JSON array) | optional | Dot-notation paths whose values must NOT be translated — e.g. ["user.id","meta.slug"]. |
| common_protected_paths | string (JSON array) | optional | Keys protected at every nesting level, wherever they appear. |
| provider | string | optional | google (default), baidu, yandex, or microsoft. |
Key protection
Use protected_paths to keep specific values in the original language — IDs, slugs, brand names, enum values. Pass a JSON array of dot-notation paths. Below, meta.id is left as-is while everything else is translated to French:
curl -X POST "https://aibit-translator.p.rapidapi.com/api/v1/translator/json" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com" \-H "Content-Type: application/x-www-form-urlencoded" \--data-urlencode 'from=en' \--data-urlencode 'to=fr' \--data-urlencode 'json={"title":"Hello","meta":{"id":"abc-123"}}' \--data-urlencode 'protected_paths=["meta.id"]'
Response
{"trans": {"title": "Bonjour","meta": {"id": "abc-123"}}}
common_protected_paths works like protected_paths but matches a key wherever it appears at any nesting depth — handy for a field like id that repeats across many objects.Translate HTML
Translate an HTML fragment or full page tag-safe. All tags, attributes, classes, and inline styles are preserved — only the visible text nodes are translated. Ideal for translating rich content, emails, and rendered pages without breaking markup.
https://aibit-translator.p.rapidapi.com/api/v1/translator/htmlBody parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Source language code, or auto. |
| to | string | required | Target language code. |
| html | string | required | HTML markup. Tags, attributes and classes are kept intact — only visible text nodes are translated. |
| provider | string | optional | google (default), baidu, yandex, or microsoft. |
Request
curl -X POST "https://aibit-translator.p.rapidapi.com/api/v1/translator/html" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com" \-H "Content-Type: application/x-www-form-urlencoded" \--data-urlencode 'from=en' \--data-urlencode 'to=es' \--data-urlencode 'html=<p>Hello <b>world</b></p>'
Response
{"trans": "<p>Hola <b>mundo</b></p>"}
Detect Language
Identify the language of a piece of text without translating it.
https://aibit-translator.p.rapidapi.com/api/v1/translator/detect-languageBody parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | required | Text whose language you want to identify. Up to 1,037,299 characters. |
Request
curl -X POST "https://aibit-translator.p.rapidapi.com/api/v1/translator/detect-language" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com" \-H "Content-Type: application/x-www-form-urlencoded" \--data-urlencode 'text=Bonjour tout le monde'
Response
{"trust_level": 1,"source_lang_code": "fr","source_lang": "French"}
List Languages
Fetch the full list of supported languages and their codes at runtime — useful for populating a language picker.
https://aibit-translator.p.rapidapi.com/api/v1/translator/support-languagesRequest
curl "https://aibit-translator.p.rapidapi.com/api/v1/translator/support-languages" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com"
Response
[{ "code": "auto", "language": "Automatic" },{ "code": "en", "language": "English" },{ "code": "vi", "language": "Vietnamese" }]
Code Examples
A complete, copy-paste translation request in four languages. Swap YOUR_API_KEY for your key and you're live.
curl -X POST "https://aibit-translator.p.rapidapi.com/api/v1/translator/text" \-H "X-RapidAPI-Key: YOUR_API_KEY" \-H "X-RapidAPI-Host: aibit-translator.p.rapidapi.com" \-H "Content-Type: application/x-www-form-urlencoded" \--data-urlencode "from=en" \--data-urlencode "to=vi" \--data-urlencode "text=Hello, world"
Supported Languages
AIbit supports the language codes below. Use auto as the source to detect the input language automatically. Search by name or ISO code, and click a row to copy the code.
199 of 199 language codes
Translation Engines
One API, multiple engines. Set the provider parameter to pick the engine best suited to your language pair. If you omit it, google is used.
provider=google · Balanced quality & speed
The default and best all-round choice. Widest language coverage (all 190+ codes), sub-200ms latency, and reliable for both short strings and long documents. Use it unless you have a specific reason not to.
Microsoft
provider=microsoft · Strong on European & business text
A solid alternative for formal, business, and technical content across major European languages. Good fallback when you want a second opinion on Google's output.
Yandex
provider=yandex · Best for Russian & CIS languages
Pick Yandex when translating to or from Russian, Ukrainian, and other CIS-region languages, where it often reads more naturally than the alternatives.
Baidu
provider=baidu · Best for Chinese
The go-to engine for Simplified/Traditional Chinese and other East-Asian pairs — strong handling of idioms and mixed-script content.
google — it has the widest coverage and lowest latency. Switch engines per request and benchmark on your content for the best results.Errors & Rate Limits
The API uses conventional HTTP status codes. 2xx means success; 4xx means a problem with your request; 5xx means a transient server error that is safe to retry.
| Status | Name | Meaning |
|---|---|---|
| 200 | OK | Success. All translate endpoints return 200 on success. |
| 302 | Found | Redirect to the RapidAPI pricing page — your API key is missing or invalid. |
| 400 | Bad Request | Validation failed: unknown language code, a missing required field, or malformed json. |
| 403 | Forbidden | Your IP address has been blocked. |
| 429 | Too Many Requests | You exceeded your plan's rate limit. Back off and retry. |
| 500 | Internal Server Error | An upstream engine error occurred. The request is safe to retry. |
Rate limits by plan
Rate limits and monthly quotas depend on your RapidAPI subscription. Exceeding your rate limit returns 429 Too Many Requests — back off and retry.
| Plan | Price | Requests | Rate limit |
|---|---|---|---|
| Free | $0 | 1,000 / mo | 5 req/s |
| Pro | $9.99 | 100,000 / mo | 20 req/s |
| MEGA | $120 | 4,500,000 / mo | 200 req/s |
| Enterprise | $200 | 10,000,000 / mo | 300 req/s |
| Unlimited | $750 | Unlimited | 500 req/s |