{"uid":"cap_KT9QylRwGST8FG2wlZQAz","slug":"duo-data-utilities-country-lookup-1f9beb27","name":"Duo Data Utilities – Country Lookup","description":"Look up a country or territory by ISO 3166-1 alpha-2, alpha-3 or numeric code, or by name, and get the other codes, the official and common English names, the UN M49 region and sub-region, the currencies in use, the country-code top-level domain, and optionally the full ISO 3166-2 subdivision list with each subdivision's type. Also resolves an ISO 3166-2 subdivision code such as NL-NH directly. Names are matched case- and accent-insensitively.","url":"https://api.duoleads.com/v1/ref/country?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":[],"properties":{"code":{"type":"string","maxLength":16,"description":"ISO 3166-1 alpha-2, alpha-3 or numeric code, or an ISO 3166-2 subdivision code such as NL-NH."},"name":{"type":"string","maxLength":128,"description":"Substring search on country names, case- and accent-insensitive."},"include":{"type":"string","default":"m49,currency,tld","maxLength":64,"description":"Comma-separated: subdivisions, m49, currency, tld. Default m49,currency,tld."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","route","version","data","meta"],"properties":{"ok":{"const":true},"data":{"type":"object","required":["found"],"properties":{"m49":{"type":"object","required":["region","region_name","subregion","subregion_name","intermediate","intermediate_name"],"properties":{"region":{"type":["string","null"]},"subregion":{"type":["string","null"]},"region_name":{"type":["string","null"]},"intermediate":{"type":["string","null"]},"subregion_name":{"type":["string","null"]},"intermediate_name":{"type":["string","null"]}}},"tld":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"name":{"type":"string"},"found":{"type":"boolean"},"alpha_2":{"type":"string"},"alpha_3":{"type":"string"},"matches":{"type":"array","items":{"type":"object","required":["alpha_2","alpha_3","numeric","name"],"properties":{"name":{"type":"string"},"alpha_2":{"type":"string"},"alpha_3":{"type":"string"},"numeric":{"type":"string"}}}},"numeric":{"type":"string"},"currencies":{"type":"array","items":{"type":"string"}},"subdivision":{"type":"object","required":["code","name","type","parent"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"parent":{"type":["string","null"]}}},"subdivisions":{"type":"array","items":{"type":"object","required":["code","name","type","parent"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"parent":{"type":["string","null"]}}}},"official_name":{"type":"string"},"total_matches":{"type":"integer"},"subdivision_count":{"type":"integer"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array"},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/ref/country"},"version":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"m49":{"region":"150","subregion":"155","region_name":"Europe","intermediate":null,"subregion_name":"Western Europe","intermediate_name":null},"tld":[".nl"],"kind":"country","name":"Netherlands","found":true,"alpha_2":"NL","alpha_3":"NLD","numeric":"528","currencies":["EUR"],"official_name":"Netherlands"},"meta":{"sources":[{"id":"iso-codes","licence":"LGPL-2.1-or-later","version":"Debian iso-codes data/iso_3166-2.json, retrieved 2026-09-28","published":"2026-09-28","attribution":"ISO 3166-2 subdivision data from Debian iso-codes (https://salsa.debian.org/iso-codes-team/iso-codes), (c) 2016 Dr. Tobias Quathamer, LGPL-2.1-or-later"},{"id":"country-codes","licence":"PDDL-1.0","version":"datasets/country-codes, retrieved 2026-09-28","published":"2026-09-28","attribution":"Open Knowledge Foundation datasets/country-codes (ISO 3166-1 codes)"},{"id":"cldr","licence":"Unicode-3.0","version":"48.2.2","published":"2026-09-28","attribution":"Unicode CLDR, © Unicode, Inc."}],"price_usd":"0.05","disclaimer":"Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms","request_id":"01K6B7Q4ZC8H3F2M9WXR5TYN0D","computed_at":"2026-09-28T12:00:00.000Z","deterministic":true},"route":"/v1/ref/country","version":"1.0.0"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_z9Feoqz4vnPW82v4adeho","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Look up a country or territory by ISO 3166-1 code or name and return all codes, the English name, UN M49 region/sub-region, currencies, and ccTLD.","exampleAgentPrompt":"What's the ISO 3166 alpha-3 code, numeric code, UN M49 region, currencies, and ccTLD for 'Netherlands'? Look it up by name.","exampleUseCases":[{"title":"Currency lookup for checkout flow","prompt":"I'm building a checkout form and need to know what currency is used in Japan — can you look it up by country name and give me the ISO currency code?"},{"title":"ccTLD resolution for domain registration","prompt":"I want to register a local domain for Brazil — what's Brazil's country-code top-level domain? Look it up by its ISO alpha-2 code 'BR'."},{"title":"Normalize country codes in a dataset","prompt":"I have a dataset with entries using the 3-letter code 'DEU' — can you resolve that to the alpha-2 code, numeric code, and confirm the official country name for me?"}],"resultDescription":"A JSON object containing the matched country's alpha-2, alpha-3, and numeric ISO codes; official English name; UN M49 region and sub-region names and codes; list of currencies in use; and country-code top-level domain (ccTLD). Also includes metadata: request ID, computation timestamp, price, and data source attributions.","failureModes":["Country not found for the given code or name substring — returns found: false","Ambiguous name substring matching multiple countries — may return unexpected result or require more specific input","Invalid or malformed code format — may return error or no match","Network timeout or service unavailability — HTTP 5xx error","Missing required query parameter (no code or name provided) — HTTP 4xx error"],"whenToPreferThis":"Choose this endpoint when you need authoritative, multi-standard country reference data in a single call — especially when you need to cross-reference ISO 3166-1 codes (alpha-2, alpha-3, numeric), UN M49 regions, currencies, and ccTLDs together. Prefer it over manual lookups or general-purpose LLM knowledge when accuracy, up-to-date sourcing, and structured output are required. It supports both code-based and name-based (case/accent-insensitive substring) lookups, making it flexible for data normalization pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:45:54.344Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-country-lookup-1f9beb27"}