WebTranslateIt API » Stats API

The Stats API is composed of 2 endpoints:

  • Statistics — check your project’s translation statistics UPDATED
  • Charts — get your project’s stats as a PNG image
  • Top Translators NEW — get your project’s top translators

Stats

This endpoint is accessible by both private and public API keys and returns a project’s translation statistics.

/api/projects/:project_token/stats.format [GET]

where format is one of json, xml or yaml. Note that you can get a JSONP response by adding a ?callback=yourFunctionName parameter to the json API call.

Optional Parameters

  • file: File ID to filter by.
  • date_range: Amount of time since the strings were added. Accepts a string such as 1.day.ago, 27.days.ago, 3.months.ago, 2.years.ago.
  • category: Category ID to filter by.
  • label: Label ID to filter by.
  • s: Search to filter by.

Examples:

Data structure in .yaml:

--- 
fr: 
  generated_at: 2010-03-06 21:13:27.919203 Z
  stale: false
  count_strings: 1021    # string count
  count_strings_done: 956
  count_strings_to_proofread: 65
  count_strings_to_verify: 0
  count_strings_to_translate: 0
  count_strings_not_translatable: 25
  wc_count_strings: 8416    # word count
  wc_count_strings_done: 7783
  wc_count_strings_to_proofread: 633
  wc_count_strings_to_verify: 0
  wc_count_strings_to_translate: 0
  wc_count_strings_not_translatable: 230
ru: 
  generated_at: 2010-03-08 21:06:04.209397 Z
  stale: false
  count_strings: 1021
  count_strings_done: 124
  ...

Please note the stale flag. If set to true it means some translations were made between the last time the stats were generated and now. This is due to the fact that statistics are only refreshed on demand. You will get fresh data the next time you query this endpoint. Use generated_at to determine if it worths querying the endpoint again: for example if the data is only 2 minutes old, you probably already have a fair estimate.


Charts

This endpoint is accessible by both private and public API keys and returns a project’s translation statistics.

/api/projects/:project_token/charts.png [GET]

Example:

https://webtranslateit.com/api/projects/98e71ee45042066f1053ed900b4e8f4ec1f98451/charts.png


Top Translators

This endpoint is accessible by the private API key and returns a list of most active translators in a project.

/api/projects/:project_token/top_translators.format [GET]

where format is one of json, xml or yaml. Note that you can get a JSONP response by adding a ?callback=yourFunctionName parameter to the json API call.

The endpoint returns the following information:

  • The contributor’s rank,
  • The contributor’s email address,
  • The contributor’s name, if known,
  • The contributor’s locale
  • URL to the contributor’s avatar.

You can pass an optional ?locale=xx argument containing a locale code to filter the Top Translators by locale.

Data structure in .yaml:

---
- :rank: 1
  :avatar: https://secure.gravatar.com/avatar/46ff6de645e2045f8ce6a3d640c1d48c.png?d=identicon&r=PG
  :email: email@googlemail.com
  :name: John Doe
  :locale: sv
- :rank: 2
  :avatar: https://secure.gravatar.com/avatar/1961fef04b12f9366acd7c0f7ce0297b.png?d=identicon&r=PG
  :email: email@gmail.com
  :name: Jane Doe
  :locale: ru
- :rank: 3
  :avatar: https://secure.gravatar.com/avatar/a80d19a153623f4d9dc5f1365858da37.png?d=identicon&r=PG
  :email: email2@gmail.com
  :name: ''
  :locale: fr