Skip to main content
This guide takes you from zero to a working cascading location picker, the most common way developers use the CSC API.
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.
Keep your key on the server. See Authentication for safe usage patterns.
2

Make your first request

Every request needs the X-CSCAPI-KEY header.
You will get back an array of countries, each with an 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

Country, state and city lists change rarely. Cache responses for at least 24 hours to stay well within your plan’s rate limits. See Errors and Rate Limits.

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.