Learn how to generate multi-language images in seconds with Bannerly!See Bannerly.io

API: Read translations

Last modified: October 27, 2021Author: Jakub Pomykała

This is split into two sections, public CDN and private API. CDN offers free, fast and public access to your translations. Second section describes private access which requires authorization and cannot be posted publicly.

Fetching from CDN

Fetching from CDN is available for everyone. It's fast and safe to share link to the public. Remember to use a project token to access CDN resources.

Where to find a project token

simplelocalize project token location

GET Get all translations

https://cdn.simplelocalize.io/:projectToken/_latest/_index

Example response

{
  "de": {
    "SALE": "Verkauf",
    "ADDRESS": "Adresse"
  },
  "fr": {
    "SALE": "soldes",
    "ADDRESS": "adresse"
  }
}

GET Get translations by language key

https://cdn.simplelocalize.io/:projectToken/_latest/:languageKey

Example response

{
  "SALE": "Verkauf",
  "ADDRESS": "Adresse"
}

GET Get languages

https://cdn.simplelocalize.io/:projectToken/_latest/_languages

Example response

[
   {
      "key": "de",
      "name": "Deutsch"
   },
   {
      "key": "en",
      "name": "English"
   },
   {
      "key": "es",
      "name": "Español"
   }
]

Fetching from API

If you are using this endpoint, the authorization is required. Add API Token for your project as a X-SimpleLocalize-Token request header.

GET Query all translations

https://api.simplelocalize.io/api/v1/translations

Available query parameters

Query parameter Description
text query for translated text, uses 'contains with ignore case'
key filter by given translation key, uses 'equals'
language filter by given language key, uses 'equals'
customerId filter by given customer id, uses 'equals'; see customer-specific translations

GET Query translations with language 'de' and translation key 'hello'

https://api.simplelocalize.io/api/v1/translations?languageKey=de&key=hello

Example response

{
    "msg": "OK",
    "status": 200,
    "data": {
        "content": [
            {
                "key": "CREATE.TAGS",
                "language": "en",
                "text": "Tags"
            },
            //...
        ]
    }
}