Responses

Anatomy of a Response

To understand how the data is returned, let's break down the anatomy of an example response. In this case we're we'll stick with our previous example of the products exported by Spain in 2023:

https://api-v2.oec.world/tesseract/data.jsonrecords?cube=trade_i_baci_a_22&drilldowns=HS4,Exporter+Country,Importer+Country,Year&measures=Trade+Value&include=Exporter+Country:euesp;Year:2023&limit=2,0&token=6b540954e368f971

Response Format

The response will be a JSON object with the following structure:

{
"annotations": {
"table": "HS6 REV. 2022 (2022 - 2023)",
"dataset_link": "http://www.cepii.fr/CEPII/en/bdd_modele/presentation.asp?id=37",
"topic": "International",
"subtopic": "Trade",
"source_description": "Product Trade by Year and Country (HS 6-digit depth)",
"dataset_name": "HS6 REV. 2022 (2022 - 2023)",
"source_name": "BACI"
},
"page": {
"limit": 2,
"offset": 0,
"total": 108101
},
"columns": [
"Exporter Country ID",
"Exporter Country",
"HS4 ID",
"HS4",
"Importer Country ID",
"Importer Country",
"Year",
"Trade Value"
],
"data": [
{
"Exporter Country ID": "euesp",
"Exporter Country": "Spain",
"HS4 ID": 10101,
"HS4": "Horses",
"Importer Country ID": "aflby",
"Importer Country": "Libya",
"Year": 2023,
"Trade Value": 235109
},
{
"Exporter Country ID": "euesp",
"Exporter Country": "Spain",
"HS4 ID": 10101,
"HS4": "Horses",
"Importer Country ID": "afmar",
"Importer Country": "Morocco",
"Year": 2023,
"Trade Value": 628207
}
]
}

1. Annotations

The annotations object contains metadata about the dataset such as the source name, source description, topic, subtopic, and dataset name.

2. Pagination

The page object contains metadata about the pagination of the data response, such as the limit, offset, and total number of records available for that set of parameters.

3. Columns

The columns object contains the list of columns in the dataset. Please note that even though we didn't specify to include the ID columns in the request, they are still returned.

4. Data

The data object contains the list of records in the dataset. The keys are the column names (including both drilldown and measure columns) and the values are the values for that column for the given record.

Have questions, comments, or concerns?
Send us an e-mail: support@oec.world
Follow @OECtoday on
Created, Designed, and Developed by:
In collaboration with