ssh.autos

Catalog / Markets & finance

MARKETS & FINANCE

UN Comtrade Trade Flow Watch

Bilateral commodity trade flows from UN Comtrade's official free API: annual trade records per reporter, partner, HS code and year, with values, weights and quantities, per-pair aggregates…

PER CALL · X402 / MPP From $0.01 per call 1 endpoint at api.ssh.autos. Pay in USDC, no account. See the endpoint
APIFY STORE Public actor Run it with your Apify account: bulk runs, schedules and exports. Open on Apify

About this data

Bilateral commodity trade flows from UN Comtrade's official free API: annual trade records per reporter, partner, HS code and year, with values, weights and quantities, per-pair aggregates and change vs previous run. Official UN open data, no key needed. Latest published year per reporter.

From the actor’s Apify Store listing. The per-call endpoint may return a bounded subset; its own description is below.

Buy per call over x402

One endpoint at api.ssh.autos. Each call is one JSON POST, paid in USDC with no account or API key, and answered in the same HTTP response.

UN Comtrade Trade Flows

POST /v1/comtrade/trade

Annual bilateral commodity trade from UN Comtrade's official API for one reporter, partner, HS code and year: imports and exports with trade value in USD, net weight and quantity.

PRICE$0.01 per call, in USDC
RESULTUp to 10 per call
PAYMENTx402 or MPP · no account

Up to 10 records per call.

Input

Send a JSON body to POST https://api.ssh.autos/v1/comtrade/trade.

FieldTypeRequiredNotes
reporterstringrequired2–60 characters
partnerstringoptionalup to 60 characters; default "world"
cmdCodestringoptionalpattern ^\d{2,8}$; default "8517"
periodintegerrequired2010–2100
maxResultsintegeroptional1–10; default 5

Returned fields

The answer is JSON: records, a list of up to 10, and summary, the run status and counts. Each record has these 21 fields; a field the source does not publish comes back null.

21 fields per record
FieldTypeNotes
recordKeystringStable unique key: '{period}:{reporterCode}:{flowCode}:{partnerCode}:{cmdCode}:{customsCode}:{motCode}' (motCode 0 = total across transport modes).
periodstringReference year as returned by the API ('2024').
reporterCodeintegerUN numeric reporter code (Peru=604, China=156, USA=842).
reporterstringReporter name resolved from the static country list.
flowCodestringTrade flow: M=import, X=export, RX=re-export, DX=re-import (a pair's response mixes flows).
partnerCodeintegerUN numeric partner code; 0 = World aggregate.
partnerstringPartner name resolved from the static country list ('World' for 0).
cmdCodestringHS commodity code (as queried, e.g. '8517').
primaryValuenumberTrade value in current USD (FOB for exports, CIF for imports).
netWgtnumberNet weight in kg.
qtynumberQuantity in the commodity's quantity unit (see qtyUnitAbbr); often 0/-1-coded when unknown.
qtyUnitAbbrstringQuantity unit abbreviation as reported.
cifvaluenumberCIF value in USD (imports only).
fobvaluenumberFOB value in USD (exports only).
customsCodestringCustoms procedure code (C00 = total).
motCodeintegerMode-of-transport code (0 = total; 1000 sea, 2100 air, etc.).
isAggregatebooleanUN flag: row is an aggregate/estimated figure rather than directly reported.
isReportedbooleanUN flag: figure directly reported by the country.
pairKeystringWatch pair this record belongs to: '{reporterCode}:{partnerCode}:{cmdCode}:{period}'.
sourceQuerystringQuery params this record was fetched with.
collectedAtstringUTC ISO-8601 collection timestamp.

Example call

TERMINAL · $0.01 PER RUN
npx agentcash@latest fetch https://api.ssh.autos/v1/comtrade/trade -m POST -b '{"reporter": "peru", "period": 2024, "maxResults": 3}'

The example values come from the API spec or the actor’s own sample input. Running it is a paid call.

What is and isn’t charged

Free

  • Invalid input (422), busy (503), source failure (502), timeout (504) and calls whose client hung up are never charged.
  • Invalid input and source failures are not charged.

Prefer a subscription? Run it on Apify

This data source is a public actor on the Apify Store: UN Comtrade Trade Flow Watch. Run it with your Apify account and plan for larger, scheduled or exported runs; it may offer more input options than the per-call endpoint.

Open on Apify

How x402 payment works

  1. Your client sends the request. The API answers 402 Payment Required with the price and where to pay.
  2. The client pays from its own wallet: USDC on Base or Solana over x402, or over MPP on Tempo. No account, sign-up or API key.
  3. The client retries with the payment attached and gets the JSON answer in the same call. You are only charged for answers.

The AgentCash CLI in the example does all three steps for you and pays from your AgentCash wallet. Any x402 or MPP client works the same way.

Machine-readable: openapi.json · llms.txt

Some links to Apify are affiliate links. We may earn a commission if you sign up and become a paying customer.