This is split into two sections, Translation Hosting and REST API. The CDN offers free, fast and public access to your translations, it can be used in client-side application. API offers filter and query options, and uses your API Key which can be used also for modifying translations, so it should be used only in server-side applications and integrations.
Table of contents
Translation Hosting
Translation Hosting is a content-delivery network (CDN), it's a fast and safe to share the link to the public. It's not rate-limited, so you don't have to worry about the number of requests. You can use it safely in client-side applications. Fetching data from Translation Hosting is available in all pricing plans including the Community plan.
Parameters
projectToken
- your project token which can be found in the 'Integrations > Project credentials' tab,languageKey
- language key from the 'Languages' tab, e.g.:en
,pl
,de
,environment
- environment name,_latest
or_production
,namespace
- namespace, e.g.:common
,home
,auth
,customerId
- customerId used for customer-specific translations, e.g.:ikea
,adidas
.
Get all translations
Example response
{
"de": {
"SALE": "Verkauf",
"ADDRESS": "Adresse"
},
"fr": {
"SALE": "soldes",
"ADDRESS": "adresse"
}
}
Get translations by language key
Example response
{
"SALE": "Verkauf",
"ADDRESS": "Adresse"
}
Get languages
Example response
[
{
"key": "de",
"name": "Deutsch",
"isDefault": false,
"icon": "de"
},
{
"key": "en",
"name": "English",
"isDefault": false,
"icon": "gb"
},
{
"key": "es",
"name": "Español",
"isDefault": false,
"icon": "es"
}
]
See blog post about hosted country flags and learn how to use
icon
values to show flags in your app.
Get translations by language key and namespace
Example response
{
"SALE": "Verkauf",
"ADDRESS": "Adresse"
}
Get translations by language key, namespace and customerId
Example response
{
"SALE": "Verkauf",
"ADDRESS": "Adresse"
}
Get customers
Example response
[
{
"key": "ikea",
"name": "IKEA"
},
{
"key": "adidas",
"name": "Adidas"
}
]
Get customer-specific translations
Example response
{
"SALE": "Verkauf",
"ADDRESS": "Adresse"
}
REST API
This section is about using REST API to fetch translations. It's possible to use it in server-side applications and integrations.
If you are using this endpoint, the authorization is required.
Add API Key for your project as a X-SimpleLocalize-Token
request header.
Please note that the API Access is rate-limited, and you should not use it to fetch translations for every end-user nor use it in client-side applications. Use Translation Hosting instead.
Search translations
Available query parameters
Query parameter | Description |
---|---|
text | query for translated text, uses 'contains with ignore case' |
textStatus | search for empty or not empty translations, allowed values: EMPTY , NOT_EMPTY |
reviewsStatus | filter by review status, allowed values: REVIEWED , NOT_REVIEWED |
key | filter by given translation key, uses 'equals' |
namespace | filter by given translation namespace, uses 'equals' |
language | filter by given language key, uses 'equals' |
customerId | filter by given customer id, uses 'equals'; see customer-specific translations |
page | page for pagination |
size | size for pagination, max size: 500 |
Sample request
Response
{
"msg": "OK",
"status": 200,
"data": [
{
"key": "HELLO_WORLD",
"namespace": "common",
"language": "en",
"text": "Hello world!",
"reviewStatus": "REVIEWED",
"lastModifiedAt": "2021-01-01T00:00:00.000Z"
}
]
}