gtt logo

REST API

version 2501

URIs and Endpoints

The following services are available

Subscription details

To get the details of your current subscription (countries and commodity codes) for the actual contract/userid, use:

https://www.globaltradetracker.com/api/rest/subscriptions

Supported method: GET

Parameter:

periodType
following period types are currently supported:
  • M (month) - default value
  • Y (year)
  • Q (quarter)
  • S (semester)
  • YTD (year-to-date)

Response: JSON

Available Countries

To get a list of all available countries in GTT (including alphageonom2 code, source, first/last available date, date of last update, update frequency, extra information etc.) use:

https://www.globaltradetracker.com/api/rest/countries

Supported method: GET

Parameter:

periods
if specified with the value “true”, the country information also contains the list of available periods with the data status for each period.
The status values are:
  • FULL – complete trade data is available
  • PART – partial data is available
  • VALUES – only the values are available, no quantity information
  • EXTRAEU – only the extra-EU information is available (used for the EU countries only).
onlydefaultreporters
if specified as ‘true’, only the default reporters for each reporting country will be included in the result.
lang
defines the language used for the translation of the country names.
Allowed values: en de fr zh_CN es hi ja
Default value if missing/not set: en

Response: JSON

Available Country Groups

To get a list of available country groups in GTT:

https://www.globaltradetracker.com/api/rest/countrygroups

Supported method: GET

Parameter:

filter
can be specified to show only a certain type of country groups:
  • STANDARD – show only the standard groups
  • OWN – show only the groups owned by current user
All available country groups will be displayed if this parameter is not specified.
name
if specified, the single country group will be displayed.
It is possible to show the reporter data set for the countries in the group by specifying the suffix after the group name.
  • _NATIONAL – show the national data source if available
  • _EUROSTAT – show the Eurostat data source if available
  • _COMTRADE – show the UN Comtrade data source if available
  • _DEFAULT – show default data set for the country
  • _USERDEFINED – show the user defined data set if available
Examples:
  • name=EFTA
  • name=Europe
  • name=Europe_NATIONAL
  • name=Europe_EUROSTAT
lang
defines the language used for the translation of the country names.
Allowed values: en de fr zh_CN es hi ja
Default value if missing/not set: en

Response: JSON

Available Trade Details

To get a list of names and ids of the available trade details for the countries on GTT use.
Please note: Only a certain number of countries report this type of information. Please refer to the data availability list to get the different countries and their supplementary data elements.

https://www.globaltradetracker.com/api/rest/tradedetails

Supported method: GET

Parameter:

tradedetails
defined the type of the trade details.
The value for this parameter depdends on the country and can be one of the fields in the country information ‘supplementaryInfo` field (see Available Countries).
For example:
  • SUBDIVISION – complete trade data is available
  • PORT – country ports
  • TRANSPORT – transportation mode
The parameter is required.
countryCode
Geonom alpha-2 country code.
Some of the reporting countries have several sets of the trade data. It is possible to select the specific trade data by appending the suffix to the country code.
E.g. ‘FR_customs’ specifies the trade data provided by the national statistics office, ‘FR_eurostat’ specifies the data provided by Eurostat.
If the reporting country has several sets of the trade data, it will be specified several times in the list of countries provided by the ‘Available Countries’ end-point (see 4.2 above) with the respective suffixes in the ‘reportercode’ property.
The parameter is required unless, the parameter tradedetails=TRANSPORT is specified (the avaialable transportation modes are not country-specific).
lang
defines the language used for the translation of the country names.
Allowed values: en de fr zh_CN es hi ja
Default value if missing/not set: en

Response: JSON

Report fields

To get a list of all available report fields use:

https://www.globaltradetracker.com/api/rest/fields

Supported method: GET

Parameter:

lang
defines the language used for the translation of the country names.
Allowed values: en de fr zh_CN es hi ja
Default value if missing/not set: en

Response: JSON

Data updates

To retrieve information regarding data updates on GTT (whether this is newly added data or updated data) following URL can be used:

https://www.globaltradetracker.com/api/rest/dataupdates

Supported method: GET

Parameter:

countryCode
a list of comma-separated country codes, e.g. “US,CA,CH"
periodType
following period types are currently supported:
  • M (month) - default value
  • Y (year)
  • Q (quarter)
  • S (semester)
  • YTD (year-to-date)
updatedAfter
the date to check for updates/additions (i.e. updates/additions will be reported from this date onwards)
Supported formats:
  • yyyy-MM-ddTHH:mm:ss
  • yyyy-MM-dd (will become yyyy-MM-ddT00:00:00 internally)
  • yyyy-MM (will become yyyy-MM-01T00:00:00 internally)
  • yyyy (will become yyyy-01-01T00:00:00 internally)
updatedBefore
if specified, only the updates/additions before this date are included.
Supported formats:
  • yyyy-MM-ddTHH:mm:ss
  • yyyy-MM-dd (will become yyyy-MM-ddT00:00:00 internally)
  • yyyy-MM (will become yyyy-MM-01T00:00:00 internally)
  • yyyy (will become yyyy-01-01T00:00:00 internally)
includetimestamps
if specified as ‘true’, the updated periods are returned with the timestamp, when the trade dara was added and revised.

Response: JSON

Available Versions

To get a list of the currently supported GTT REST API versions use:

https://www.globaltradetracker.com/api/rest/versions

Supported method: GET

Response: JSON

Report Generation

To create a GTT report, use:

https://www.globaltradetracker.com/api/rest/getreport

Supported methods: GET, POST

Parameters.