API: Export translations

Last updated: November 22, 2023Author: Jakub Pomykała

Export translations to downloadable file. Using this endpoint requires authorization.

Endpoint

GET
https://api.simplelocalize.io
/api/v4/export

Looking for a v3 endpoint? See here.

Query parameters

ParameterDescription
downloadFormat(required) See all available download formats
downloadOptions(optional) See all available download options
languageKeys(optional) Export only selected languages
customerId(optional) Export translations for given customer
sort(optional) Change the default sorting option, available values:
NEWEST_KEYS_FIRST, NEWEST_KEYS_LAST, NAMESPACES, IMPORT_ORDER

Sample requests

Export all translations into one file

Export all translations into one file using multi-language-json format.

curl
  --request GET \
  --url 'https://api.simplelocalize.io/api/v4/export?downloadFormat=multi-language-json' \
  --header 'x-simplelocalize-token: <API_KEY>'

Learn more about multi-language-json.

{
  "msg": "OK",
  "status": 200,
  "data": {
    "files": [
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_ae60e1/translations.json"
      }
    ]
  }
}

Export all translations into multiple files

Export all translations into one file using single-language-json format and SPLIT_BY_NAMESPACES option.

curl
  --request GET \
  --url 'https://api.simplelocalize.io/api/v4/export?downloadFormat=single-language-json&downloadOptions=SPLIT_BY_NAMESPACES' \
  --header 'x-simplelocalize-token: <API_KEY>'

Learn more about single-language-json.

{
  "msg": "OK",
  "status": 200,
  "data": {
    "files": [
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/it_IT.json",
        "namespace": "",
        "language": "it_IT"
      },
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/login_it_IT.json",
        "namespace": "login",
        "language": "it_IT"
      },
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/pl_PL.json",
        "namespace": "",
        "language": "pl_PL"
      },
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/login_pl_PL.json",
        "namespace": "login",
        "language": "pl_PL"
      } // ...
    ]
  }
}

Export translations for selected languages

Add SELECTED_LANGUAGES option and languageKeys query parameter to set the language keys.

curl
  --request GET \
  --url 'https://api.simplelocalize.io/api/v4/export?downloadFormat=single-language-json&downloadOptions=SPLIT_BY_NAMESPACES,SELECTED_LANGUAGES&languageKeys=pl,it_IT' \
  --header 'x-simplelocalize-token: <API_KEY>'

Learn more about single-language-json.

{
  "msg": "OK",
  "status": 200,
  "data": {
    "files": [
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/it_IT.json",
        "namespace": "",
        "language": "it_IT"
      },
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/login_it_IT.json",
        "namespace": "login",
        "language": "it_IT"
      },
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/pl_PL.json",
        "namespace": "",
        "language": "pl_PL"
      },
      {
        "url": "https://cdn.simplelocalize.io/project-token/snapshot_cc123/login_pl_PL.json",
        "namespace": "login",
        "language": "pl_PL"
      } // ...
    ]
  }
}

Error response

{
  "status": 400,
  "msg": "Cannot find proper format for: multi-language-incorrect-value Visit https://simplelocalize.io/docs/general/file-formats/ to learn more."
}