API requests served · live

Every city, stacked. One request away.

The country, state and city API and open database: 250 countries, 5,300+ states and 150,000+ cities. Use the hosted API or download an offline snapshot.

REST JSON responses
GraphQL Professional and up
ODbL-1.0 open data
World
Isometric world map in columns; column height is the number of cities per grid cell
250+ countries
World
curl "https://api.countrystatecity.in/v1/countries" \
  -H "X-CSCAPI-KEY: $API_KEY"
200 OKillustrative sample · 250 results
[
  { "id": 101, "name": "India", "iso2": "IN" },
  { "id": 102, "name": "Indonesia", "iso2": "ID" },
  …
]
Example only. Click the map or pick a level to zoom.Get free API key →

Downloads across the ecosystem.

npm downloads
199,363
10 official packages · 30 days12 Oct 2026 – 10 Nov 2026
Updated npm downloads API ↗
PyPI downloads
17,941
8 official packages · 30 days12 Oct 2026 – 10 Nov 2026
Updated PyPI Stats · known mirrors excluded ↗
GitHub release downloads
66,091
Lifetime · published data-file assets
Updated GitHub database releases ↗
Sources and counting method

Downloads count file transfers, including repeat installs and automation; they are not unique developers. Package totals use the displayed UTC dates, with a short allowance for reporting lag. GitHub totals include data files from all published database releases, including prereleases, and exclude checksums, notices, migration archives, source archives, Git clones and raw-file traffic. Statistics refresh daily; provider outages retain the last successful values and their update dates. View the counts and package breakdown →

The data

Clean, linked records, from region down to city.

Every city knows its state and country. Every country carries ISO codes, currency, phone code, timezones and translations. Updated frequently by the community.

See what each level returns in the Country API, State API and City API guides, or use the data offline with the npm packages. For a working example, follow the React country, state and city dropdown guide.

Coverage varies by release. Check the API statistics and database releases for current data. Read the ODbL-1.0 licence before using the database.

JSONCSVParquetMySQLPostgreSQLSQLiteSQL ServerMongoDBXMLYAMLGeoJSONTOON
countries
states and regions
cities
12
download formatsstatic
In production

What developers build with it.

Country → state → city in onboarding
“Outstanding job on this API! The worldwide country, state, and city data is exactly what our PalGo app needed.”
Johan WalhoutDeveloper · PalGoAPI
Location for tax at checkout
“Thanks for putting together such a comprehensive location service! The tax calculation features based on user location have been essential for our payment processing.”
Mo KakwanBlabberizeAPI
Multi-country address forms
“The comprehensive state and city data makes it easy for users across different countries to fill out location information accurately.”
Cedric BorreguínDeveloperDatabase
International darts league
“The comprehensive global data has been perfect for our international darts league platform.”
Bendicht EggimannDeveloperAPI
Prayer times by location
“The location-based prayer timing functionality works perfectly with the comprehensive country, state, and city data.”
OmairDeveloperAPI
Address step in card checkout
“Excellent job with this API! The credit card processing integration with location data has been seamless and reliable.”
Douglas HuertasPayvmsAPI
Validating x509 certificate fields
“This export tool has been wonderful for our x509 certificate validation processes!”
Mike LettonaUserExport Tool
Universal address form for a client
“Thanks a lot for this database, this is awesome!”
Hiren ChauhanDeveloperDatabase
Municipalities across countries
“Your data is very complete and useful.”
GabrielDeveloper · HaydukDatabase
Location input in forms
“I'm using your data in other project and it's working just fine. Thanks!”
Guille AcostaDeveloperAPI
Cascading profile dropdowns
“The dropdown functionality for country, state, and city selection works flawlessly in our user profile system.”
Manish RajDeveloperAPI
Student address collection
“This API is really a big help, this is exactly what I was searching for.”
Vishal RanaStudent · NIT RourkelaAPI

Free to start. Open forever.

The database is open under ODbL-1.0. The API gives you 3,000 free requests a month; paid plans start at $5 and add search, GraphQL and the change feed.

Found a missing city or a wrong state code? Suggest a fix with the Update Tool; it's reviewed and merged into the next release.
Reviewed in the open · public releases