trade

Look up or search UN/LOCODE - the United Nations Code for...

Look up or search UN/LOCODE — the United Nations Code for Trade and Transport Locations (~116k locations, all countries). Pass locode for an exact code (e.g. USNYC or 'US NYC'). Or pass query to search location names, optionally filtered by country (ISO 3166 alpha-2) and function (port, rail, road, airport, postal, multimodal, fixed, border). Each result: locode, name, country, subdivision, transport functions, entry status, IATA code where it differs, and coordinates. UN/LOCODE is the standard location identifier in shipping schedules, EDI messages, and customs documents.

get/api/trade/locode

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/trade/locode
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

locodestring

Exact UN/LOCODE to look up (e.g. USNYC or 'US NYC'). Pass this OR query.

querystring

Location name to search (e.g. Rotterdam). Pass this OR locode.

countrystring

Restrict query-mode results to one country (ISO 3166 alpha-2, e.g. NL).

function'port' | 'rail' | 'road' | 'airport' | 'postal' | 'multimodal' | 'fixed' | 'border'

Restrict query-mode results to locations with this transport function.

limitinteger

Max query-mode results, 1–50 (default 10).

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.