API

API

Do you prefer to integrate the locize api on your own?
No problem! If you want to make a low level integration or just did not found an appropriate client library here you find our simple api description or you can access API via:

Fetch namespace resources

The most important feature first!
It's a simple HTTP GET request with this url pattern:
https://api.locize.app/{projectId}/{version}/{language}/{namespace}

example:

1
$ curl -X GET https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production/en/landingpage
2
# will return something like:
3
# {
4
# "Average App": "Average App",
5
# "Benefits": "Benefits",
6
# "Blog": "Blog",
7
# ...
8
# "privacy policy": "privacy policy",
9
# "terms of service": "terms of service"
10
# }
Copied!
(You can find your projectId in your project settings under the API Tab.)
Each of these requests counts as download for your next invoice.

Fetch private namespace resources

Some projects have a higher demand for privacy. To accomplish this, you can set your versions to publish in private mode which means you will need an API key to fetch your namespace resources.
It's a simple HTTP GET request with this url pattern:
https://api.locize.app/private/{projectId}/{version}/{language}/{namespace}

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/private/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production/en/landingpage
2
# will return something like:
3
# {
4
# "Average App": "Average App",
5
# "Benefits": "Benefits",
6
# "Blog": "Blog",
7
# ...
8
# "privacy policy": "privacy policy",
9
# "terms of service": "terms of service"
10
# }
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)
Each of these requests counts as private download for your next invoice.

Fetch the available languages

You have the possibility to ask locize which languages are available for a particular project. That way you can have a dynamic language selector.
It's an even simpler HTTP GET request with this url pattern:
https://api.locize.app/languages/{projectId}

example:

1
$ curl -X GET https://api.locize.app/languages/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
2
# will return something like:
3
# {
4
# "en": {
5
# "name": "English",
6
# "nativeName": "English",
7
# "isReferenceLanguage": true,
8
# "translated": {
9
# "latest": 1,
10
# "production": 1
11
# }
12
# },
13
# "de-CH": {
14
# "name": "German",
15
# "nativeName": "Deutsch",
16
# "region": "CH",
17
# "isReferenceLanguage": false,
18
# "translated": {
19
# "latest": 1,
20
# "production": 0.521
21
# }
22
# },
23
# "it": {
24
# "name": "Italian",
25
# "nativeName": "Italiano",
26
# "isReferenceLanguage": false,
27
# "translated": {
28
# "latest": 1,
29
# "production": 1
30
# }
31
# },
32
# ...
33
# }
Copied!
Advice:
    This request has a minimum cache duration of 1 hour.
(You can find your projectId in your project settings under the API Tab.)

Missing translations

You can say to locize that some translations are missing. For example this is very useful in development. This will not replace an existing translation.
This is a little bit more advanced. It's a HTTP POST request with this url pattern:
https://api.locize.app/missing/{projectId}/{version}/{language}/{namespace}

example:

1
$ body=$(cat << EOF
2
{
3
"new.key": "default value",
4
"another.new.key": "another default value"
5
}
6
EOF
7
)
8
9
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/missing/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!

optional context:

In case you want to also save a context information for a specific translation, you can define a nested object like this:
1
$ body=$(cat << EOF
2
{
3
"new.key": {
4
"value: "default value",
5
"context": {
6
"text: "description for this key"
7
}
8
},
9
"another.new.key": "another default value"
10
}
11
EOF
12
)
13
14
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/missing/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!

optional tags:

In case you want to also save tags for a specific translation, you can define a nested object like this:
1
$ body=$(cat << EOF
2
{
3
"new.key": {
4
"value: "default value",
5
"tags": [
6
true,
7
false
8
]
9
},
10
"another.new.key": "another default value"
11
}
12
EOF
13
)
14
15
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/missing/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!
Advice:
    Translations not defined in your reference language will not be shown in the locize app.
    You should post missing translation to the reference language first!
    If you send more than 1000 keys , you have to page your request.
    If you get a 412 status code, this means it was an unnecessary request and nothing was missing.
(You can find your projectId and API Key in your project settings under the API Tab.)
You should not use this endpoint in production. Read this guide before you're going to production.

Used translations

You can say to locize which translations are used. Locize will then remember at which time the translations have been last used. For example this is very useful in development. For example during an e2e test you can spot which translations are probably not used anymore.
This is also a HTTP POST request, with this url pattern:
https://api.locize.app/used/{projectId}/{version}/{language}/{namespace}

example:

1
$ body=$(cat << EOF
2
[
3
"new.key",
4
"another.new.key"
5
]
6
EOF
7
)
8
9
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/used/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!
Advice:
    If you send more than 1000 keys , you have to page your request.
(You can find your projectId and API Key in your project settings under the API Tab.)
You should not use this endpoint in production. Read this guide before you're going to production.

Update/Remove translations

You can say to locize that some translations should be updated or deleted. For example this is very useful for an integration from an other already existing system to slowly transition the translations to locize.
This is also a little bit more advanced. It's a HTTP POST request with this url pattern:
https://api.locize.app/update/{projectId}/{version}/{language}/{namespace}
To completely replace a namespace set the query parameter replace to true. This will empty the namespace before saving the new translations.

example:

1
$ body=$(cat << EOF
2
{
3
"new.key": "default value",
4
"another.existing.key": "another changed value",
5
"a.key.to.delete": null
6
}
7
EOF
8
)
9
10
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/update/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
11
12
$ # or:
13
$ # curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/update/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage?replace=true
Copied!

optional context:

In case you want to also save a context information for a specific translation, you can define a nested object like this:
1
$ body=$(cat << EOF
2
{
3
"new.key": {
4
"value": "default value",
5
"context": {
6
"text": "description for this key"
7
}
8
},
9
"another.existing.key": "another changed value",
10
"a.key.to.delete": null
11
}
12
EOF
13
)
14
15
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/missing/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!

optional tags:

In case you want to also save tags for a specific translation, you can define a nested object like this:
1
$ body=$(cat << EOF
2
{
3
"new.key": {
4
"value: "default value",
5
"tags": [
6
true,
7
false
8
]
9
},
10
"another.new.key": "another default value"
11
}
12
EOF
13
)
14
15
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/update/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!
Advice:
    Translations not defined in your reference language will not be shown in the locize app.
    You should post translation to the reference language first!
    If you send more than 1000 keys , you have to page your request.
    If you get a 412 status code, this means it was an unnecessary request and nothing did change.
(You can find your projectId and API Key in your project settings under the API Tab.)
You should not use this endpoint in production. Read this guide before you're going to production.

List all namespace resources

If you need an overview of all published translation files of your project, you can do this with a simple HTTP GET request with this url pattern:
https://api.locize.app/download/{projectId}/{version}/{language}/{namespace}
{namespace}, {language} and {version} are optional and are used as filter.

example:

1
$ curl -X GET https://api.locize.app/download/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
2
# will return something like:
3
# [
4
# {
5
# "url": "https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/de/common",
6
# "key": "3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/de/common",
7
# "size": 42,
8
# "lastModified": "2017-11-23T19:39:16.000Z"
9
# },
10
# {
11
# url: "https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/de/landingpage",
12
# key: "3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/de/landingpage",
13
# "size": 21,
14
# "lastModified": "2017-11-23T18:39:16.000Z"
15
# },
16
# {
17
# url: "https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/common",
18
# key: "3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/common",
19
# "size": 103,
20
# "lastModified": "2017-11-23T19:37:16.000Z"
21
# },
22
# {
23
# url: "https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/common",
24
# key: "3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/common",
25
# "size": 12,
26
# "lastModified": "2017-11-23T19:29:16.000Z"
27
# },
28
# ...
29
# {
30
# url: "https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production/en/common",
31
# key: "3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production/en/common",
32
# "size": 236,
33
# "lastModified": "2017-11-24T19:39:16.000Z"
34
# },
35
# {
36
# url: "https://api.locize.app/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production/en/common",
37
# key: "3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production/en/common",
38
# "size": 417,
39
# "lastModified": "2017-11-23T13:39:16.000Z"
40
# }
41
# ]
Copied!
Advice:
    By providing the appropriate API key as bearer token you can also retrieve information about your private namespace resources. (if using the private publishing feature)

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/download/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
2
# will return something like:
3
# [
4
# {
5
# "url": "https://api.locize.app/private/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/de/common",
6
# "key": "private/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/de/common",
7
# "size": 42,
8
# "lastModified": "2017-11-23T19:39:16.000Z",
9
# "isPrivate": true
10
# },
11
# ...
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)
You should not use this endpoint in production. If you need to know the lastModified timestamp of a specific namespace, you should parse the last-modified header in the Fetch namespace resources response.

Fetch/filter the (unpublished) namespace resources

Sometimes in your localization process you want to know which are the translations that are approved by your reviewer. Assuming you have defined some tags to mark translations as approved, with this api you're able to filter by these tags.
This is pretty easy. It's a simple HTTP GET request with this url pattern:
https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}
with positive tags filter: https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}?tags=[0,2] (you need to pass the tag index)
in combination with a negative tags filter: https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}?tags=[0,2]&!tags=[1]
Another use case could be to track the amount of words changed during a time period. To do this, you can pull the translations at period 1, save this state and the current timestamp and later at period 2 you can pull again with an additional filter.
i.e. get all translations updated after 2017-12-06T19:42:18.139Z (UTC): https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}?updatedAt=>1512589338139 (number of milliseconds since 1970/01/01)
i.e. get all translations updated before 2017-12-06T19:42:18.139Z (UTC): https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}?updatedAt=<1512589338139
Additionally another use case could be to remove unused translations. (This is only possible if you make use of the Used translations endpoint) To do this, you can pull the translations with an additional filter.
i.e. get all translations used after 2017-12-06T19:42:18.139Z (UTC): https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}?lastUsed=>1512589338139 (number of milliseconds since 1970/01/01)
i.e. get all translations used before 2017-12-06T19:42:18.139Z (UTC): https://api.locize.app/pull/{projectId}/{version}/{language}/{namespace}?lastUsed=<1512589338139

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/pull/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
2
# will return something like:
3
# {
4
# "Average App": "Average App",
5
# "Benefits": "Benefits",
6
# "Blog": "Blog",
7
# ...
8
# "privacy policy": "privacy policy",
9
# "terms of service": "terms of service"
10
# }
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)
There is also an option to ask for more segment information with the query parameter raw=true

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/pull/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage?raw=true
2
# will return something like:
3
# {
4
# "Average App": {
5
# "value": "Average App",
6
# "tags": [
7
# null,
8
# true
9
# ],
10
# "context": {
11
# "text": "This text is placed..."
12
# },
13
# "updatedAt": 1610004393330
14
# },
15
# ...
16
# }
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)
You should not use this endpoint in production. To fetch the translation in production, please use the Fetch namespaces resources endpoint.
Each of these requests counts as private download for your next invoice.

Fetch configured project tags

You may have defined some tags to mark translations as approved, etc. With this api you're able to fetch these tags.
A very simple HTTP GET request with this url pattern:
https://api.locize.app/tags/{projectId}

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/tags/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
2
# will return something like:
3
# [
4
# "translated",
5
# "reviewed",
6
# "approved"
7
# ]
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Copy version

If you are using multiple versions of your translations you can ask locize to copy (replace) all translations from one version to the other. For example this is very useful when you release your translation files from one version to the other via your custom tooling. It's the same behavior like Overwriting via the UI.
This is easy. It's a HTTP POST request without body with this url pattern:
https://api.locize.app/copy/{projectId}/version/{fromVersion}/{toVersion}

example:

1
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/copy/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/version/latest/production
Copied!
(You can find your projectId and API Key in your project settings under the API Tab. Keep in mind to use the API Key for {toVersion})

Copy language from version to other version

For a more granular copy action, you can ask locize to copy (replace) all translations from one version to the other for a particular language.
Another HTTP POST request without body with this url pattern:
https://api.locize.app/copy/{projectId}/version/{fromVersion}/{toVersion}/{language}

example:

1
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/copy/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/version/latest/production/en
Copied!
(You can find your projectId and API Key in your project settings under the API Tab. Keep in mind to use the API Key for {toVersion})

Publish version

If you want to fully automate your CI/CD pipeline by publishing a version exactly at the same time when you deploy a new version of your product this api call is exactly what you are looking for.
This is very easy. It's a HTTP POST request without body with this url pattern:
https://api.locize.app/publish/{projectId}/{version}

example:

1
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/publish/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/production
Copied!
(You can find your projectId and API Key in your project settings under the API Tab. Keep in mind to use the API Key for the correct {version})

Get async job

To wait for an async action (i.e. copy) to be completed, you can make use this endpoint.
It's a simple HTTP GET request without body with this url pattern:
https://api.locize.app/jobs/{projectId}/{jobId}

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/jobs/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/410aa5aa-4660-4154-b6d9-907dbef10bb5
2
$ # {"projectId":"3d0aa5aa-4660-4154-b6d9-907dbef10bb2","jobId":"0bb35e4a-8f16-4997-866a-1332a59825e0","event":"saveVersionRequested","startedAt":1525094049152}
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)
Sometimes you want to automate even more. I.e if you want to create your own translation management ui. The following endpoints are probably what you are looking for.

Create a new namespace

https://api.locize.app/create/{projectId}/{version}/{language}/{namespace}
A body containing initial values is optional.

example:

1
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/create/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/en/landingpage
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Rename a namespace in all languages

https://api.locize.app/rename/{projectId}/{version}/{fromNamespace}/{toNamespace}

example:

1
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/rename/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/landingpage/landingpagenew
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Delete a namespace from all languages

https://api.locize.app/delete/{projectId}/{version}/{namespace}

example:

1
$ curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/delete/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/latest/landingpage
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Add new language

This is the same as adding a new language via UI.
https://api.locize.app/language/{projectId}/{language}

example:

1
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/language/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/en
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Remove language

https://api.locize.app/language/{projectId}/{language}

example:

1
$ curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/language/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/en
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Invite new users

https://api.locize.app/invite/{projectId}
The body contains
    email the user's email address
    role can be "user" or "publisher" or "admin" (default: "user")
    scope is an object describing a scope restriction (default: empty arrays for languages and versions)
To skip sending the email automatically set the query parameter send to false. This will not send any email. This way you can send the invitation mail by your own, if you want to.

example:

1
$ body=$(cat << EOF
2
{
3
"email": "[email protected]",
4
"role": "user",
5
"scope": {
6
"languages": ["en","de"],
7
"versions": ["latest","preprod"]
8
}
9
}
10
EOF
11
)
12
13
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/invite/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
14
$ # or:
15
$ # curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" -d $body https://api.locize.app/invite/3d0aa5aa-4660-4154-b6d9-907dbef10bb2?send=false
16
# will return something like:
17
# {
18
# "code": "LL4mHDzyxKn4cKYP",
19
# "role": "user",
20
# "email": "[email protected]",
21
# "scope": {
22
# "languages":["en","de"],
23
# "versions":["latest","preprod"]
24
# },
25
# "link": "https://www.locize.app/register?invitation=LL4mHDzyxKn4cKYP"
26
# }
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Fetch users

For example when you want to build your own translation management ui, this endpoint will be very useful if you want to display the project's users.
Just a HTTP GET request with this url pattern:
https://api.locize.app/users/{projectId}

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/users/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
2
# will return something like:
3
# [
4
# {
5
# "id":"ba175147-c7a3-45d2-9b24-739ae2ed948c",
6
# "firstname": "George",
7
# "lastname": "Winston",
8
# "username": "gg.win",
9
# "email": "[email protected]",
10
# "role": "user",
11
# "scope": {
12
# "languages": ["en","de"],
13
# "versions": ["latest","preprod"]
14
# }
15
# }
16
# ...
17
# ]
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Statistics: project

Do you want to show some cool overview images like this:
You can access the same data we use on the locize UI also for your own ui.
Simply make a HTTP GET request with this url pattern:
https://api.locize.app/stats/project/{projectId}

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/stats/project/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
2
# will return something like:
3
# {
4
# "latest":{
5
# "en":{
6
# "ns1":{
7
# "translated":1,
8
# "untranslated":0,
9
# "ordered":0,
10
# "segmentsTranslated":10,
11
# "segmentsTotal":10
12
# },
13
# "anotherNamespace":{
14
# "translated":1,
15
# "untranslated":0,
16
# "ordered":0,
17
# "segmentsTranslated":1,
18
# "segmentsTotal":1
19
# }
20
# },
21
# "de":{
22
# "ns1":{
23
# "translated":0.7,
24
# "untranslated":0.3,
25
# "ordered":0,
26
# "segmentsTranslated":7,
27
# "segmentsTotal":10
28
# },
29
# "anotherNamespace":{
30
# "translated":1,
31
# "untranslated":0,
32
# "ordered":0,
33
# "segmentsTranslated":1,
34
# "segmentsTotal":1
35
# }
36
# }
37
# },
38
# "prod":{
39
# "en":{
40
# "ns1":{
41
# "translated":1,
42
# "untranslated":0,
43
# "ordered":0,
44
# "segmentsTranslated":5,
45
# "segmentsTotal":5
46
# },
47
# "anotherNamespace":{
48
# "translated":1,
49
# "untranslated":0,
50
# "ordered":0,
51
# "segmentsTranslated":1,
52
# "segmentsTotal":1
53
# }
54
# },
55
# "de":{
56
# "ns1":{
57
# "translated":1,
58
# "untranslated":0,
59
# "ordered":0,
60
# "segmentsTranslated":5,
61
# "segmentsTotal":5
62
# },
63
# "anotherNamespace":{
64
# "translated":0.7142857142857143,
65
# "untranslated":0.2857142857142857,
66
# "ordered":0,
67
# "segmentsTranslated":5,
68
# "segmentsTotal":7
69
# }
70
# }
71
# }
72
# }
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)

Statistics: user

There are some nice statistics for users too:
Another HTTP GET request with this url pattern:
for a specific user: https://api.locize.app/stats/user/{projectId}/{userId} https://api.locize.app/stats/user/{projectId}/{userId}?year=2019
or for all users: https://api.locize.app/stats/users/{projectId} https://api.locize.app/stats/users/{projectId}?year=2019
To retrieve an other year than the current one set the query parameter year with the appropriate value.

example:

1
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/stats/user/3d0aa5aa-4660-4154-b6d9-907dbef10bb2/ba175147-c7a3-45d2-9b24-739ae2ed948c
2
# will return something like:
3
# {
4
# "userId":"ba175147-c7a3-45d2-9b24-739ae2ed948c",
5
# "year":2019,
6
# "words":{ // amount of words saved per month
7
# "0":23,
8
# "1":54,
9
# "2":16,
10
# ...
11
# },
12
# "modifications":{ // amount of modifications per month
13
# "0":2,
14
# "1":6,
15
# "2":1,
16
# ...
17
# },
18
# "tagsSet":{ // amount of tags set per month by tag index
19
# "0":{
20
# "2":12,
21
# "4":7
22
# },
23
# "1":{
24
# "2":5,
25
# "4":18,
26
# "5":21
27
# },
28
# "2":{
29
# "4":1,
30
# "5":24
31
# }
32
# ...
33
# },
34
# "tagsUnset":{ // amount of tags unset per month by tag index
35
# "0":{
36
# "0":2,
37
# "1":7
38
# },
39
# "1":{
40
# "0":5,
41
# "1":18,
42
# "2":49
43
# },
44
# "2":{
45
# "1":10,
46
# "2":34
47
# }
48
# ...
49
# }
50
# "updatedAt":1514926256221,
51
# }
52
53
54
55
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" https://api.locize.app/stats/users/3d0aa5aa-4660-4154-b6d9-907dbef10bb2
56
57
# [
58
# {
59
# "userId":"ba175147-c7a3-45d2-9b24-739ae2ed948c",
60
# "year":2019,
61
# "words":{ // amount of words saved per month
62
# "0":23,
63
# "1":54,
64
# "2":16,
65
# ...
66
# }
67
# "modifications":{ // amount of modifications per month
68
# "0":2,
69
# "1":6,
70
# "2":1,
71
# ...
72
# },
73
# "tagsSet":{ // amount of tags set per month by tag index
74
# "0":{
75
# "2":12,
76
# "4":7
77
# },
78
# "1":{
79
# "2":5,
80
# "4":18,
81
# "5":21
82
# },
83
# "2":{
84
# "4":1,
85
# "5":24
86
# }
87
# ...
88
# },
89
# "tagsUnset":{ // amount of tags unset per month by tag index
90
# "0":{
91
# "0":2,
92
# "1":7
93
# },
94
# "1":{
95
# "0":5,
96
# "1":18,
97
# "2":49
98
# },
99
# "2":{
100
# "1":10,
101
# "2":34
102
# }
103
# ...
104
# }
105
# "updatedAt":1514926256221,
106
# },
107
# ...
108
# ]
Copied!
(You can find your projectId and API Key in your project settings under the API Tab.)
Last modified 3mo ago