World countries, states, regions, provinces, cities & towns in JSON, SQL, XML, YAML, & CSV format.
CountryStateCity provides a REST and GraphQL API delivering geographic data covering 250+ countries, 5,300+ states and regions, and 153,800+ cities. Data is served in structured JSON, with example endpoints such as retrieving the states within a given country. The company reports over 5.1 billion total API requests, more than 50,000 developers using the service, and a 99.9% uptime figure, with sub-200ms response times.
Beyond the core API, the product suite includes an Export Tool for downloading datasets in CSV, JSON, or SQL formats, a CLI tool for searching and generating code from the geographic data, an open-source database repository available via NPM and PyPI with 12 export formats, and an Update Tool for submitting data corrections or contributions. The core database is licensed under ODbL-1.0, while the packages are MIT licensed.
The service is aimed at developers and businesses building location-aware applications, such as address forms, location pickers, or geographic analysis features, who need country, state, and city reference data without maintaining it themselves.
Yes, you can get started for free, and the Export Tool offers free and paid formats.
It covers 250+ countries, 5.3K+ states and regions, and 153.8K+ cities.
Data is accessed via authenticated REST and GraphQL endpoints, for example using an X-CSCAPI-KEY header.
Yes, the core database is ODbL-1.0 licensed and open source, while the packages are MIT licensed and available via NPM, PyPI, and CLI.
It's aimed at developers building location-aware apps, analysts, and businesses needing accurate country, state, and city data.
Show your product to thousands of developers
· 100k monthly pageviews
· 7k newsletter subscribers
Brazil RESTful API to find information about streets, zip codes, neighborhoods, cities and states.
Open APIs for select European cities.
Get your visitor's country from their IP.
API explorer that gives a query URL with a JSON response of locations and cities.
Free geo ip information, no registration required. 15k/hour rate limit.
French geographical data.