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

公司的贸易伙伴

公司的供应商或买家排名,附带各自占比。按返回的伙伴数计费。

GET https://api.won.dev/v1/trade/companies/{id}/partners

返回一家公司的贸易伙伴排名:role=supplier(默认)查看它的供应商,role=buyer 查看它的买家。每返回一家伙伴收取 $0.01,空结果免费。share 是该伙伴在这一方向记录中的占比,取值 0 到 1:如果少数几家占比很高,说明这家公司依赖少数供应商或买家。可以用它找出竞争对手的供应商,或者你的供应商的其他客户。每一行都带有 ID,可用于其他公司接口。贸易伙伴是按这家公司在记录中的名称查出来的,所以名称很常见的公司,名单里可能混入同名公司的伙伴。

  • 计费: trade_company $0.01:买家、供应商或贸易伙伴列表中的一家公司,或一条线索中的公司。
  • 数据模式: proxy (各模式的含义)

参数

id 放在路径中,其余参数放在查询字符串里,多个值用英文逗号分隔。

参数类型必填说明(API 原文)
idstring是Company ID, such as co_8f3k2m9x4p1q. Search results carry it; GET /trade/companies/lookup?q= finds it by name.
rolesupplier | buyer否supplier: the companies it buys from. buyer: the companies it sells to. Default: supplier.
hs_codestring否HS code, digits only, 6 to 10 digits. Six digits are the same in every country; a longer code is one country's own tariff line, matched by prefix. Find the code of a product with GET /trade/hs-codes.
sincestring否First day of the date range, YYYY-MM-DD. Default: the first day of the month 12 months before until.
untilstring否Last day of the date range, YYYY-MM-DD. Default: up to the latest records.
sortshipments | recorded_value否Rank by number of records, or by declared value. Default: shipments.
limitinteger否How many results to return, 1 to 100. You pay for the results returned. Default: 10.
cursorstring否To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.
max_costnumber否Spending cap for this call in US dollars. If the call could cost more, it fails with budget_exceeded before anything is charged.
dry_runboolean否If true, only return the maximum cost of this call. Nothing runs, nothing is charged. Default: false.

响应

传入 dry_run: true 时不执行查询,data 中只返回本次调用的最高费用,见预估费用。错误说明见错误码。

字段类型说明(API 原文)
dataobject[]The results of this page.
data[].idstringCompany ID, such as co_8f3k2m9x4p1q.
data[].namestringName as written on shipping documents.
data[].rolesupplier | buyerWhat it is to the company asked about.
data[].countrystring | nullISO 3166-1 alpha-2 country code, such as US.
data[].shipmentsintegerNumber of shipment records. A count of records, not a market share: countries that publish every declaration are over-represented.
data[].recorded_value_usdnumber | nullSum of the declared values of the records that have one, in US dollars. A lower bound: US bills of lading carry no value.
data[].sharenumber | nullThis partner's part of the company's records in the same direction, from 0 to 1. Shows how concentrated its suppliers or buyers are.
data[].websitestring | nullBare domain, such as example.com. Often null.
data[].sample_productstring | nullA goods description from one of its records.
totalintegerHow many results match in all. Use it to decide between paging on and narrowing the query.
has_morebooleanWhether more results follow this page.
next_cursorstring | nullPass it as cursor to get the next page. Null on the last page.
queryobjectThe request as it was understood: country names as codes, the default dates filled in. data_through says how recent the records behind the answer are.
query.data_throughstring | nullDate of the latest record this query can see, YYYY-MM-DD. Records arrive weeks after a shipment, so recent months are incomplete.
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.
usageobjectWhat this call was charged, and the balance left.
usage.unittrade_record | trade_company | trade_company_profile | trade_lookup | person_email | company_channels | trade_stats | trade_official_statsWhat is counted.
usage.recordsintegerHow many were returned and charged.
usage.already_paidintegerHow many more were returned for free, because this organization paid for them in the last 30 days.
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/companies/co_8f3k2m9x4p1q/partners?role=supplier&limit=2" \
  -H "Authorization: Bearer $WON_API_KEY"
{
  "data": [
    {
      "id": "co_2c7h5n0w6r8t",
      "name": "SAMPLE DONG NAI COMFORT FURNITURE CO LTD",
      "role": "supplier",
      "country": "VN",
      "shipments": 1325,
      "recorded_value_usd": 18240118.6,
      "website": "dongnai-comfort.example",
      "sample_product": "UPHOLSTERED SOFA WITH WOODEN FRAME, FABRIC COVER",
      "share": 0.5421
    },
    {
      "id": "co_4e6g8j0k2m4n",
      "name": "SAMPLE SELANGOR UPHOLSTERY SDN BHD",
      "role": "supplier",
      "country": "MY",
      "shipments": 688,
      "recorded_value_usd": 6120440.9,
      "website": "selangor-upholstery.example",
      "sample_product": "RECLINER SOFA SET, LEATHER, 3 SEATER",
      "share": 0.2815
    }
  ],
  "total": 3,
  "has_more": true,
  "next_cursor": "cur_UGFydG5lcnMuMXJ6ZzQ",
  "query": {
    "id": "co_8f3k2m9x4p1q",
    "role": "supplier",
    "sort": "shipments",
    "since": "2025-11-01",
    "until": "2026-11-20",
    "data_through": "2026-11-11"
  },
  "notice": null,
  "usage": {
    "unit": "trade_company",
    "records": 2,
    "already_paid": 0,
    "cost": 0.02,
    "balance": 48.08,
    "replayed": false
  }
}

用测试 key(won_test_...)发送这个请求,会返回同一批样例公司,不收费。

本页内容