Every country, in one endpoint.
A REST endpoint for every sovereign state and dependent territory, with ISO 3166-1 codes, dial codes, currencies, capitals, regions and coordinates. JSON over REST, with GraphQL on eligible paid plans. The free tier needs no card.
Coverage varies by release. Check the API statistics and database releases for current data. Read the ODbL-1.0 licence before using the database.
curl --location 'https://api.countrystatecity.in/v1/countries/IN' \ --header 'X-CSCAPI-KEY: YOUR_API_KEY'Community response excerpt
{
"id": 101,
"name": "India",
"iso2": "IN",
"iso3": "IND",
"phonecode": "91",
"capital": "New Delhi",
"currency": "INR",
"latitude": "20.00000000",
"longitude": "77.00000000"
}Endpoints
These endpoints are served from https://api.countrystatecity.in/v1 and require your key in the X-CSCAPI-KEY header. Availability depends on your plan.
Available fields for country records.
Fields depend on your plan and may be missing or null. On eligible plans, select fields with ?fields=. Compare plan access.
idStable numeric identifiernameEnglish nameiso2ISO 3166-1 alpha-2iso3ISO 3166-1 alpha-3numeric_codeISO 3166-1 numericphonecodeInternational dial codecapitalCapital citycurrencyISO 4217 codecurrency_nameCurrency in wordscurrency_symbolDisplay symboltldCountry-code top-level domainnationalityDemonymnativeName in the local scriptregionUN regionsubregionUN subregiontimezonesPublished timezone entries, when availablelatitudeCentroid latitudelongitudeCentroid longitudeemojiFlag emojiemojiUFlag emoji code pointspopulationWhen available; may be nullgdpWhen available; may be nullarea_sq_kmLand areapostal_code_formatExpected postcode shapepostal_code_regexValidation patterntranslationsName in other languageswikiDataIdWikidata itemWhat people build with it.
- Country dropdowns in a signup or checkout form, with flags and dial codes already attached.
- Validating a shipping address against the right postcode pattern before you call a carrier.
- Converting between ISO2, ISO3 and numeric codes when two systems disagree.
- Routing or pricing by UN region and subregion rather than by a hand-kept list.
Questions.
Is the country API free?
Community includes 3,000 requests per calendar month and 100 per day with basic fields, an API key and no card. Paid plans add higher limits, extra fields and endpoints. GraphQL and field selection depend on your plan; compare the current plans for availability.
How many countries does it return?
250 country and territory records. Check the countries endpoint for the current entries and codes. Coverage and downloadable snapshots can differ by release.
Can I get the data offline instead of over HTTP?
Yes. The same dataset is published as SQL, JSON, CSV, XML and more through the export tool and the open-source database, so you can ship it inside your application.
How often does the country data change?
Maintainers publish corrections to the underlying dataset and API. The /changes feed supports incremental syncing on eligible plans; check the current documentation for availability and retention.
Free up to 3,000 requests a month.
Paid plans from $5 add higher limits. Supporter adds fuzzy search; Professional adds GraphQL and the change feed.