所有 API

商品贸易 API 参考

官方货物出口额、进口额及贸易差额。

在线99.99% uptime, last 30天364 ms 典型响应

首次请求

获取最新值

curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/trade?period=2026-06" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"

获取历史数据

curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/trade/observations?start=2026-06&limit=100" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"

端点

GET货物贸易/v1/economics/{country}/trade

获取一个期间的出口额、进口额和精确的货物贸易差额。不包含服务。

参数

  • country必填

    一个受支持的大写国家代码;请参阅此操作的覆盖列表。

  • period可选

    省略此参数可获取已采纳的最新完整发布数据,也可传入一个具体期间。

  • version_id可选

    可选的不可变发布版本。使用 dataset.published 或 dataset.revised 事件中的 resource_version;省略则读取当前已收录的指标。

响应字段

  • country字符串

    所请求的大写 ISO 三字母国家代码。

  • period字符串

    返回的官方观测期间。

  • exports非负十进制字符串

    货物出口总额。

  • imports非负十进制字符串

    货物进口总额。

  • balance十进制字符串

    精确的出口额减进口额;结果可能为负。

  • currencyISO 4217 字符串

    三个货币值所使用的货币。

  • seasonal_adjustment字符串或 null

    Whether the figure is seasonally adjusted, as the publisher states it: seasonally_adjusted, not_seasonally_adjusted, calendar_adjusted or trend. null means the publisher does not say. Never read null as adjusted.

  • scope字符串

    What the totals cover. goods is trade in goods only, so services are not included. A headline figure that adds services is a different series and is not served here.

  • not_seasonally_adjusted是

    仅在数值为未经季节性调整的原始序列时出现,值为 true。未出现表示数值已做季节性调整,或为不含季节性调整的世界银行年度数据。

  • released_on日期

    官方发布日期,而不是 Narwhal 的检索时间。

  • source对象

    Who published the figure: the statistics office or central bank, for example {"publisher": "Office for National Statistics"}. Where the data reaches us through another body, distributor names that body too. If we cannot tell who published a figure, source is left out.


完整参考文档 →
GET货物贸易历史数据/v1/economics/{country}/trade/observations

获取一个国家当前已接受的货物贸易时间序列。

参数

  • country必填

    一个受支持的大写国家代码;请参阅此操作的覆盖列表。

  • start可选

    起始观测期(包含该期)。A year in YYYY format works only for countries served from World Bank annual data. A national series rejects it with 400 invalid_query.

  • end可选

    结束观测期(包含该期)。A year in YYYY format works only for countries served from World Bank annual data. A national series rejects it with 400 invalid_query.

  • limit可选

    返回的最大期间数。默认值为 100。页面可能包含更少的期间;请继续使用 next_cursor。

  • cursor可选

    上一页返回的next_cursor。

  • version可选

    只接受 first_reported:返回每个期间首次存储的值,并附带 first_reported_at。不能与 as_of 同时使用。

  • as_of可选

    返回截至指定 UTC 日终时已发布的序列。不能与 version 同时使用。

响应字段

  • country字符串

    请求的大写 ISO alpha-3 国家代码。每页返回一次,不在每条观测记录中重复。

  • start字符串

    仅当 Narwhal 将请求的 start 推迟到更晚的期间时出现。不会返回更早的期间。

  • as_ofRFC 3339 时间戳

    来源最后更新本页最新观测值的时间,精确到整秒,使用 UTC。

  • source对象

    Who published the figure: the statistics office or central bank, for example {"publisher": "Office for National Statistics"}. Where the data reaches us through another body, distributor names that body too. If we cannot tell who published a figure, source is left out.

  • frequency字符串

    Present, as annual, only for yearly World Bank history. Periods are then years in YYYY format.

  • seasonal_adjustment字符串或 null

    Whether the figure is seasonally adjusted, as the publisher states it: seasonally_adjusted, not_seasonally_adjusted, calendar_adjusted or trend. null means the publisher does not say. Never read null as adjusted.

  • scope字符串

    What the totals cover. goods is trade in goods only, so services are not included. A headline figure that adds services is a different series and is not served here.

  • currencyISO 4217 字符串

    本页所有数值使用的币种。

  • not_seasonally_adjusted是

    仅在数值为未经季节性调整的原始序列时出现,值为 true。未出现表示数值已做季节性调整,或为不含季节性调整的世界银行年度数据。

  • observations数组

    按时间从早到晚排列的已采纳观测记录,每个期间一条。来源缺失的值会被省略,绝不填补。每页观测记录数可能小于 limit;请继续使用 next_cursor,直到其值为 null。

  • observations[].period字符串

    观测值所代表的官方月份、季度或年份。

  • observations[].first_reported_atRFC 3339 时间戳

    仅在 version=first_reported 时出现。这个 UTC 时间戳记录 Narwhal 首次存储该期间的时间(如果各项指标是分开存储的,则取最晚的时间)。在开始采集之前发布的期间,显示的是 Narwhal 的首次采集时间。

  • observations[].exports十进制字符串

    该期间的货物出口额。该期间没有可用值时省略。

  • observations[].imports十进制字符串

    该期间的货物进口额。该期间没有可用值时省略。

  • next_cursor字符串或 null

    将此值原样作为 cursor 传入,以读取下一页;最后一页为 null。


完整参考文档 →

使用场景

按国家和日期搭建经济日历

按 UTC 列出你所选国家和日期的发布时间。

阅读指南 →

在发布前收到提醒

通过日历订阅源或每日脚本设置提醒。

阅读指南 →

回填历史数据

分页下载整个序列,中断后可继续。

阅读指南 →

覆盖范围

显示全部 39 个国家

来源

  • 澳大利亚澳大利亚统计局(ABS)
  • 奥地利奥地利统计局、欧盟统计局(Eurostat)
  • 比利时比利时统计局(Statbel)、比利时国家银行、欧盟统计局(Eurostat)
  • 巴西Brazilian Institute of Geography and Statistics (IBGE), Secretariat of Foreign Trade (SECEX)
  • 加拿大加拿大统计局
  • 智利智利中央银行(BCCh)、智利国家统计局(INE)
  • 中国National Bureau of Statistics of China, General Administration of Customs of China
  • 哥伦比亚国家统计行政部(DANE)
  • 捷克捷克统计局(ČSÚ)
  • 德国德国联邦统计局(Destatis)
  • 丹麦丹麦统计局、欧盟统计局(Eurostat)
  • 西班牙西班牙国家统计局(INE)、西班牙税务局(AEAT)
显示全部 39 个来源
  • 爱沙尼亚爱沙尼亚统计局
  • 芬兰芬兰统计局、芬兰海关(Tulli)
  • 法国法国国家统计与经济研究院(INSEE)、法国海关
  • 英国英国国家统计局(ONS)
  • 克罗地亚克罗地亚统计局(CBS)
  • 印度尼西亚印度尼西亚统计局(BPS)
  • 爱尔兰中央统计局(CSO)
  • 意大利意大利国家统计局(Istat)、欧盟统计局(Eurostat)
  • 日本日本统计局、日本内阁府、日本 Customs
  • 韩国Bank of Korea, Statistics Korea
  • 立陶宛立陶宛国家数据局
  • 卢森堡STATEC、欧盟统计局(Eurostat)
  • 拉脱维亚拉脱维亚中央统计局(CSB)
  • 墨西哥国家统计、地理和信息研究所(INEGI)
  • 马来西亚马来西亚统计局(DOSM)
  • 荷兰荷兰统计局(CBS)
  • 挪威挪威统计局(SSB)
  • 新西兰Stats NZ
  • 巴基斯坦巴基斯坦统计局(PBS)
  • 菲律宾菲律宾统计局(PSA)
  • 波兰波兰统计局、欧盟统计局(Eurostat)
  • 葡萄牙葡萄牙统计局(INE)
  • 沙特阿拉伯统计总局(GASTAT)
  • 新加坡新加坡统计局(SingStat)、新加坡政府发布的开放数据
  • 斯洛文尼亚斯洛文尼亚共和国统计局(SURS)
  • 瑞典瑞典统计局(SCB)
  • 美国劳工统计局(BLS)、经济分析局(BEA)、美国人口普查局

相关 API

经济数据 API

价格、劳动力、产出、贸易和利率的官方指标。

探索 API →

常见问题

响应包含哪些内容?

获取一个期间的出口额、进口额和精确的货物贸易差额。不包含服务。

可以请求哪些时间段?

YYYY 或 YYYY-MM

支持哪些数据范围?

Merchandise totals follow the country list below. Services trade is not included. For Bulgaria, Cyprus, Greece, Hungary, Malta, Romania and Slovakia the totals are Eurostat's, and for Costa Rica, Iceland, South Africa, Switzerland and Turkey the OECD's. For Iceland, South Africa and Turkey `source.publisher` names the national office and `source.distributor` names the OECD. They follow that publisher's method, so they can differ from the national office's headline. These twelve answer the newest month; their history is yearly.