Public APIs / Geocoding / CountryStateCity
CountryStateCity API
World countries, states, regions, provinces, cities & towns in JSON, SQL, XML, YAML, & CSV format.
Open the CountryStateCity documentation Build something with it
Key facts
- Category
- Geocoding
- Authentication
- apiKey
- HTTPS
- Yes
- CORS
- Yes
- Listed in
- public-apis
You need a free or paid API key. Keep it on a server, never in the browser.
What you could build with CountryStateCity
Geocoding APIs turn addresses into coordinates and back, and give countries, regions and IP locations.
- Address autocomplete in checkout
- Delivery zones and routing
- Store locator on your website
How we would integrate CountryStateCity
- Sign up with the provider, get a key and store it on the server in an env.php or secret store.
- Call it from the browser or from your backend, whichever keeps keys safe.
- Cache results in your own database, so pages stay fast and you stay inside rate limits.
- Add monitoring: if the API goes down or changes, you get an alert before your customers notice.
Questions about CountryStateCity
Does the CountryStateCity API need an API key?
You need a free or paid API key. Keep it on a server, never in the browser.
Can I call CountryStateCity from the browser?
Yes. It allows CORS, so a web page can call it directly from the browser.
Does CountryStateCity support HTTPS?
Yes, it is served over HTTPS.
Can you build an app with CountryStateCity for me?
Yes. FullStack Partner has developers who build and run products on APIs like this one. Send us a few lines and we reply with a plan and a fixed price.