Skip to content

Translations endpoints

Fetch live translations directly from the database.

Overview

These endpoints return translations stored in the PostgreSQL database. They are the most up-to-date source but go through the database on every request. For high-traffic production use, consider the cached endpoints instead.


GET /v1/translations/

Returns all approved translations for the given language. Each translation key is keyed by its full name (e.g. common.welcome).

Request

GET https://sapi.i18nme.com/v1/translations/{language}
ParameterInRequiredDescription
languagepathLanguage code (e.g. en, pl, de)
statusqueryFilter by translation status: approved (default), draft, review, or all
HeaderRequiredDescription
X-API-KeyYour project API key

Response

200 OK — default (?status=approved)

json
{
  "project_id": "3fa85f64-...",
  "language": "en",
  "status_filter": "approved",
  "count": 3,
  "translations": {
    "common.welcome": "Welcome",
    "common.logout": "Log out",
    "nav.home": "Home"
  }
}

200 OK — with ?status=all (includes every status)

json
{
  "project_id": "3fa85f64-...",
  "language": "en",
  "status_filter": "all",
  "count": 4,
  "translations": {
    "common.welcome": { "value": "Welcome",    "status": "approved", "group": "common" },
    "common.logout":  { "value": "Log out",    "status": "approved", "group": "common" },
    "nav.home":       { "value": "Home",       "status": "draft",    "group": "nav"    },
    "nav.pricing":    { "value": "Pricing",    "status": "review",   "group": "nav"    }
  }
}

When ?status=all is used, each value is an object with value, status, and group. For any other status filter, each value is a plain string.

404 Not Found — language has no translations at all in this project.


GET /v1/translations/{language}/

Returns only translations belonging to the specified group for the given language.

Request

GET https://sapi.i18nme.com/v1/translations/{language}/{group}
ParameterInRequiredDescription
languagepathLanguage code
grouppathGroup name
statusqueryapproved (default), draft, review, or all

Response

200 OK — default (?status=approved)

json
{
  "project_id": "3fa85f64-...",
  "language": "en",
  "group": "common",
  "status_filter": "approved",
  "count": 2,
  "translations": {
    "common.welcome": "Welcome",
    "common.logout":  "Log out"
  }
}

200 OK — with ?status=all

json
{
  "project_id": "3fa85f64-...",
  "language": "en",
  "group": "common",
  "status_filter": "all",
  "count": 2,
  "translations": {
    "common.welcome": { "value": "Welcome", "status": "approved" },
    "common.logout":  { "value": "Log out", "status": "draft"    }
  }
}

404 Not Found — no translations found for this group / language combination.


GET /v1/translations/{language}/{group}/

Returns a single translation value identified by group name and key name.

Request

GET https://sapi.i18nme.com/v1/translations/{language}/{group}/{key}
ParameterInRequiredDescription
languagepathLanguage code
grouppathGroup name
keypathFull key name (including group prefix, e.g. common.welcome)
statusqueryapproved (default), draft, review, or all

Response

200 OK

json
{
  "key": "common.welcome",
  "group": "common",
  "language": "en",
  "value": "Welcome",
  "status": "approved"
}

404 Not Found — language, group, or key does not exist, or the translation does not match the requested status filter

json
{ "detail": "Translation key 'common.welcome' in group 'common' not found for language 'en'" }

Examples (all three variants)

bash
# All translations for Polish
curl https://sapi.i18nme.com/v1/translations/pl \
  -H "X-API-Key: key_live_XXXX"

# Only the 'nav' group
curl https://sapi.i18nme.com/v1/translations/pl/nav \
  -H "X-API-Key: key_live_XXXX"

# Single key
curl https://sapi.i18nme.com/v1/translations/pl/nav/home \
  -H "X-API-Key: key_live_XXXX"
js
const BASE = 'https://sapi.i18nme.com'
const HEADERS = { 'X-API-Key': process.env.I18N_API_KEY }

// All translations
const all  = await fetch(`${BASE}/v1/translations/pl`, { headers: HEADERS }).then(r => r.json())

// Single group
const nav  = await fetch(`${BASE}/v1/translations/pl/nav`, { headers: HEADERS }).then(r => r.json())

// Single key
const home = await fetch(`${BASE}/v1/translations/pl/nav/home`, { headers: HEADERS }).then(r => r.json())
console.log(home.value) // "Strona główna"
python
import httpx, os

BASE    = 'https://sapi.i18nme.com'
HEADERS = {'X-API-Key': os.environ['I18N_API_KEY']}

all_tr  = httpx.get(f'{BASE}/v1/translations/pl', headers=HEADERS).json()
nav_tr  = httpx.get(f'{BASE}/v1/translations/pl/nav', headers=HEADERS).json()
home_tr = httpx.get(f'{BASE}/v1/translations/pl/nav/home', headers=HEADERS).json()
print(home_tr['value'])

i18nme is provided on a best-effort basis. While we strive for reliability and rapid issue resolution, no specific uptime, response time, or bug-fix timeframe is guaranteed.
Translation content and AI-generated output should be reviewed before production use.