This repository provides comprehensive JSON datasets for all countries and their respective cities worldwide. It serves as an open-source project for developers, data enthusiasts, or anyone needing detailed information on countries and cities. The datasets include details like country codes, capital cities, currencies, timezones, and translations, as well as the cities' geographic information.
- Countries.json - Contains detailed information about every country worldwide.
- Cities.json - Contains detailed information about all cities within each country worldwide.
You can download the JSON files and integrate them into your projects as needed.
Below is an example entry for Afghanistan from the Country.json
file:
{
"id": 1,
"name": "Afghanistan",
"iso3": "AFG",
"iso2": "AF",
"numeric_code": "004",
"phone_code": "93",
"capital": "Kabul",
"currency": "AFN",
"currency_name": "Afghan afghani",
"currency_symbol": "؋",
"tld": ".af",
"native": "افغانستان",
"region": "Asia",
"subregion": "Southern Asia",
"nationality": "Afghan",
"timezones": [
{
"zoneName": "Asia/Kabul",
"gmtOffset": 16200,
"gmtOffsetName": "UTC+04:30",
"abbreviation": "AFT",
"tzName": "Afghanistan Time"
}
],
"translations": {
"kr": "아프가니스탄",
"pt-BR": "Afeganistão",
"de": "Afghanistan",
"es": "Afganistán",
"fr": "Afghanistan",
"ja": "アフガニスタン",
"cn": "阿富汗",
"ru": "Афганистан"
},
"latitude": "33.00000000",
"longitude": "65.00000000",
"emoji": "🇦🇫"
}
Below is an example entry for Afghanistan from the Cities.json
file:
{
"Afghanistan": [
{
"name": "Ashkāsham",
"latitude": "36.68333000",
"longitude": "71.53333000",
"state_name": "Badakhshan",
"state_code": "BDS"
},
{
"name": "Fayzabad",
"latitude": "37.11664000",
"longitude": "70.58002000",
"state_name": "Badakhshan",
"state_code": "BDS"
}
]
}
The JSON contains country data, and each city is linked to its corresponding country name, such as Afghanistan
. Based on the country name, you can retrieve the relevant city data.
- Country Details: Name, ISO codes, numeric codes, phone codes, capitals, currencies, timezones, translations, latitude/longitude, etc.
- City Details: Name, latitude, longitude, state name, and state code.
id
: Unique ID for each countryname
: Country nameiso3
,iso2
: ISO codesnumeric_code
: Numeric country codephone_code
: Country phone codecapital
: Capital citycurrency
,currency_name
,currency_symbol
: Currency detailstld
: Top-level domainnative
: Native country nameregion
,subregion
: Geographical informationnationality
: Nationality nametimezones
: Timezone detailstranslations
: Translations in various languageslatitude
,longitude
: Geographic coordinatesemoji
: Country flag
name
: City namelatitude
,longitude
: Geographic coordinatesstate_name
: Name of the state/provincestate_code
: State/province code
- Clone the repository using:
git clone https://github.com/saprahits/worldwide-countries-cities-json.git
- Alternatively, download the JSON files directly.
Contributions are welcome! Feel free to open issues or pull requests to improve the data.
This project is licensed under the MIT License - see the LICENSE file for details.
Created and maintained by Hitesh Sapra.
If you find this project useful, please give it a ⭐ to show your support!