Documentation

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.

FieldTypeDescription
textstring or listRequired. One string, or a list of up to 50 strings. All items together may contain at most 50,000 characters.
target_langstringRequired. A code from the language list, case-insensitive.
source_langstringOptional. 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.

CodeLanguageCodeLanguageCodeLanguage
BGBulgarianCACatalanCSCzech
DADanishDEGermanELGreek
ENEnglishESSpanishETEstonian
EUBasqueFIFinnishFRFrench
GAIrishGLGalicianHRCroatian
HUHungarianISIcelandicITItalian
LTLithuanianLVLatvianMKMacedonian
MTMalteseNBNorwegian (Bokmål)NLDutch
PLPolishPTPortugueseRORomanian
RURussianSKSlovakSLSlovenian
SQAlbanianSRSerbianSVSwedish
TRTurkishUKUkrainianBSBosnian

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": "…"}}.

StatusCodeMeaning
401invalid_api_keyKey missing, wrong or revoked.
402insufficient_balanceThe balance does not cover this request. Top up in the dashboard.
413request_too_largeMore than 50,000 characters in one request.
422invalid_request, invalid_target_lang, invalid_source_langThe body is malformed or a language code is unknown.
429rate limitToo many requests. Wait and retry. The Retry-After header says how long.
502translation_failedThe 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.