跳到正文
Won.dev
海关数据 API

查数据覆盖

查看哪些国家有货运记录和官方统计,以及覆盖的时间范围。免费。

GET https://api.won.dev/v1/trade/coverage

付费查询前,先确认一个国家有哪些数据:进口和出口是否各有本地申报的货运记录、记录是否带金额、覆盖哪些日期、能否查询官方统计。免费。没有本国记录的国家(records: false)仍会出现在搜索结果中,但数据只来自贸易伙伴的申报,因此并不完整。不传 country 时,列出有本国记录或官方统计的国家;其余只通过贸易伙伴申报出现的国家,会在 notice 中给出数量。

参数

参数放在查询字符串里,多个值用英文逗号分隔。

参数类型必填说明(API 原文)
countrystring否The country to check. Leave it out to list all. An ISO code such as US, or an English name such as United States.

响应

错误说明见错误码。

字段类型说明(API 原文)
dataobject[]One entry for each country.
data[].countrystringISO 3166-1 alpha-2 country code, such as US.
data[].importsobjectRecords of goods imported into the country.
data[].imports.recordsboolean | nullWhether shipment records declared in this country exist. Null when not known yet.
data[].imports.valuesboolean | nullWhether those records carry declared values. Null when not known yet.
data[].imports.earlieststring | nullDate of the earliest record seen, YYYY-MM-DD.
data[].imports.lateststring | nullDate of the latest record seen, YYYY-MM-DD.
data[].imports.notestring | nullSomething to know about these records, such as a gap or a late start.
data[].exportsobjectRecords of goods exported from the country.
data[].exports.recordsboolean | nullWhether shipment records declared in this country exist. Null when not known yet.
data[].exports.valuesboolean | nullWhether those records carry declared values. Null when not known yet.
data[].exports.earlieststring | nullDate of the earliest record seen, YYYY-MM-DD.
data[].exports.lateststring | nullDate of the latest record seen, YYYY-MM-DD.
data[].exports.notestring | nullSomething to know about these records, such as a gap or a late start.
data[].officialobjectOfficial statistics with the country as importer or exporter.
data[].official.availablebooleanWhether official trade statistics can be queried.
data[].official.latest_monthstring | nullLatest month published, YYYY-MM.
data[].official.mirrorbooleanTrue when the country publishes no recent statistics of its own, and they are what its partners report about their trade with it.
queryobjectThe request as it was understood: country names as codes, the default dates filled in.
noticestring | nullA plain sentence when there is something to know about this result: why a part is missing, or what to try next. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

示例

curl "https://api.won.dev/v1/trade/coverage?country=United%20States" \
  -H "Authorization: Bearer $WON_API_KEY"
{
  "data": [
    {
      "country": "US",
      "imports": {
        "records": true,
        "values": false,
        "earliest": "2021-01-01",
        "latest": "2026-11-13",
        "note": null
      },
      "exports": {
        "records": true,
        "values": false,
        "earliest": "2021-01-02",
        "latest": "2026-09-30",
        "note": null
      },
      "official": {
        "available": true,
        "latest_month": "2026-09"
      }
    }
  ],
  "query": {
    "country": "US"
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}

本页内容