API reference
One REST API, JSON in and out. The base URL is https://api.glossferry.com/v1.
Quick start
Create an account, copy your key from the dashboard and send your first request.
curl -X POST https://api.glossferry.com/v1/translate \
-H "Authorization: Bearer gf_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"text":["Thanks for your order"],"target_lang":"DE"}'
<?php
$response = file_get_contents('https://api.glossferry.com/v1/translate', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Authorization: Bearer gf_live_xxxxxxxx\r\nContent-Type: application/json",
'content' => json_encode(['text' => ['Thanks for your order'], 'target_lang' => 'DE']),
],
]));
echo json_decode($response, true)['translations'][0]['text'];
const res = await fetch('https://api.glossferry.com/v1/translate', {
method: 'POST',
headers: { 'Authorization': 'Bearer gf_live_xxxxxxxx', 'Content-Type': 'application/json' },
body: JSON.stringify({ text: ['Thanks for your order'], target_lang: 'DE' }),
});
const data = await res.json();
console.log(data.translations[0].text);
import requests
r = requests.post(
"https://api.glossferry.com/v1/translate",
headers={"Authorization": "Bearer gf_live_xxxxxxxx"},
json={"text": ["Thanks for your order"], "target_lang": "DE"},
)
print(r.json()["translations"][0]["text"])
Authentication
Send your key as a bearer token: Authorization: Bearer gf_live_…. The header X-API-Key is accepted as an alternative. Keys are shown once when you create them. We store only a hash, so a lost key cannot be recovered. Revoke it and create a new one.
POST /translate
Translates one or more strings into a target language.
| Field | Type | Description |
|---|---|---|
text | string or list | Required. One string, or a list of up to 50 strings. All items together may contain at most 50,000 characters. |
target_lang | string | Required. A code from the language list, case-insensitive. |
source_lang | string | Optional. Omit it to detect the source language. |
{
"translations": [
{ "detected_source_language": "EN", "text": "Vielen Dank für Ihre Bestellung" }
],
"request_id": "01J8ZC4M9XK3P7QW2NRT5V6YAB",
"characters": 21
}
Response headers: X-Request-Id, X-Characters-Charged and X-Balance-Remaining (EUR). HTML or XML tags and placeholders such as {name} or %s are left unchanged, only the text around them is translated.
GET /languages
Public, no key needed. Returns every supported code.
| Code | Language | Code | Language | Code | Language |
|---|---|---|---|---|---|
BG | Bulgarian | CA | Catalan | CS | Czech |
DA | Danish | DE | German | EL | Greek |
EN | English | ES | Spanish | ET | Estonian |
EU | Basque | FI | Finnish | FR | French |
GA | Irish | GL | Galician | HR | Croatian |
HU | Hungarian | IS | Icelandic | IT | Italian |
LT | Lithuanian | LV | Latvian | MK | Macedonian |
MT | Maltese | NB | Norwegian (Bokmål) | NL | Dutch |
PL | Polish | PT | Portuguese | RO | Romanian |
RU | Russian | SK | Slovak | SL | Slovenian |
SQ | Albanian | SR | Serbian | SV | Swedish |
TR | Turkish | UK | Ukrainian | BS | Bosnian |
GET /usage
Returns your balance and this month's usage. Requires a key.
{
"balance": { "eur": "11.94", "characters": 995000 },
"current_month": { "requests": 42, "characters": 5000, "cost_eur": "0.0600" },
"price_per_million_characters_eur": "12.00"
}
Errors
Errors are JSON: {"error": {"code": "…", "message": "…"}}.
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Key missing, wrong or revoked. |
| 402 | insufficient_balance | The balance does not cover this request. Top up in the dashboard. |
| 413 | request_too_large | More than 50,000 characters in one request. |
| 422 | invalid_request, invalid_target_lang, invalid_source_lang | The body is malformed or a language code is unknown. |
| 429 | rate limit | Too many requests. Wait and retry. The Retry-After header says how long. |
| 502 | translation_failed | The translation backend failed. You are not charged, retry later. |
Limits
- 10 requests per second per key.
- Up to 50 strings and 50,000 characters per request.
- Up to 10 active keys per account.
Billing
Billing is prepaid: €12.00 per million characters, counted on the source text of successful requests. The balance is reserved before translation and returned if the backend fails. See the pricing page for details.