International Trade Data Examples

International Trade Data Nuances

The OEC offers annual data on trade between countries, broken down by individual products. These products are classified using the Harmonized System (HS), a globally recognized coding framework used by customs agencies around the world for categorizing traded goods. Since its introduction, the HS has been updated multiple timesโ€”in 1992, 1996, 2002, 2007, 2012, 2017 and 2022. Corresponding to each version, the BACI database provides data organized into separate datasets, or "data cubes."

HS RevisionYearsCube Name
HS921995-2023trade_i_baci_a_92
HS961996-2023trade_i_baci_a_96
HS022002-2023trade_i_baci_a_02
HS072007-2023trade_i_baci_a_07
HS122012-2023trade_i_baci_a_12
HS172017-2023trade_i_baci_a_17
HS222022-2023trade_i_baci_a_22

How Do I Choose the Correct Data Cube?

Each Harmonized System (HS) revision offers a consistent set of product classifications specific to the years it covers. When conducting trade analysis across multiple years, it's crucial to select the HS revision that aligns with your time range to maintain consistency in how products are defined and categorized.

A good rule of thumb is to choose the most recent HS revision that still applies to the earliest year in your dataset. For example, if you're analyzing trade data from 2010 to the present, the HS 2007 (HS07) classification would be the most appropriate, as it ensures uniformity in product definitions throughout your entire analysis period.


1. Total World Trade Value Over Time

Since we are interested in the total world trade value for the longest time series possible, we should use the HS92 revision cube: trade_i_baci_a_92

API URL:

https://api-v2.oec.world/tesseract/data.jsonrecords?cube=trade_i_baci_a_92&drilldowns=Year&measures=Trade+Value&limit=100,0

Response:

{
annotations: {
table: "HS6 REV. 1992 (1995 - 2023)",
...
},
page: {...},
columns: [...],
data: [
{
Year: 1995,
"Trade Value": 5064428174731,
},
{
Year: 1996,
"Trade Value": 5366727699264,
},
{
Year: 1997,
"Trade Value": 5597860603133,
},
... more years ...
{
Year: 2023,
"Trade Value": 22603129713659,
},
],
};

2. Total Exports of Estonia Over the Last 5 Years ๐Ÿ‡ช๐Ÿ‡ช

Since we are interested in the total exports of Estonia over the last 5 years, we should use the HS17 revision cube: trade_i_baci_a_17. To find the ID of the Exporter Country (in this case euest for Estonia), we can use the /members endpoint for this cube and set Exporter Country as the level parameter.

API URL:

https://api-v2.oec.world/tesseract/data.jsonrecords?cube=trade_i_baci_a_17&drilldowns=Year,Exporter+Country&measures=Trade+Value&include=Year:2019,2020,2021,2022,2023;Exporter+Country:euest&limit=100,0

Response:

{
annotations: {
table: "HS6 REV. 2017 (2018 - 2023)",
...
},
page: {...},
columns: [...],
data: [
{
"Exporter Country ID": "euest",
"Exporter Country": "Estonia",
Year: 2019,
"Trade Value": 17072197931,
},
{
"Exporter Country ID": "euest",
"Exporter Country": "Estonia",
Year: 2020,
"Trade Value": 16706918778,
},
{
"Exporter Country ID": "euest",
"Exporter Country": "Estonia",
Year: 2021,
"Trade Value": 21847479266,
},
{
"Exporter Country ID": "euest",
"Exporter Country": "Estonia",
Year: 2022,
"Trade Value": 24448580470,
},
{
"Exporter Country ID": "euest",
"Exporter Country": "Estonia",
Year: 2023,
"Trade Value": 20535420466
}
],
};

3. Total Exports of Drones In The Most Recent 2 Years ๐Ÿ›ฉ๏ธ

Since we are interested in the total exports of drones in the most recent 2 years, we should use the HS22 revision cube since it is a newer product and because we are interested in the most recent 2 years: trade_i_baci_a_22. To find the ID of the specific product we are interested in (in this case Section 17 HS6 880629 for drones, so 17880629), we can use the /members endpoint for this cube and set HS6 as the level parameter.

API URL:

https://api-v2.oec.world/tesseract/data.jsonrecords?cube=trade_i_baci_a_22&drilldowns=Year,HS6&measures=Trade+Value&include=Year:2022,2023;HS6:17880629&limit=100,0

Response:

{
annotations: {
table: "HS6 REV. 2022 (2022 - 2023)",
...
},
page: {...},
columns: [...],
data: [
{
"HS6 Code": "17880629",
"HS6 Description": "Heavy drones (>150kg), RC Only",
Year: 2022,
"Trade Value": 110048559,
},
{
"HS6 Code": "17880629",
"HS6 Description": "Heavy drones (>150kg), RC Only",
Year: 2023,
"Trade Value": 341776768,
},
],
};

4. Products Imported by Canada in the Most Recent Year ๐Ÿ‡จ๐Ÿ‡ฆ

For this example, we'll look at Canada's total imports broken down by product categories in the most recent year. We'll use the HS22 revision since we're interested in recent data, and we'll use the HS2 level for broad product categories. The country code for Canada is nacan.

Note: To filter by the most recent year, instead of specifying the year in the include parameter, we can use the time parameter with the latest keyword.

API URL:

https://api-v2.oec.world/tesseract/data.jsonrecords?cube=trade_i_baci_a_22&drilldowns=Year,HS2,Importer+Country&measures=Trade+Value&include=Importer+Country:nacan&time=Year.latest&sort=-Trade+Value&limit=100,0

Response:

{
annotations: {
table: "HS6 REV. 2022 (2022 - 2023)",
...
},
page: {...},
columns: [...],
data: [
{
"HS2 Code": "1787",
"HS2 Description": "Vehicles other than railway",
"Importer Country": "Canada",
"Importer Country ID": "nacan",
Year: 2023,
"Trade Value": 115678234567
},
{
"HS2 Code": "1784",
"HS2 Description": "Machinery and computers",
"Importer Country": "Canada",
"Importer Country ID": "nacan",
Year: 2023,
"Trade Value": 98234567890
},
... more products ...
{
"HS2 Code": "1739",
"HS2 Description": "Plastics and articles thereof",
"Importer Country": "Canada",
"Importer Country ID": "nacan",
Year: 2023,
"Trade Value": 32109876543
}
],
};

5. Total Imports of Cars to Canada from Germany In the Most Recent Year ๐Ÿ‡จ๐Ÿ‡ฆ ๐Ÿš— ๐Ÿ‡ฉ๐Ÿ‡ช

For this next example we are going to make use of the full bilateral trade data. Since we are interested in the total imports of cars to Canada from Germany in the most recent year, we should use the latest revision (HS22) and because we are interested in Cars which is an aggregate product category we should use the 4 digit depth (HS4) level. To find the ID of the specific product we are interested in (in this case 178703 for cars), we can use the /members endpoint for this cube and include HS4 as the level parameter.

API URL:

https://api-v2.oec.world/tesseract/data.jsonrecords?cube=trade_i_baci_a_22&drilldowns=Year,Importer+Country,Exporter+Country&measures=Trade+Value&include=Importer+Country:nacan;Exporter+Country:eudeu&time=Year.latest&limit=100,0

Response:

{
annotations: {
table: "HS6 REV. 2022 (2022 - 2023)",
...
},
page: {...},
columns: [...],
data: [
{
"Importer Country ID": "nacan",
"Importer Country": "Canada",
"Exporter Country ID": "eudeu",
"Exporter Country": "Germany",
Year: 2023,
"Trade Value": 14431175781,
},
],
};
Have questions, comments, or concerns?
Send us an e-mail: support@oec.world
Follow @OECtoday on
Created, Designed, and Developed by:
In collaboration with