国际贸易数据示例

国际贸易数据特点

OEC 提供国家间按产品分类的年度贸易数据。产品分类使用《协调制度》(HS),这是全球海关机构用于对贸易商品进行分类的统一编码框架。自引入以来,HS 已于 1992、1996、2002、2007、2012、2017 和 2022 年进行多次更新。BACI 数据库针对每个版本提供单独的数据集(“数据立方体”)。

HS 修订版年份立方体名称
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

如何选择正确的数据立方体?

每个协调制度(HS)修订版针对其覆盖的年份提供一致的产品分类。在跨多年进行贸易分析时,至关重要的是选择与您的时间范围相匹配的 HS 修订版,以确保产品定义和分类的一致性。

一个简单的经验法则是选择适用于您最早年份的最新 HS 修订版。例如,如果您分析 2010 年至今的贸易数据,HS 2007(HS07)修订版是最合适的,因为它能确保整个分析期间的产品定义保持一致。


1. 全球贸易总值随时间变化

由于我们希望获取最长时间序列的全球贸易总值,应使用 HS92 修订版立方体: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,
},
],
};

5. 爱沙尼亚过去 5 年的出口总值 🇪🇪

由于我们对爱沙尼亚过去 5 年的总出口感兴趣,我们应该使用 HS17 修订立方体:trade_i_baci_a_17。要找到出口国的 ID(在这种情况下,爱沙尼亚的 euest),我们可以使用该立方体的 /members 端点,并将 Exporter Country 设置为 level 参数。

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

响应:

{
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
}
],
};

6. 最近 2 年的无人机出口总值 🛩️

由于我们对最近 2 年无人机的总出口感兴趣,我们应该使用 HS22 修订立方体,因为它是一个更新的产品,并且我们对最近 2 年感兴趣:trade_i_baci_a_22。要找到我们感兴趣的特定产品的 ID(在这种情况下,无人机的第 17 节 HS6 880629,即 17880629),我们可以使用该立方体的 /members 端点,并将 HS6 设置为 level 参数。

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

响应:

{
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,
},
],
};

7. 加拿大最近一年的产品进口 🇨🇦

在这个例子中,我们将查看加拿大在最近一年按产品类别划分的总进口。我们将使用 HS22 修订版,因为我们对最近的数据感兴趣,并且我们将使用 HS2 级别来表示广泛的产品类别。加拿大的国家代码是 nacan

注意:要按最近一年过滤,您可以使用 time 参数和 latest 关键字,而不是在 include 参数中指定年份。

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

响应:

{
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
}
],
};

8. 加拿大从德国进口汽车总值(最近一年)🇨🇦 🚗 🇩🇪

在下一个例子中,我们将使用完整的双边贸易数据。由于我们对最近一年从德国到加拿大的汽车总进口感兴趣,我们应该使用最新的修订版(HS22),并且因为我们对汽车感兴趣,这是一种聚合产品类别,我们应该使用 4 位深度(HS4)级别。要找到我们感兴趣的特定产品的 ID(在这种情况下,汽车的 178703),我们可以使用该立方体的 /members 端点,并将 HS4 包含为 level 参数。

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

响应:

{
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