Skip to Content
Won.dev
DocumentationAPI reference

Quickstart

Make your first calls in five minutes with a free test key. Find a product's buyers and the person to write to, see what a live call costs, then go live.

This page takes you from no key to a ranked list of buyers and the person to write to at one of them. Every call runs with a test key, which returns sample data and is never charged, so you can follow it before you add any money.

You need a Won.dev account and curl. Sign in with Google or an emailed code; a new account comes with $1 of free calls and needs no card.

1. Create a test key

In the console, open API keys, choose Create key and pick Test. The key is shown once: keep it in an environment variable, never in code that runs in a browser.

export WON_API_KEY=won_test_...

A test key has every endpoint of a live key, with the same parameters, checks and response shapes. See Testing.

2. Find the HS code of your product

Customs records are searched by HS code, the number customs gives each kind of goods. Look it up from a plain name. This call is free with any key.

curl "https://api.won.dev/v1/trade/hs-codes?q=sofa&limit=2" \
  -H "Authorization: Bearer $WON_API_KEY"
{
  "data": [
    {
      "code": "940161",
      "description": "Seats (other than those of heading 9402), whether or not convertible into beds, and parts thereof > Other seats, with wooden frames > Upholstered",
      "parent": "9401"
    },
    {
      "code": "940171",
      "description": "Seats (other than those of heading 9402), whether or not convertible into beds, and parts thereof > Other seats, with metal frames > Upholstered",
      "parent": "9401"
    }
  ],
  "query": { "q": "sofa", "limit": 2 },
  "notice": null,
  "usage": { "cost": 0, "balance": 1, "replayed": false }
}

940161 is upholstered seats with a wooden frame. The next calls use it.

3. See what the search would cost

Add dry_run: true to any paid call: nothing runs, nothing is charged, and the answer says the most the call can cost.

curl https://api.won.dev/v1/trade/companies/search \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "role": "importer", "hs_code": "940161", "importer_country": "US", "limit": 10, "dry_run": true }'

The answer, cut to data:

{
  "data": {
    "dry_run": true,
    "max_cost": 0.1,
    "breakdown": [
      { "unit": "trade_company", "max_records": 10, "unit_price": 0.01, "max_cost": 0.1 }
    ]
  }
}

With a live key, ten buyers cost at most $0.10. To hold a call to a price, send max_cost with it: a call that could cost more is refused before it runs. See Pricing and billing.

4. Rank the buyers

Send the same request without dry_run. Here it asks for two:

curl https://api.won.dev/v1/trade/companies/search \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "role": "importer", "hs_code": "940161", "importer_country": "US", "limit": 2 }'
{
  "data": [
    {
      "id": "co_8f3k2m9x4p1q",
      "name": "SAMPLE NORTHFIELD HOME FURNISHINGS INC",
      "role": "importer",
      "country": "US",
      "shipments": 1840,
      "recorded_value_usd": 21480350.4,
      "website": "northfield-home.example",
      "sample_product": "UPHOLSTERED SOFA WITH WOODEN FRAME, FABRIC COVER"
    },
    {
      "id": "co_3d9t6w1b7n5z",
      "name": "SAMPLE HARBORSIDE SEATING CO",
      "role": "importer",
      "country": "US",
      "shipments": 962,
      "recorded_value_usd": 9310772.15,
      "website": "harborside-seating.example",
      "sample_product": "RECLINER SOFA SET, LEATHER, 3 SEATER"
    }
  ],
  "total": 4,
  "has_more": true,
  "next_cursor": "cur_Zx81kQp4b2JtMW0uMXJ6ZzQ",
  "query": {
    "role": "importer",
    "hs_code": "940161",
    "importer_country": "US",
    "exclude_forwarders": true,
    "sort": "shipments",
    "since": "2025-11-01",
    "until": "2026-11-20",
    "data_through": "2026-11-11"
  },
  "notice": "Sample data: this is a test key. It returns the same made-up examples whatever you ask, and nothing is charged. Use a live key for real records.",
  "usage": {
    "unit": "trade_company",
    "records": 2,
    "already_paid": 0,
    "cost": 0,
    "balance": 1,
    "replayed": false
  }
}

Every answer has these fields in this order. query is the request as it was understood, with the default dates filled in. notice says what to know about this answer, here that it is sample data. usage says what the call cost: records: 2 would be $0.02 with a live key, and cost is 0 with a test key. See Responses.

5. Find the person to write to

Pass a company's id to find the people to approach there, each with a work email that was checked before it was returned.

curl "https://api.won.dev/v1/trade/companies/co_8f3k2m9x4p1q/contacts?department=purchasing&limit=1" \
  -H "Authorization: Bearer $WON_API_KEY"

The answer, cut to data:

{
  "data": [
    {
      "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"
    }
  ]
}

With a live key, each contact costs $0.03. Keep the per_ ID: a campaign takes it as contact_id in place of the address.

6. Go live

Create a key in Live mode on the same page, and give it a budget: the most it may ever spend. Swap it in for the test key and run steps 3 to 5 again. Nothing else changes: the calls now return real companies and people, and spend the balance. An empty answer and a failed call cost nothing.

export WON_API_KEY=won_live_...

When the free calls run out, top up on the Billing page of the console. See Authentication for budgets and what a key may do.

Where to next

To do thisRead
Find buyers abroad and send them a sequence, end to endFind buyers abroad and email them
Fill in companies and people you already haveEnrich your own list
Give an AI assistant the same calls as toolsMCP server
Know what each result costs and cap what a key can spendPricing and billing
Handle every error by its codeErrors
Read every parameter of the search you just madeFind buyers or suppliers

Last updated on

On this page