{"uid":"cap_ZJc6TfC32NG-56aPx0zLv","slug":"un-locode-search-08f9b18b","name":"UN/LOCODE Search","description":"Search UN/LOCODEs by place name, optionally within a country or by port, rail, airport function; capped at 50.","url":"https://trade-reference.x402tookit.com/locode-search?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["q"],"properties":{"q":{"type":"string","description":"Place name or start of it, e.g. Rotterdam, Los Angeles or Felix"},"limit":{"type":"integer","description":"Results 1 to 50 (default 10)"},"country":{"type":"string","description":"ISO 3166 code or country name to restrict to"},"function":{"type":"string","description":"port, rail, airport, multimodal or border"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"query":{"type":["null","object"],"properties":{"q":{"type":["null","string"]},"country":{},"function":{"type":["null","string"]}}},"source":{"type":["null","string"]},"matches":{"type":["array","null"],"items":{"type":"object","properties":{"lat":{"type":["null","number"]},"lon":{"type":["null","number"]},"iata":{},"name":{"type":["null","string"]},"isPort":{"type":["boolean","null"]},"isRail":{"type":["boolean","null"]},"locode":{"type":["null","string"]},"status":{"type":["null","string"]},"country":{"type":["null","string"]},"approved":{"type":["boolean","null"]},"asciiName":{"type":["null","string"]},"functions":{"type":["array","null"],"items":{"type":"string"}},"isAirport":{"type":["boolean","null"]},"matchScore":{"type":["null","number"]},"countryCode":{"type":["null","string"]},"subdivision":{"type":["null","string"]},"locationCode":{"type":["null","string"]},"functionCodes":{"type":["null","string"]},"statusMeaning":{"type":["null","string"]}}}},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"truncated":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"attribution":{"type":["null","string"]},"totalMatches":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_jNpmfgYw2E9FvveNjYTI_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Search UN/LOCODE location codes by place name, with optional filters for country and transport function (port, rail, airport, etc.), returning up to 50 matches.","exampleAgentPrompt":"Can you find the UN/LOCODE for Rotterdam — specifically for port functions — and give me up to 5 results?","exampleUseCases":[{"title":"Validate port code for shipping document","prompt":"I need to fill in the UN/LOCODE for the port of Hamburg on a customs form — can you look it up and confirm it's an approved port code?"},{"title":"Find airport codes in Japan","prompt":"Search UN/LOCODEs for airports in Japan matching 'Tokyo' and give me up to 10 results so I can pick the right one for our air freight shipment."},{"title":"Identify border crossing locations in Mexico","prompt":"Can you search for UN/LOCODE border crossing locations in Mexico with 'Laredo' in the name? I need the codes and coordinates for our trade compliance records."}],"resultDescription":"A JSON object containing a list of matching UN/LOCODE entries (up to 50), each with the LOCODE itself, place name, ASCII name, country, country code, subdivision, latitude/longitude, transport function flags (isPort, isRail, isAirport), function codes, approval status, status meaning, IATA code if applicable, and a match relevance score. Also includes query metadata, data source, and a summary verdict.","failureModes":["No matches found for the query — returns empty matches array","Query parameter 'q' missing — returns validation error","Country filter not recognized — may return no results or error","Limit exceeds 50 — capped or rejected","Service temporarily degraded — response may include degraded flag with partial results"],"whenToPreferThis":"Use this endpoint when you need to resolve, validate, or discover UN/LOCODE location codes for trade and logistics purposes — especially when filtering by country or transport function (port, rail, airport, border). Prefer it over general geocoding APIs when the output must be an official UN trade location code with function metadata and approval status.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T18:39:41.028Z","isFirstParty":false,"canonicalSlug":"un-locode-search-08f9b18b"}