Welcome
Welcome to the Country State City API, your go-to resource for accessing
comprehensive data on countries, states, and cities worldwide. Our API, built on
Laravel and powered by the open-source database provided by Darshan Gada, offers developers a hassle-free solution
for integrating location-based functionalities into their applications.
About API
This API provides developers with easy access to accurate information about countries,
states,
and cities. With just a few API calls, you can retrieve a wealth of geographical data,
including:
Regions
Subregions
Countries
States
Cities
Regions
Get details about regions, including id, names, translations, and wikiDataId.
Get All Regions:
Get a list of all regions
Method: GET
Path: /api/regions
Example: /api/regions
Response:
{
"status": 200,
"regions":[
{
"id": 1,
"name": "Africa",
"translations": "{\"kr\":\"아프리카\",\"pt-BR\":\"África\",\"pt\":\"África\",\"nl\":\"Afrika\",\"hr\":\"Afrika\",\"fa\":\"آفریقا\",\"de\":\"Afrika\",\"es\":\"África\",\"fr\":\"Afrique\",\"ja\":\"アフリカ\",\"it\":\"Africa\",\"cn\":\"非洲\",\"tr\":\"Afrika\"}",
"wikiDataId": "Q15",
},
{
...
}
],
}
Subregions
Get details about subregions, including is names, region_id, translations and wikiDataId.
Get All Subregions:
Get a list of all subregions
Method: GET
Path: /api/subregions
Example: /api/subregions
Response:
{
"status": 200,
"subregions":[
{
"id": 1,
"name": "Afghanistan",
"translations": "{\"korean\":\"서아프리카\",\"portuguese\":\"África Ocidental\",\"dutch\":\"West-Afrika\",\"croatian\":\"Zapadna Afrika\",\"persian\":\"غرب آفریقا\",\"german\":\"Westafrika\",\"spanish\":\"África Occidental\",\"french\":\"Afrique de l'Ouest\",\"japanese\":\"西アフリカ\",\"italian\":\"Africa occidentale\",\"chinese\":\"西非\"}",
"region_id": 1,
"wikiDataId": "Q889",
},
{
...
}
],
}
Get Subregion By Region Id:
Get all subregions that comes under provided region id
Method: GET
Path: /api/subregions
Parameters: regionId
Example: /api/subregions?regionId=1
Response:
{
"status": 200,
"subregions":[
{
"id": 1,
"name": "Afghanistan",
"translations": "{\"korean\":\"서아프리카\",\"portuguese\":\"África Ocidental\",\"dutch\":\"West-Afrika\",\"croatian\":\"Zapadna Afrika\",\"persian\":\"غرب آفریقا\",\"german\":\"Westafrika\",\"spanish\":\"África Occidental\",\"french\":\"Afrique de l'Ouest\",\"japanese\":\"西アフリカ\",\"italian\":\"Africa occidentale\",\"chinese\":\"西非\"}",
"region_id": 1,
"wikiDataId": "Q889",
},
{
...
}
],
}
Countries
Get details about countries, including names, ISO codes, translations, etc.
Get All Countries:
Get a list of all countries
Method: GET
Path: /api/countries
Example: /api/countries
Response:
{
"status": 200,
"countries":[
{
"id": 1,
"status": "Afghanistan",
"iso3": AFG,
"numeric_code": "004",
"iso2": "AF",
"phonecode": "93",
"capital": "Kabul",
"currency": "AFN",
"currency_name": "Afghan afghani",
"currency_symbol": "؋",
"tld": ".af",
"native": "افغانستان",
"region": "Asia",
"region_id": 3,
"subregion": "Southern Asia",
"subregion_id": 14,
"nationality": "Afghan",
"timezones": "[{\"zoneName\":\"Asia/Kabul\",\"gmtOffset\":16200,\"gmtOffsetName\":\"UTC+04:30\",\"abbreviation\":\"AFT\",\"tzName\":\"Afghanistan Time\"}]",
"translations": "{\"kr\":\"아프가니스탄\",\"pt-BR\":\"Afeganistão\",\"pt\":\"Afeganistão\",\"nl\":\"Afghanistan\",\"hr\":\"Afganistan\",\"fa\":\"افغانستان\",\"de\":\"Afghanistan\",\"es\":\"Afganistán\",\"fr\":\"Afghanistan\",\"ja\":\"アフガニスタン\",\"it\":\"Afghanistan\",\"cn\":\"阿富汗\",\"tr\":\"Afganistan\"}",
"latitude": "33.00000000",
"longitude": "65.00000000",
"emoji": "🇦🇫",
"emojiU": "U+1F1E6 U+1F1EB",
"wikiDataId": "Q889",
},
{
...
}
],
}
Get Country By Id:
Get single country by id
Method: GET
Path: /api/countries
Parameters: id
Example: /api/countries?id=1
Response:
{
"status": 200,
"country":{
"id": 1,
"status": "Afghanistan",
"iso3": AFG,
"numeric_code": "004",
"iso2": "AF",
"phonecode": "93",
"capital": "Kabul",
"currency": "AFN",
"currency_name": "Afghan afghani",
"currency_symbol": "؋",
"tld": ".af",
"native": "افغانستان",
"region": "Asia",
"region_id": 3,
"subregion": "Southern Asia",
"subregion_id": 14,
"nationality": "Afghan",
"timezones": "[{\"zoneName\":\"Asia/Kabul\",\"gmtOffset\":16200,\"gmtOffsetName\":\"UTC+04:30\",\"abbreviation\":\"AFT\",\"tzName\":\"Afghanistan Time\"}]",
"translations": "{\"kr\":\"아프가니스탄\",\"pt-BR\":\"Afeganistão\",\"pt\":\"Afeganistão\",\"nl\":\"Afghanistan\",\"hr\":\"Afganistan\",\"fa\":\"افغانستان\",\"de\":\"Afghanistan\",\"es\":\"Afganistán\",\"fr\":\"Afghanistan\",\"ja\":\"アフガニスタン\",\"it\":\"Afghanistan\",\"cn\":\"阿富汗\",\"tr\":\"Afganistan\"}",
"latitude": "33.00000000",
"longitude": "65.00000000",
"emoji": "🇦🇫",
"emojiU": "U+1F1E6 U+1F1EB",
"wikiDataId": "Q889",
},
}
States
Get a list of states by country, including names, country_id, country_code, type, etc.
Get States By Country Id :
Get a list of all states by country id
Method: GET
Path: /api/states/{countryId}
Example: /api/countries/101
Response:
{
"status": 200,
"states":[
{
"id": 1,
"name": "Andaman and Nicobar Islands",
"country_id": 101,
"country_code": "IN",
"fips_code": "01",
"iso2": "AF",
"type": "Union territory",
"latitude": "11.74008670",
"longitude": "92.65864010",
"wikiDataId": "Q889",
},
{
...
}
],
}
City
Get list of all cities in a state, including names, state_id, state_code, country_id, etc.
Get All Cities:
Get a list of all cities
Method: GET
Path: /api/cities
Example: /api/cities/4008
Response:
{
"status": 200,
"countries":[
{
"id": 1,
"name": "Andaman and Nicobar Islands",
"state_id": 4008,
"state_code": "MH",
"country_id": 101,
"country_code": "IN",
"latitude": "21.25665000",
"longitude": "77.51006000",
"wikiDataId": "Q490886",
},
{
...
}
],
}
Get Cities by Country:
Get a list of all cities in a country
Method: GET
Path: /api/citiesByCountry/{countryId}
Example: /api/citiesByCountry/101
Response:
{
"status": 200,
"cities":[
{
"id": 1,
"name": "Andaman and Nicobar Islands",
"state_id": 4008,
"state_code": "MH",
"country_id": 101,
"country_code": "IN",
"latitude": "21.25665000",
"longitude": "77.51006000",
"wikiDataId": "Q490886",
},
{
...
}
],
"next_page_url": "http://127.0.0.1:8000/api/citiesByCountry/101?page=2",
"path": "http://127.0.0.1:8000/api/citiesByCountry/101",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 4210
}
Get Cities by Country with search:
Get a list of all cities in a country with search max limit 10 cities
Method: GET
Path: /api/citiesByCountry/{countryId}/search/{search}
Example: /api/citiesByCountry/101/search/nashik
Response:
{
"status": 200,
"cities":[
{
"id": 1,
"name": "Nashik",
"state_id": 4008,
"state_code": "MH",
"country_id": 101,
"country_code": "IN",
"latitude": "21.25665000",
"longitude": "77.51006000",
"wikiDataId": "Q490886",
"state": {
"id": 4008,
"name": "Maharashtra",
"country_id": 101,
"country_code": "IN",
"fips_code": "16",
"iso2": "MH",
"type": "state",
"latitude": "19.75147980",
"longitude": "75.71388840",
"created_at": "2019-10-05T23:18:57.000000Z",
"updated_at": "2022-03-13T12:57:52.000000Z",
"flag": 1,
"wikiDataId": "Q1191",
},
},
{
...
}
],
}
Efficiency
Our API, built on Laravel, guarantees rapid response times and dependable performance,
ensuring a seamless experience for your applications.
Comprehensive Data
Access an extensive database containing detailed information on countries, states, and cities
across the globe, catering to diverse geographical needs.
Easy Integration
Seamlessly integrate our API into your applications with ease, thanks to our meticulously
documented endpoints and user-friendly data structure.
Regular Updates
Stay up-to-date with the latest geographical information as our database undergoes frequent
updates, ensuring that you always have access to accurate and current data.