海关数据 API
找线索
一次调用拿到某个商品的买家或供应商,以及每家的联系方式。按返回的线索计费。
POST https://api.won.dev/v1/trade/leads/find
一次调用返回某个商品的买家(role: importer)或供应商(role: exporter),每家都附带联系方式:先像 POST /trade/companies/search 一样给公司排名,再查找每家公司的官网,然后找出带有验证过工作邮箱的联系人。只为返回的线索付费:每条线索按公司收取 $0.01,每位联系人另加 $0.03;只找到官网公共邮箱、电话或即时通讯账号(如 WhatsApp 号码)的线索,收取 $0.01 加 $0.02。完全联系不上的公司会被跳过,不收费。接口按排名依次检查,最多检查 limit 五倍数量的公司,最长运行 45 秒;scanned 是已检查的公司数,next_cursor 会从最后检查的那家之后继续。设置 require: person_email 时,只返回找到联系人的公司。每次最多返回 10 条线索,更多请用 next_cursor 翻页,或者用 POST /tasks 在后台获取最多 500 条。
- 计费:
trade_company$0.01:买家、供应商或贸易伙伴列表中的一家公司,或一条线索中的公司。person_email$0.03:一位联系人,附带公司自有域名下、已通过验证的工作邮箱。company_channels$0.02:从一家公司官网上找到的公共邮箱、电话或即时通讯账号,不论数量多少。 - 数据模式:
composite(各模式的含义)
参数
参数放在 JSON 请求体里。POST 请求还支持 Idempotency-Key 请求头,见幂等。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
role | importer | exporter | 是 | importer returns the companies that buy the product: buyers. exporter returns the companies that sell it: suppliers. |
hs_code | string | 否 | 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. |
product | string | 否 | Product keywords in English, such as office chair. A fuzzy match on the goods description. Use it when you do not know the HS code; an hs_code is more precise. |
importer_country | string | 否 | Country the goods are imported into: an ISO code such as US, or an English name such as United States. |
exporter_country | string | 否 | Country the goods are exported from: an ISO code such as VN, or an English name such as Vietnam. |
trading_with | string | 否 | Only companies that trade with this one: its co_ ID, or its name. With role: importer these are the buyers of that exporter, with role: exporter the suppliers of that importer. Either way it is matched by its name as it stands in the records, so companies that share the name count together. |
exclude_forwarders | boolean | 否 | Leave out freight forwarders and logistics companies, which stand on bills of lading in place of the real buyer or seller. Default: true. |
sort | shipments | recorded_value | 否 | shipments ranks by number of records. recorded_value ranks by declared value; only records that carry a value count, so it favors routes whose exporting country publishes values. Default: shipments. |
since | string | 否 | First day of the date range, YYYY-MM-DD. Default: the first day of the month 12 months before until. |
until | string | 否 | Last day of the date range, YYYY-MM-DD. Default: up to the latest records. |
seniority | (owner | c_level | executive | manager | senior | staff)[] | 否 | Only people of these levels: owner, c_level, executive (VP, director, head), manager, senior (a senior individual role, such as Senior Buyer), staff (any other role). Default: any level. |
department | (purchasing | sales | management | operations | marketing | finance | engineering | quality | it | hr | legal)[] | 否 | Only people in these departments. Default: purchasing and management first, which is whom a seller approaches. To reach a supplier, ask for sales. |
min_email_status | verified | risky | 否 | verified (default) returns only mailboxes that were confirmed to exist. risky also returns addresses on domains that accept every address, which cannot be confirmed. Same price. Default: verified. |
contacts_per_company | integer | 否 | The most contacts to return for each company, 1 to 3. Default: 1. |
require | any_contact | person_email | 否 | any_contact (default): every lead has the best way to reach the company that was found, a person's email if there is one, otherwise the shared mailboxes, phone numbers and messaging contacts of its website. person_email: only companies where a person with a verified email was found. Default: any_contact. |
limit | integer | 否 | How many results to return, 1 to 10. You pay for the results returned. Default: 5. |
cursor | string | 否 | To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters. |
max_cost | number | 否 | Spending cap for this call in US dollars. If the call could cost more, it fails with budget_exceeded before anything is charged. |
dry_run | boolean | 否 | If true, only return the maximum cost of this call. Nothing runs, nothing is charged. Default: false. |
响应
传入 dry_run: true 时不执行查询,data 中只返回本次调用的最高费用,见预估费用。错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object[] | The leads, in the order of the ranked list. |
data[].company | object | The buyer or supplier, as in the company search. |
data[].company.id | string | Company ID, such as co_8f3k2m9x4p1q. |
data[].company.name | string | Name as written on shipping documents. |
data[].company.country | string | null | Country the company imports into or exports from in these records. |
data[].company.shipments | integer | Number of shipment records. A count of records, not a market share: countries that publish every declaration are over-represented. |
data[].company.recorded_value_usd | number | null | Sum of the declared values of the records that have one, in US dollars. A lower bound: US bills of lading carry no value. |
data[].company.website | string | null | Bare domain, such as example.com. Often null. |
data[].contacts | object[] | People to approach, each with a verified work email. Empty when none was found. |
data[].contacts[].id | string | Person ID, such as per_4m7q2x9k1c8d. Kept for your account for 90 days after it was last returned, with the email: pass it as contact_id to add the person to a campaign. |
data[].contacts[].name | string | null | Full name. |
data[].contacts[].title | string | null | Job title. |
data[].contacts[].seniority | owner | c_level | executive | manager | senior | staff | null | Level, read from the title. |
data[].contacts[].department | purchasing | sales | management | operations | marketing | finance | engineering | quality | it | hr | legal | null | Department, read from the title. |
data[].contacts[].email | string | Work email on the company's own domain. |
data[].contacts[].email_status | verified | risky | verified: the mailbox exists. risky: the domain accepts every address, so the mailbox cannot be confirmed. |
data[].contacts[].linkedin_url | string | null | The person's LinkedIn profile, when known. |
data[].contacts[].other_email | string | null | Another email address listed for the person. Often on the company's domain too, but it can be a private address, and it is not verified. |
data[].contacts[].phones | string[] | Phone numbers listed for the person: a direct line, a mobile or the company's switchboard. Not verified. |
data[].channels | object | null | The shared mailboxes, phone numbers, messaging contacts and social pages on the company's website, when no person was found. Null when contacts has someone. |
data[].channels.emails | string[] | Shared addresses such as info@ and sales@. |
data[].channels.phones | string[] | Phone numbers the company publishes: in E.164, such as +4952112340, when the country can be told, else as printed. Fax numbers are left out. |
data[].channels.messaging | object[] | WhatsApp, WeChat, Zalo, LINE, Skype and Telegram contacts the company gives. |
data[].channels.messaging[].app | whatsapp | wechat | zalo | line | skype | telegram | |
data[].channels.messaging[].value | string | A number in E.164 for WhatsApp, else the ID or number as printed. |
data[].channels.social | object | Links to its public pages. Null where none is known. |
data[].channels.social.linkedin | string | null | |
data[].channels.social.facebook | string | null | |
data[].channels.social.twitter | string | null | |
data[].channels.social.instagram | string | null | |
data[].channels.social.youtube | string | null | |
data[].channels.social.tiktok | string | null | |
data[].channels.social.pinterest | string | null | |
total | integer | How many companies the ranked list has in all. |
has_more | boolean | Whether the ranked list goes on after the last company looked at. |
next_cursor | string | null | Pass it as cursor to go on after the last company that was looked at. |
query | object | The request as it was understood, with the default dates filled in. scanned says how many companies were looked at for this page, data_through how recent the records are. |
query.data_through | string | null | Date of the latest record this query can see, YYYY-MM-DD. Records arrive weeks after a shipment, so recent months are incomplete. |
query.scanned | integer | How many companies of the ranked list were looked at for this page. |
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 | What this call was charged, and the balance left. |
usage.cost | number | What this call cost, in US dollars. |
usage.breakdown | object[] | Every billing unit that came back, charged or not. Empty when nothing did. |
usage.breakdown[].unit | trade_record | trade_company | trade_company_profile | trade_lookup | person_email | company_channels | trade_stats | trade_official_stats | What is counted. |
usage.breakdown[].records | integer | How many were returned and charged. |
usage.breakdown[].already_paid | integer | How many more were returned for free, because this organization paid for them in the last 30 days. |
usage.breakdown[].cost | number | What they 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/leads/find \
-H "Authorization: Bearer $WON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"role": "importer",
"hs_code": "940161",
"importer_country": "US",
"limit": 2
}'{
"data": [
{
"company": {
"id": "co_8f3k2m9x4p1q",
"name": "SAMPLE NORTHFIELD HOME FURNISHINGS INC",
"country": "US",
"shipments": 1840,
"recorded_value_usd": 21480350.4,
"website": "northfield-home.example"
},
"contacts": [
{
"id": "per_4m7q2x9k1c8d",
"name": "Jordan Lee",
"title": "Director of Global Sourcing",
"seniority": "executive",
"department": "purchasing",
"email_status": "verified",
"linkedin_url": "https://www.linkedin.com/in/sample-jordan-lee",
"email": "jordan.lee@northfield-home.example"
}
],
"channels": null
},
{
"company": {
"id": "co_3d9t6w1b7n5z",
"name": "SAMPLE HARBORSIDE SEATING CO",
"country": "US",
"shipments": 962,
"recorded_value_usd": 9310772.15,
"website": "harborside-seating.example"
},
"contacts": [],
"channels": {
"emails": [
"info@harborside-seating.example",
"sales@harborside-seating.example"
],
"phones": [
"+15550100142"
],
"messaging": [
{
"app": "whatsapp",
"value": "+15550100142"
}
],
"social": {
"linkedin": "https://www.linkedin.com/company/harborside-seating",
"facebook": null,
"twitter": null,
"instagram": null,
"youtube": null,
"tiktok": null,
"pinterest": null
}
}
}
],
"total": 4087,
"has_more": true,
"next_cursor": "cur_TGVhZHMtMi4xcnpnNA",
"query": {
"role": "importer",
"hs_code": "940161",
"importer_country": "US",
"exclude_forwarders": true,
"sort": "shipments",
"since": "2025-11-01",
"until": "2026-11-20",
"min_email_status": "verified",
"contacts_per_company": 1,
"require": "any_contact",
"limit": 2,
"scanned": 2,
"data_through": "2026-11-11"
},
"notice": null,
"usage": {
"cost": 0.07,
"breakdown": [
{
"unit": "trade_company",
"records": 2,
"already_paid": 0,
"cost": 0.02
},
{
"unit": "person_email",
"records": 1,
"already_paid": 0,
"cost": 0.03
},
{
"unit": "company_channels",
"records": 1,
"already_paid": 0,
"cost": 0.02
}
],
"balance": 48.01,
"replayed": false
}
}用测试 key(won_test_...)发送这个请求,会返回同一批样例公司,不收费。