Documentation Index Fetch the complete documentation index at: https://docs.countrystatecity.in/llms.txt
Use this file to discover all available pages before exploring further.
Retrieve all states, provinces, regions, and territories for a specific country using the country’s ISO2 code.
Path Parameters
ISO2 code of the country (e.g., “IN” for India, “US” for United States)
Authentication
Your API key for authentication
Query Parameters
Search filter on name. Case-insensitive match on name and native fields. Minimum 2 characters. Requires Supporter+ plan. Without this parameter, all results are returned (no plan restriction for search).
Response
Unique identifier for the state/province
Official name of the state/province
ISO2 code for the state/province
Unique identifier of the parent country
ISO2 code of the parent country
Approximate latitude of the state/province
Approximate longitude of the state/province
IANA timezone identifier (e.g., "Asia/Kolkata")
Additional fields like fips_code, iso3166_2, type, level, parent_id, native, population, translations, and wikiDataId are returned on higher tiers. See Tier-Based Field Availability below.
cURL
cURL (with search)
Python
JavaScript
PHP
Go
Java
Ruby
curl -X GET 'https://api.countrystatecity.in/v1/countries/IN/states' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
200 - Basic tier (Community, Starter, Legacy)
200 - Coordinates tier (Supporter) — basic plus
404 - Not Found
401 - Unauthorized
[
{
"id" : 4008 ,
"name" : "Maharashtra" ,
"iso2" : "MH" ,
"country_id" : 101 ,
"country_code" : "IN" ,
"latitude" : "19.75147980" ,
"longitude" : "75.71388840" ,
"timezone" : "Asia/Kolkata"
}
]
Common Use Cases
Validate state codes against specific countries. const validateStateForCountry = async ( countryCode , stateCode ) => {
const states = await getStatesByCountry ( countryCode );
return states . some ( state => state . iso2 === stateCode );
};
Cache states by country as they rarely change. Use this endpoint instead of filtering all states for better performance.
Tier-Based Field Availability
Tier Plans Fields Basic Community, Starter, Legacy id, name, iso2, country_id, country_code, latitude, longitude, timezoneCoordinates Supporter All Basic + fips_code, iso3166_2, type, level, parent_id, native, population Full Professional, Business All Coordinates + translations, wikiDataId
See Pricing for plan details.