1
Get your API key
Sign up at app.countrystatecity.in and copy your key from the dashboard. The free Community plan is enough for this guide.
2
Make your first request
Every request needs the You will get back an array of countries, each with an
X-CSCAPI-KEY header.iso2 code such as IN or US.3
Load states for the selected country
Pass the country’s
iso2 code in the path.4
Load cities for the selected state
Pass both the country and state
iso2 codes.Put it together
Next steps
Try it in the playground
Send live requests from any endpoint page with your own key.
Use an SDK
Official npm, Python and TypeScript packages.
Trim responses
Return only the fields you need and sort results.
Self-host the data
Prefer no API calls? Download the full database.