API စာရွက်စာတမ်း

ကျွန်ုပ်တို့၏ရိုးရှင်းသော REST API နှင့်အတူသင်၏ application များထဲသို့စွမ်းအားရှိသောဘာသာပြန်ချက်ကိုပေါင်းစပ်.

စတင်ခြင်း

The TranslateAPI providesasimple REST interface for translating text between 180+ languages. All API endpoints return JSON responses.

1. Get Your API Key

Create a free account and generate your API key from the dashboard:

  1. Sign up at translateapi.ai/signup
  2. Go to အညွှန်းစာမျက်နှာ → API ကီးများ
  3. Click "Create API Key" and copy your key

API keys start with ta_ followed by 56 hex characters.

အခြေခံ URL: https://api.translateapi.ai/api/v1/
2. Make Your First Request

Replace YOUR_API_KEY with the key from your dashboard:

curl -X POST https://api.translateapi.ai/api/v1/translate/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "text": "Hello, world!",
    "target_language": "es"
  }'
import requests

response = requests.post(
    "https://api.translateapi.ai/api/v1/translate/",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "text": "Hello, world!",
        "target_language": "es"
    }
)

result = response.json()
print(result["translated_text"])  # "Hola, mundo!"
const response = await fetch("https://api.translateapi.ai/api/v1/translate/", {
    method: "POST",
    headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    body: JSON.stringify({
        text: "Hello, world!",
        target_language: "es"
    })
});

const result = await response.json();
console.log(result.translated_text);  // "Hola, mundo!"
$ch = curl_init("https://api.translateapi.ai/api/v1/translate/");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "text" => "Hello, world!",
        "target_language" => "es"
    ])
]);

$result = json_decode(curl_exec($ch), true);
echo $result["translated_text"];  // "Hola, mundo!"
payload := strings.NewReader(`{
    "text": "Hello, world!",
    "target_language": "es"
}`)

req, _ := http.NewRequest("POST", "https://api.translateapi.ai/api/v1/translate/", payload)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")

resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()

var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["translated_text"])  // "Hola, mundo!"
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");

var content = new StringContent(
    JsonSerializer.Serialize(new {
        text = "Hello, world!",
        target_language = "es"
    }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync("https://api.translateapi.ai/api/v1/translate/", content);
var result = JsonSerializer.Deserialize<JsonElement>(
    await response.Content.ReadAsStringAsync()
);
Console.WriteLine(result.GetProperty("translated_text"));  // "Hola, mundo!"
တုံ့ပြန်မှု
{
    "translated_text": "Hola, mundo!",
    "source_language": "en",
    "target_language": "es",
    "translations": {
        "es": "Hola, mundo!"
    },
    "character_count": 13,
    "translation_time": 0.45
}

အတည်ပြုခြင်း

API key ကိုသုံးပြီးသင့်ရဲ့တောင်းဆိုမှုများကိုစစ်ဆေးပါ. သင်သည်သင်၏ API key ကိုဖန်တီးနိုင်ပါတယ် အညွှန်းစာမျက်နှာ.

ခေါင်းစီး အတည်ပြုခြင်း (အကြံပြု)
Authorization: Bearer ta_your_api_key_here
ApiKey Header
Authorization: ApiKey ta_your_api_key_here
မေးမြန်းချက် ပမာဏ
https://api.translateapi.ai/api/v1/translate/?api_key=ta_your_api_key_here
သင့်ရဲ့ API key ကိုလုံခြုံအောင်ထားပါ။ သူတို့ကို client-side code သို့မဟုတ် အများပြည်သူ repositories တွင်မပြသပါနှင့်။

စာသားကို ဘာသာပြန်

တစ်ခုတည်းသောရည်မှန်းချက်ဘာသာစကားသို့စာသားကိုဘာသာပြန်ဆို။

POST https://api.translateapi.ai/api/v1/translate/
တောင်းဆိုချက်ကိုယ်ထည်
အညွှန်းကိန်း အမျိုးအစား လိုအပ်သည် ဖော်ပြချက်
text string အင်း ဘာသာပြန်ရန်စာသား (max 50,000 အက္ခရာများ)
target_language string ဟုတ်ကဲ့* Target language code (e.g., "es", "fr", "de")
source_language string မဟုတ်ပါ Source language code. Default: "auto" (auto-detect)
engine string မဟုတ်ပါ Translation engine: "auto" (default), "huggingface", or "madlad". See Translation Models. ဘာသာပြန်မော်ဒယ်များ.

* အသုံးပြုမှု target_language တစ်ဦးတည်းဘာသာစကားသို့မဟုတ်အတွက် (string) target_languages အပေါင်းတို့အတွက် (array) ။ ကြည့်ပါ Multi-ရည်မှန်းချက်ဘာသာပြန်ချက်.

တုံ့ပြန်မှု
{
    "translated_text": "Hola, mundo!",
    "source_language": "en",
    "target_language": "es",
    "translations": {
        "es": "Hola, mundo!"
    },
    "character_count": 13,
    "translation_time": 0.45
}
Auto-Detection: Omit source_language or set it to "auto" to automatically detect the source language. The detected language is returned in the source_language response field.

Multi-ရည်မှန်းချက်ဘာသာပြန်ချက်

တစ်ခုတည်းသောတောင်းဆိုချက်တွင်ဘာသာစကားများစွာသို့စာသားကိုဘာသာပြန်ဆို. တစ်ခုတည်းသောဘာသာပြန်ချက်အဖြစ်တူညီသော endpoint ကိုအသုံးပြုသည်.

POST https://api.translateapi.ai/api/v1/translate/
တောင်းဆိုချက်ကိုယ်ထည်
{
    "text": "Hello, world!",
    "target_languages": ["es", "fr", "de", "ja"],
    "source_language": "en"
}

သုံးစွဲမှု target_languages (array) အစား target_language အများအပြားရည်မှန်းချက်များအတွက် (string) ။

တုံ့ပြန်မှု
{
    "source_language": "en",
    "translations": {
        "es": "Hola, mundo!",
        "fr": "Bonjour, monde!",
        "de": "Hallo, Welt!",
        "ja": "こんにちは、世界!"
    },
    "character_count": 52,
    "translation_time": 2.31
}
အမျိုးအစား - သငျသညျအထိဘာသာပြန်ဆိုနိုင်ပါတယ် 50 တစ်ခုတည်းသောတောင်းဆိုမှုတွင်ဘာသာစကားများ.

ဘာသာပြန်ချက်

async စီမံခန့်ခွဲမှုနှင့်အတူတစ်ချိန်တည်းမှာစာသားပေါင်းများစွာကိုဘာသာပြန်ဆို. ရလဒ်များအတွက် batch နှင့်မဲဆွယ်စည်းရုံးရေးတင်သွင်း.

Limits: Max 100 texts per batch, max 300 total items (texts × target languages). Jobs time out 45 minutes after processing starts.
Speed: Common languages (ES, FR, DE) use fast models (~0.1s/text). Less common languages use our multilingual model (~1-3s/text).
POST https://api.translateapi.ai/api/v1/translate/batch/
ခြေလှမ်း 1: Batch တင်သွင်း
curl -X POST https://api.translateapi.ai/api/v1/translate/batch/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": ["Hello", "Goodbye", "Thank you"],
    "target_language": "es",
    "source_language": "en"
}'
တုံ့ပြန်မှု (HTTP 202 လက်ခံ)
{
    "job_id": "67535b2b-c9e3-4f82-9499-e237edbc1dd8",
    "status": "pending",
    "total_texts": 3,
    "queue_position": 1,
    "source_language": "en",
    "target_languages": ["es"],
    "character_count": 22,
    "credits_remaining": -1,
    "poll_url": "https://api.translateapi.ai/api/v1/jobs/67535b2b-c9e3-4f82-9499-e237edbc1dd8/"
}
ခြေလှမ်း 2: ရလဒ်များအတွက် Poll
GET https://api.translateapi.ai/api/v1/jobs/{job_id}/
ရွေးကောက်ပွဲဥပမာ (Python)
import time, requests

job_id = response.json()["job_id"]
total = response.json()["total_texts"]
headers = {"Authorization": "Bearer YOUR_API_KEY"}

print(f"Batch submitted: {total} texts (job {job_id})")

while True:
    result = requests.get(f"https://api.translateapi.ai/api/v1/jobs/{job_id}/", headers=headers).json()
    status = result["status"]
    processed = result.get("processed_texts", 0)
    progress = result.get("progress_percentage", 0)

    if status == "completed":
        print(f"Done: {processed}/{total} in {result.get('processing_time', 0):.1f}s")
        translations = result["result_data"]["translations"]
        break
    elif status == "failed":
        raise Exception(result.get("error_message", "Translation failed"))
    elif status == "pending":
        print(f"Queued (position {result.get('queue_position', '?')})")
    else:
        print(f"[{status}] {processed}/{total} ({progress:.0f}%)")

    time.sleep(3)
တုံ့ပြန်မှု (ပြီးစီး)
{
    "job_id": "67535b2b-...",
    "status": "completed",
    "processed_texts": 3,
    "total_texts": 3,
    "progress_percentage": 100.0,
    "processing_time": 10.65,
    "result_data": {
        "translations": ["Hola", "Adiós", "Gracias"],
        "source_language": "en",
        "target_language": "es",
        "character_count": 22,
        "processing_time": 10.65
    }
}
Real-Time Progress Tracking
Field ဖော်ပြချက်
status pending (queued, waiting for a GPU worker), processing (actively translating), completed, failed
processed_texts Number of individual translations completed so far. Updates in real time as each text is translated.
progress_percentage Completion percentage (0-100). Calculated from processed_texts / total_texts.
queue_position Your position in the queue when status is "pending" (1 = next up). Null when processing or completed. Use this to estimate wait time and show queue status to your users.
processing_time Total processing time in seconds (available when completed).
ဘာသာစကားစုံ အုပ်စုလိုက်

တစ်ပြိုင်နက်တည်းဘာသာစကားများစွာသို့စာသားများစွာကိုဘာသာပြန်ဆို:

{
    "texts": ["Hello", "Goodbye"],
    "target_languages": ["es", "fr"],
    "source_language": "en"
}
_D ပြီးဆုံးသော ရလဒ်ဒေတာ
{
    "translations": [
        {"es": "Hola", "fr": "Bonjour"},
        {"es": "Adiós", "fr": "Au revoir"}
    ],
    "source_language": "en",
    "target_languages": ["es", "fr"],
    "character_count": 24,
    "processing_time": 2.45
}
မေးမြန်းချက် ပရာမီတာများ
အညွှန်းကိန်း အမျိုးအစား လိုအပ်သည် ဖော်ပြချက်
texts array အင်း ဘာသာပြန်ရန် စာကြောင်းများ အစု
target_language string ဟုတ်ကဲ့* တစ်ခုတည်းသောဘာသာစကားအတွက်ရည်မှန်းချက်ဘာသာစကားကုဒ်
target_languages array ဟုတ်ကဲ့* ဘာသာစကားများစွာအတွက်ရည်မှန်းချက်ဘာသာစကားကုဒ်များ
source_language string မဟုတ်ပါ Source language code. Default: "auto"

* တစ်ခုခုကိုပေး target_language သို့မဟုတ် target_languages, နှစ်ဦးစလုံးမဟုတ်ပါ။

Best Practices for Large Workloads
  • Send 1 target language per batch request. This keeps each batch fast and makes progress easy to track.
  • Keep batches at 50-100 texts. Smaller batches complete faster and give you more frequent progress updates.
  • Submit as many batch jobs as you need — our GPU cluster auto-scales to handle demand. Jobs are processed in parallel across multiple instances.
  • On timeout, re-poll the same job_id instead of submitting a new batch. The original job may still be processing on the GPU.
  • Poll every 3-5 seconds. More frequent polling does not speed up processing.

စာရွက်စာတမ်း ဘာသာပြန်

formatting ကိုထိန်းသိမ်းထားစဉ်အပြည့်အဝစာရွက်စာတမ်းများကိုဘာသာပြန်ဆို။ အမျိုးမျိုးသောဖိုင်အမျိုးအစားများကိုထောက်ခံသည်။

POST https://api.translateapi.ai/api/v1/translate/document/
တောင်းဆိုချက် (multipart/form-data)
အညွှန်းကိန်း အမျိုးအစား လိုအပ်သည် ဖော်ပြချက်
file file အင်း ဘာသာပြန်ရန်စာရွက်စာတမ်း (max 10MB)
target_language string အင်း Target language code (e.g., "es", "fr", "de")
source_language string မဟုတ်ပါ Source language code. Default: "auto" (auto-detect)
ထောက်ပံ့ထားသောဖိုင်အမျိုးအစားများ
Documents
  • .txt - ရိုးရိုးစာသားဖိုင်များ
  • .docx - Word စာရွက်စာတမ်း
  • .pdf - PDF စာရွက်စာတမ်းများ (စကင်ဖတ်စစ်ဆေးအပါအဝင်)
Data & Localization
  • .json - JSON ဖိုင်များ (string တန်ဖိုးများကိုဘာသာပြန်)
  • .xml - XML ဖိုင်များ
  • .srt - စာတန်းထိုးဖိုင်များ
  • .po / .pot - Gettext ဘာသာပြန်ဖိုင်များ
Images (OCR)
  • .jpg / .jpeg - JPEG ရုပ်ပုံများ (OCR)
  • .png - PNG ရုပ်ပုံများ (OCR)
  • .tiff / .tif - TIFF ရုပ်ပုံများ (OCR)
  • .bmp - BMP ရုပ်ပုံများ (OCR)
  • .webp - WebP ရုပ်ပုံများ (OCR)
ဥပမာ (cURL)
# Translate a Word document
curl -X POST https://api.translateapi.ai/api/v1/translate/document/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.docx" \
  -F "target_language=es" \
  -F "source_language=en"

# Translate text from an image (OCR)
curl -X POST https://api.translateapi.ai/api/v1/translate/document/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@scanned_page.jpg" \
  -F "target_language=es" \
  -F "source_language=en"
တုံ့ပြန်မှု
{
    "id": 123,
    "original_filename": "document.docx",
    "file_type": "docx",
    "source_language": "en",
    "target_language": "es",
    "status": "completed",
    "character_count": 5420,
    "translated_file_url": "/media/translated/document_es.docx",
    "created_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:30:05Z"
}
OCR ထောက်ခံမှု: Image files and scanned PDFs are processed with optical character recognition (OCR) to extract text before translation.
GET https://api.translateapi.ai/api/v1/translate/document/{id}/

စာရွက်စာတမ်းဘာသာပြန်ချက်၏အခြေအနေကိုစစ်ဆေးသို့မဟုတ်ဒေါင်းလုပ် URL ကိုရယူပါ။

အခြေအနေ တန်ဖိုးများ
pending ဖိုင်တင်ပြီး၊ စီမံရန်စောင့်နေသည်
processing ဘာသာပြန်နေသည်
completed ဘာသာပြန်ပြီးစီး, download လုပ်နိုင်ပါတယ်
failed ဘာသာပြန်ချက်မအောင်မြင် (error_message ကိုစစ်ဆေးပါ)

ထောက်ပံ့ထားသော ဘာသာစကားများ

ထောက်ပံ့ထားသော ဘာသာစကားအားလုံး၏ စာရင်းကို ရယူပါ။

GET https://api.translateapi.ai/api/v1/translate/languages/
တုံ့ပြန်မှု
{
    "count": 186,
    "results": [
        {"iso": "en", "name": "English", "en_label": "English"},
        {"iso": "es", "name": "Español", "en_label": "Spanish"},
        {"iso": "fr", "name": "Français", "en_label": "French"},
        ...
    ]
}

View All 186 Languages

Submit Corrections

Suggest a better translation for a given source text. Corrections enter a moderation queue; once approved by our team they surface as "Community Verified" translations for that text.

Note: this endpoint is served from the main domain https://translateapi.ai/api/v1/ (not the api. translation host), and requires an API key.
POST https://translateapi.ai/api/v1/suggestions/
တောင်းဆိုချက်ကိုယ်ထည်
Parameter အမျိုးအစား ဖော်ပြချက်
source_text string The original text that was translated.
source_language string Source language code (e.g. "en").
target_language string Target language code (e.g. "es").
machine_translation string The machine translation you are correcting.
suggested_translation string Your improved translation (must differ from machine_translation).
Example Request
curl -X POST https://translateapi.ai/api/v1/suggestions/ \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "source_text": "Hello, world!",
    "source_language": "en",
    "target_language": "es",
    "machine_translation": "Hola, mundo!",
    "suggested_translation": "¡Hola, mundo!"
}'
တုံ့ပြန်မှု
{
    "id": 4213,
    "status": "pending",
    "created": true,
    "message": "Correction submitted for review."
}

Re-submitting the same source/language pair updates your existing suggestion instead of creating a duplicate (returns 200 with "created": false).

ဘာသာပြန်မော်ဒယ်များ

ကျွန်ုပ်တို့သည်ကျွန်ုပ်တို့၏ကိုယ်ပိုင် GPU အခြေခံအဆောက်အအုံပေါ်တွင်လည်ပတ်နေသော state-of-the-art open source ဘာသာပြန်ချက်မော်ဒယ်များကိုအသုံးပြုသည်။ အားလုံးမော်ဒယ်များသည်ကုန်သွယ်ရေးလိုင်စင်ရကြသည် (Apache 2.0) ။

မော်ဒယ် ဘာသာစကားများ အကောင်းဆုံး
Helsinki-NLP/opus-mt 50+ ဘာသာစကားစုံ ယေဘုယျဘာသာစကားများ (EN, ES, FR, DE, IT, PT, RU, ZH, JA, စသည်တို့ကို)
Google MADLAD-400 400+ ဘာသာစကားများ ရှားပါးဘာသာစကားများ, စုံလင်သောကာကွယ်မှု

အဆိုပါ API ကိုအလိုအလျောက်သင်၏ဘာသာစကားစုံတွဲအတွက်အကောင်းဆုံးမော်ဒယ်ကို selects. You can optionally specify an engine ပမာဏ -

အင်ဂျင် ဖော်ပြချက်
"auto" ပထမဦးဆုံး HuggingFace ကိုစမ်းသပ်, MADLAD-400 သို့ပြန်ကျဆင်း
"huggingface" Force HuggingFace/MarianMT (အမြန်ဆုံး, 50+ ဘာသာစကားများ)
"madlad" အင်အား MADLAD-400 (400+ ဘာသာစကားများ)

အမှား ကိုင်တွယ်ခြင်း

အဆိုပါ API ကိုအောင်မြင်မှုသို့မဟုတ်ပျက်ကွက်ကိုပြသရန်စံ HTTP အခြေအနေကုဒ်များကိုအသုံးပြုသည်။

ကုဒ် ဖော်ပြချက်
200 အောင်မြင်မှု
202 Accepted — Batch job queued successfully
400 Bad Request — Invalid parameters (missing text, unsupported language, etc.)
401 Unauthorized - မမှန်ကန်သောသို့မဟုတ်ပျောက်ဆုံး API key ကို
402 Payment Required — Character credits exhausted. Upgrade your plan or purchase a top-up.
403 Forbidden — API key lacks required scope or IP not in whitelist
503 ဝန်ဆောင်မှုမရရှိနိုင် - ဘာသာပြန်ချက်အင်ဂျင် ယာယီအောက်
ချို့ယွင်းချက် တုံ့ပြန်မှု ပုံစံ
{
    "error": "insufficient_credits",
    "credits_remaining": 0
}

Usage Limits

TranslateAPI has no request rate limits. All requests are queued and processed by our auto-scaling GPU cluster. Your plan determines your monthly character allowance:

အစီအစဉ် အက္ခရာများ/လ Batch API Documents စျေးနှုန်း
အခမဲ့ 250,000 $0 အခမဲ့ Sign Up
စတင်သူ 2,500,000 $9/မတ်လ စာရင်းသွင်းပါ
ပရို 10,000,000 $29/မတ်လ စာရင်းသွင်းပါ
စီးပွားရေး 40,000,000 $79/မတ်လ စာရင်းသွင်းပါ
စကေး 125,000,000 $199/မတ်လ စာရင်းသွင်းပါ
Enterprise Unlimited $499/မတ်လ Contact Sales

သင်သည်သင်၏အကန့်အသတ်ကိုကျော်လွန်တဲ့အခါ, သင်သည်တစ်ဦးကိုလက်ခံရရှိပါလိမ့်မယ် 402 Payment Required နောက်တစ်လအထိတုံ့ပြန်မှုသို့မဟုတ်သင် upgrade လုပ်ပါ.

Auto-Scaling Cloud Infrastructure

TranslateAPI runs on dedicated NVIDIA A100 GPU instances with automatic horizontal scaling. When demand increases, additional GPU instances are launched within minutes to maintain fast response times. All requests are queued and processed — send hundreds of concurrent requests and they'll all be handled. Real-time translations get priority, batch jobs process in the background.

Need More Credits?

Run out of characters mid-month? Purchase a one-time credit top-up without changing your plan. View top-up packs

ဒီစာမျက်နှာကိုရမှတ်
သင့်ရဲ့ rating အတွက်ကျေးဇူးတင်ပါတယ်!
/5 အပေါ်အခြေခံပြီး အဆင့်သတ်မှတ်ချက်