Countries API
The Countries API gives you a complete, normalized reference dataset for ~250 countries and territories behind a single, blazing-fast endpoint. Look up any country by ISO code (cca2, cca3, ccn3 or IOC/cioc), search by name with smart ranking, or filter the whole world by region, currency, language, or international dialing code.
Responses come back as clean JSON in milliseconds. There are no upstream third-party calls and no surprise rate limits because the entire dataset is bundled and served straight from Cloudflare's edge. Every country is enriched with ready-to-render flag image URLs (PNG + SVG) and a normalized array of full international calling codes.
Free tier · no credit card · billed on RapidAPI
Key features
- Resolve a country by cca2, cca3, ccn3 or cioc code
- Ranked name search (exact > prefix > substring)
- Filter by region, currency, language or calling code
- Ready-to-use flag image URLs in PNG and SVG
- Normalized international calling_codes array
- Field projection via ?fields= to pull only what you render
- Bundled offline dataset, no upstream dependencies
Perfect for
- Country pickers and phone-number forms
- Checkout and address flows
- Rendering flags in dashboards and tables
- Localizing apps by region or language
- Currency and Eurozone lookups
- Mapping dialing codes to countries
- Data enrichment pipelines
- Geographic analytics and reporting
Countries API Documentation
Everything you need to integrate — base URL, auth, and copy-paste examples.
The Countries API is a fast, offline-grade reference for ~250 countries and territories. Resolve a single country by ISO code (cca2/cca3/ccn3/cioc), search by name with ranked results, or filter the full dataset by region, currency, language or international calling code. Every country is enriched with flag image URLs (flag_png, flag_svg) and a normalized calling_codes array.
Base URL
https://edge-apis.e9736.workers.devAuthentication
Authenticate by passing your API key as the ?apikey= query parameter on every request:
https://edge-apis.e9736.workers.dev/countries/v1/code/AW?apikey=YOUR_KEYRequest & response
GET /countries/v1/code/AW?apikey=YOUR_KEY HTTP/1.1{
"country": {
"name_common": "Aruba",
"name_official": "Aruba",
"cca2": "AW",
"cca3": "ABW",
"ccn3": "533",
"cioc": "ARU",
"region": "Americas",
"subregion": "Caribbean",
"capital": ["Oranjestad"],
"currencies": { "AWG": { "name": "Aruban florin", "symbol": "ƒ" } },
"idd": { "root": "+2", "suffixes": ["97"] },
"languages": { "nld": "Dutch", "pap": "Papiamento" },
"latlng": [12.5, -69.97],
"area": 180,
"borders": [],
"tld": [".aw"],
"flag_emoji": "🇦🇼",
"demonyms": { "f": "Aruban", "m": "Aruban" },
"landlocked": false,
"independent": false,
"unMember": false,
"altSpellings": ["AW"],
"flag_png": "https://flagcdn.com/w320/aw.png",
"flag_svg": "https://flagcdn.com/aw.svg",
"calling_codes": ["+297"]
}
}Code examples
curl --request GET \
--url 'https://edge-apis.e9736.workers.dev/countries/v1/code/AW?apikey=YOUR_KEY'Available Endpoints
GET /countries/v1/all
List every country (enriched). Optionally filter by region, project a subset of fields, and cap results with limit (default 300).
/countries/v1/all?region=Oceania&fields=name_common,cca2,calling_codes&apikey=YOUR_KEYGET /countries/v1/code/{code}
Resolve one country by cca2, cca3, ccn3 or cioc, tried in that order, case-insensitive.
/countries/v1/code/AW?apikey=YOUR_KEYGET /countries/v1/search
Partial, case-insensitive name search over name_common, name_official and altSpellings. Ranked exact > prefix > substring.
/countries/v1/search?name=united&apikey=YOUR_KEYGET /countries/v1/region/{region}
List countries in a region: Africa, Americas, Asia, Europe, Oceania or Antarctic (case-insensitive).
/countries/v1/region/Europe?apikey=YOUR_KEYGET /countries/v1/currency/{code}
List countries using an ISO 4217 currency code (case-insensitive).
/countries/v1/currency/EUR?apikey=YOUR_KEYGET /countries/v1/language/{code}
List countries with an ISO 639-3 language code (case-insensitive).
/countries/v1/language/eng?apikey=YOUR_KEYGET /countries/v1/calling-code/{code}
List countries by international calling code, with or without a leading '+'. Resolves shared roots (+1 -> US, CA) and specific codes (+297 -> Aruba).
/countries/v1/calling-code/1?apikey=YOUR_KEYQuery Parameters
Required Parameters
apikey- Your API key, passed as a query parameter on every request.name- Name substring to search for (required on /search).code- Path value: ISO code, currency code, language code, or calling code depending on the endpoint.region- Path value on /region: Africa, Americas, Asia, Europe, Oceania or Antarctic.
Optional Parameters
fields- Comma-separated field names to project, e.g. name_common,cca2,calling_codes (on /all).region- Filter /all results by region (case-insensitive).limit- Max results, clamped 1..500. Default 300 for list endpoints, 50 for /search.
Countries API Pricing
Choose the right plan for your countries reference needs with flexible pricing and no hidden fees. Every tier includes all endpoints and flag-URL plus calling-code enrichment.
Basic
- All endpoints included
- Flag PNG/SVG URLs
- Normalized calling codes
- 3 req/s rate limit
Pro
- All endpoints included
- Flag PNG/SVG URLs
- 20 req/s rate limit
- $0.20 / 1k overage
Ultra
- All endpoints included
- Flag PNG/SVG URLs
- 100 req/s rate limit
- $0.10 / 1k overage
Need higher volume or a custom SLA?
Talk to us about enterprise rates, dedicated support, and compliance docs.
Frequently asked questions
Pass your API key as the apikey query parameter on every request, for example /countries/v1/code/AW?apikey=YOUR_KEY. There are no special headers required for the direct Worker endpoint. When subscribing through RapidAPI, you instead send the standard X-RapidAPI-Key header that RapidAPI provides.
The /countries/v1/code/{code} endpoint resolves a country by cca2 (two-letter, e.g. AW), cca3 (three-letter, e.g. ABW), ccn3 (numeric, e.g. 533) or cioc (IOC, e.g. ARU). It tries those formats in that order and matches case-insensitively, so you can pass user input directly. If no country matches, the API returns a 404 with an error message.
Every country object is enriched with two ready-to-use flag image URLs: flag_png (a 320px PNG hosted on flagcdn.com) and flag_svg (a scalable vector version). You can use these directly in an img tag without hosting any assets yourself. A flag_emoji field is also included for text-based rendering.
The calling_codes array contains clean, full international dialing codes such as ['+297']. North American Numbering Plan members like the US and Canada collapse to a single ['+1'] instead of listing hundreds of area codes, and code-less territories like Antarctica return an empty array. The /countries/v1/calling-code/{code} endpoint resolves both shared roots (+1 returns US and CA) and specific codes (+297 returns Aruba), with or without a leading plus.
Yes. The /countries/v1/all endpoint supports a ?fields= parameter that projects only the comma-separated fields you specify, for example name_common,cca2,flag_svg. All list endpoints also accept a ?limit= parameter clamped between 1 and 500 (default 300 for lists, 50 for search), so you can keep payloads small and fast for UI components like country pickers.
The entire ~250-country dataset is bundled and served from Cloudflare's edge, so lookups resolve locally without any upstream third-party calls. That delivers predictable single-digit to low-tens-of-milliseconds latency worldwide, no third-party rate-limit risk, and consistent availability backed by a 99.9% uptime target. Because country reference data changes rarely, responses are also highly cacheable on your side.
Region filtering accepts Africa, Americas, Asia, Europe, Oceania or Antarctic (case-insensitive) via /countries/v1/region/{region} or the region query parameter on /all. Currency filtering uses ISO 4217 codes such as EUR via /countries/v1/currency/{code}, and language filtering uses ISO 639-3 codes such as eng via /countries/v1/language/{code}.
Related APIs & tools
Other services that pair well — all on the same key.
DNS Lookup API
Query DNS records with support for all record types and reverse lookups, returning structured JSON responses.
Learn more→Whois API
Retrieve domain registration information, ownership details, expiration dates and registrar data for any domain.
Learn more→SERP API
Extract structured data from search engine results pages across multiple engines and device types.
Learn more→Every week you build in-house is a week you don't ship product
2,500+ teams already made the switch. Start with a free tier today, or talk to us about your enterprise needs.
For developers
Free tier, no credit card. Integrate your first API in under 30 minutes.
Get API keys freeRead the docsFor teams and enterprise
Custom volumes, SLA guarantees, dedicated support, and compliance documentation.
Talk to salesor email sales@apicodex.io