海关数据 API
查数据覆盖
查看哪些国家有货运记录和官方统计,以及覆盖的时间范围。免费。
GET https://api.won.dev/v1/trade/coverage
付费查询前,先确认一个国家有哪些数据:进口和出口是否各有本地申报的货运记录、记录是否带金额、覆盖哪些日期、能否查询官方统计。免费。没有本国记录的国家(records: false)仍会出现在搜索结果中,但数据只来自贸易伙伴的申报,因此并不完整。不传 country 时,列出有本国记录或官方统计的国家;其余只通过贸易伙伴申报出现的国家,会在 notice 中给出数量。
- 计费: 免费。
- 数据模式:
proxy(各模式的含义)
参数
参数放在查询字符串里,多个值用英文逗号分隔。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
country | string | 否 | 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 原文) |
|---|---|---|
data | object[] | One entry for each country. |
data[].country | string | ISO 3166-1 alpha-2 country code, such as US. |
data[].imports | object | Records of goods imported into the country. |
data[].imports.records | boolean | null | Whether shipment records declared in this country exist. Null when not known yet. |
data[].imports.values | boolean | null | Whether those records carry declared values. Null when not known yet. |
data[].imports.earliest | string | null | Date of the earliest record seen, YYYY-MM-DD. |
data[].imports.latest | string | null | Date of the latest record seen, YYYY-MM-DD. |
data[].imports.note | string | null | Something to know about these records, such as a gap or a late start. |
data[].exports | object | Records of goods exported from the country. |
data[].exports.records | boolean | null | Whether shipment records declared in this country exist. Null when not known yet. |
data[].exports.values | boolean | null | Whether those records carry declared values. Null when not known yet. |
data[].exports.earliest | string | null | Date of the earliest record seen, YYYY-MM-DD. |
data[].exports.latest | string | null | Date of the latest record seen, YYYY-MM-DD. |
data[].exports.note | string | null | Something to know about these records, such as a gap or a late start. |
data[].official | object | Official statistics with the country as importer or exporter. |
data[].official.available | boolean | Whether official trade statistics can be queried. |
data[].official.latest_month | string | null | Latest month published, YYYY-MM. |
data[].official.mirror | boolean | True when the country publishes no recent statistics of its own, and they are what its partners report about their trade with it. |
query | object | The request as it was understood: country names as codes, the default dates filled in. |
notice | string | null | A plain sentence when there is something to know about this result: why a part is missing, or what to try next. Null otherwise. |
usage | object | Nothing is charged here. The balance, for reference. |
usage.cost | number | What this call cost, in US dollars. |
usage.balance | number | The balance left after this call, in US dollars. |
usage.replayed | boolean | True 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
}
}