响应

响应结构解析

为了了解数据如何返回,我们继续使用之前西班牙 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

响应格式

响应将是具有以下结构的 JSON 对象:

{
"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(注释)

annotations 对象包含有关数据集的元数据,例如来源名称、来源描述、主题、副主题和数据集名称。

2. Page(分页)

page 对象包含有关响应的元数据,例如 limit、offset 和总记录数。

3. Columns(列)

columns 对象包含数据集中列的列表。请注意,即使我们未在响应中指定包含 ID 列,它们仍会返回。

4. Data(数据)

data 对象包含数据集中的记录列表。键为列名(包含 drilldown 和度量列),值为相应记录中该列的值。

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