パッケージの詳細

world-countries

mledoze417.4k5.1.0

List of world countries in JSON, CSV, XML and YAML

countries, world, json, csv

readme

World countries in JSON, CSV, XML and YAML.

License Build Status

Latest Stable Version npm downloads

Latest Stable Version PHP from Packagist Packagist downloads

Countries data

This repository contains a list of world countries, as defined by ISO Standard 3166-1, in JSON, CSV, XML and YAML. Warning: not all entities in this project are independent countries; refer to the independent property to know if the country is considered a sovereign state.

Each line contains the country:

  • name
    • common - common name in english
    • official - official name in english
    • native - list of all native names
      • key: three-letter ISO 639-3 language code
        • value: name object
          • key: official - official name translation
          • key: common - common name translation
  • country code top-level domain (tld)
  • code ISO 3166-1 alpha-2 (cca2)
  • code ISO 3166-1 numeric (ccn3)
  • code ISO 3166-1 alpha-3 (cca3)
  • code International Olympic Committee (cioc)
  • ISO 3166-1 independence status (independent) (denotes the country is considered a sovereign state)
  • ISO 3166-1 assignment status (status)
  • UN Member status (unMember)
  • UN Regional Group (unRegionalGroup)
  • currencies - list of all currencies
    • key: ISO 4217 currency code
    • value: currency object
      • key: name name of the currency
      • key: symbol symbol of the currency
  • International Direct Dialing info (idd)
    • root - the root geographical code prefix. e.g. +6 for New Zealand, +4 for UK.
    • suffixes - list of all suffixes assigned to this country. 4 for NZ, 809, 829, and 849 for Dominican Republic.
  • capital city(ies) (capital)
  • alternative spellings (altSpellings)
  • region
  • subregion
  • list of official languages (languages)
    • key: three-letter ISO 639-3 language code
    • value: name of the language in english
  • list of name translations (translations)
    • key: three-letter ISO 639-3 language code
    • value: name object
      • key: official - official name translation
      • key: common - common name translation
  • latitude and longitude (latlng)
  • demonyms - name of residents, translated & genderized
    • key: three-letter ISO 639-3 language code
    • value: genderized demonym object
      • key: f (female) or m (male)
      • value: genderized demonym translation
  • landlocked status (landlocked)
  • land borders (borders)
  • land area in km² (area)
  • emoji flag (flag)
  • calling codes (callingCodes)

Additional data

The data folder contains additional data such as the countries GeoJSON outlines and flags in SVG format.

Examples

JSON

{
    "name": {
        "common": "Austria",
        "official": "Republic of Austria",
        "native": {
            "bar": {
                "official": "Republik Österreich",
                "common": "Österreich"
            }
        }
    },
    "tld": [".at"],
    "cca2": "AT",
    "ccn3": "040",
    "cca3": "AUT",
    "cioc": "AUT",
    "independent": true,
    "status": "officially-assigned",
    "unMember": true,
    "unRegionalGroup": "Western European and Others Group",
    "currencies": {"EUR": {"name": "Euro", "symbol": "\u20ac"}},
    "idd": {
        "root": "+4",
        "suffixes": ["3"]
    },
    "capital": ["Vienna"],
    "altSpellings": ["AT", "Osterreich", "Oesterreich"],
    "region": "Europe",
    "subregion": "Western Europe",
    "languages": {
        "bar": "Austro-Bavarian German"
    },
    "translations": {
        "cym": {"official": "Republic of Austria", "common": "Awstria"},
        "deu": {"official": "Republik Österreich", "common": "Österreich"},
        "fra": {"official": "République d'Autriche", "common": "Autriche"},
        "hrv": {"official": "Republika Austrija", "common": "Austrija"},
        "ita": {"official": "Repubblica d'Austria", "common": "Austria"},
        "jpn": {"official": "オーストリア共和国", "common": "オーストリア"},
        "nld": {"official": "Republiek Oostenrijk", "common": "Oostenrijk"},
        "por": {"official": "República da Áustria", "common": "Áustria"},
        "rus": {"official": "Австрийская Республика", "common": "Австрия"},
        "spa": {"official": "República de Austria", "common": "Austria"}
    },
    "latlng": [47.33333333, 13.33333333],
    "demonyms": {
        "fra": {
            "f": "Autrichienne",
            "m": "Autrichien"
        },
        "spa": {
            "f": "Austriaco",
            "m": "Austriaca"
        }
    },
    "landlocked": true,
    "borders": ["CZE", "DEU", "HUN", "ITA", "LIE", "SVK", "SVN", "CHE"],
    "area": 83871,
    "callingCodes": ["+43"]
    "flag": "\ud83c\udde6\ud83c\uddf9"
}

GeoJSON and TopoJSON outlines

See an example for Germany: GeoJSON or TopoJSON.

CSV

"name.common","name.official","tld","cca2","ccn3","cca3","cioc","independent","status","unMember","currencies","idd.root","idd.suffixes","capital","altSpellings","region","subregion","languages","translations.ces.official","translations.ces.common","translations.deu.official","translations.deu.common","translations.est.official","translations.est.common","translations.fin.official","translations.fin.common","translations.fra.official","translations.fra.common","translations.hrv.official","translations.hrv.common","translations.hun.official","translations.hun.common","translations.ita.official","translations.ita.common","translations.jpn.official","translations.jpn.common","translations.kor.official","translations.kor.common","translations.nld.official","translations.nld.common","translations.per.official","translations.per.common","translations.pol.official","translations.pol.common","translations.por.official","translations.por.common","translations.rus.official","translations.rus.common","translations.slk.official","translations.slk.common","translations.spa.official","translations.spa.common","translations.swe.official","translations.swe.common","translations.urd.official","translations.urd.common","translations.zho.official","translations.zho.common","latlng","landlocked","borders","area","flag","demonyms.eng.f","demonyms.eng.m","demonyms.fra.f","demonyms.fra.m","callingCodes"
"Aruba","Aruba",".aw","AW","533","ABW","ARU","0","officially-assigned","0","AWG","+2","97","Oranjestad","AW","Americas","Caribbean","Dutch,Papiamento","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","アルバ","アルバ","아루바","아루바","Aruba","Aruba","آروبا","آروبا","Aruba","Aruba","Aruba","Aruba","Аруба","Аруба","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","اروبا","اروبا","阿鲁巴","阿鲁巴","12.5,-69.96666666","0","","180","🇦🇼","Aruban","Aruban","Arubaise","Arubais","+297"
"Afghanistan","Islamic Republic of Afghanistan",".af","AF","004","AFG","AFG","1","officially-assigned","1","AFN","+9","3","Kabul","AF,Afġānistān","Asia","Southern Asia","Dari,Pashto,Turkmen","Afghánská islámská republika","Afghánistán","Islamische Republik Afghanistan","Afghanistan","Afganistani Islamivabariik","Afganistan","Afganistanin islamilainen tasavalta","Afganistan","République islamique d'Afghanistan","Afghanistan","Islamska Republika Afganistan","Afganistan","Afganisztáni Iszlám Köztársaság","Afganisztán","Repubblica islamica dell'Afghanistan","Afghanistan","アフガニスタン・イスラム共和国","アフガニスタン","아프가니스탄 이슬람 공화국","아프가니스탄","Islamitische Republiek Afghanistan","Afghanistan","جمهوری اسلامی افغانستان","افغانستان","Islamska Republika Afganistanu","Afganistan","República Islâmica do Afeganistão","Afeganistão","Исламская Республика Афганистан","Афганистан","Afgánsky islamský štát","Afganistan","República Islámica de Afganistán","Afganistán","Islamiska republiken Afghanistan","Afghanistan","اسلامی جمہوریہ افغانستان","افغانستان","阿富汗伊斯兰共和国","阿富汗","33,65","1","IRN,PAK,TKM,UZB,TJK,CHN","652230","🇦🇫","Afghan","Afghan","Afghane","Afghan","+93"
"Angola","Republic of Angola",".ao","AO","024","AGO","ANG","1","officially-assigned","1","AOA","+2","44","Luanda","AO,República de Angola,ʁɛpublika de an'ɡɔla","Africa","Middle Africa","Portuguese","Angolská republika","Angola","Republik Angola","Angola","Angola Vabariik","Angola","Angolan tasavalta","Angola","République d'Angola","Angola","Republika Angola","Angola","Angola","Angola","Repubblica dell'Angola","Angola","アンゴラ共和国","アンゴラ","앙골라 공화국","앙골라","Republiek Angola","Angola","جمهوری آنگولا","آنگولا","Republika Angoli","Angola","República de Angola","Angola","Республика Ангола","Ангола","Angolská republika","Angola","República de Angola","Angola","Republiken Angola","Angola","جمہوریہ انگولہ","انگولہ","安哥拉共和国","安哥拉","-12.5,18.5","0","COG,COD,ZMB,NAM","1246700","🇦🇴","Angolan","Angolan","Angolaise","Angolais","+244"

XML

<?xml version="1.0" encoding="UTF-8"?>
<countries>
  <country name.common="Aruba" name.official="Aruba" name.native.nld.official="Aruba" name.native.nld.common="Aruba" name.native.pap.official="Aruba" name.native.pap.common="Aruba" tld=".aw" cca2="AW" ccn3="533" cca3="ABW" cioc="ARU" independent="0" status="officially-assigned" unMember="0" currencies.AWG.name="Aruban florin" currencies.AWG.symbol="ƒ" idd.root="+2" idd.suffixes="97" capital="Oranjestad" altSpellings="AW" region="Americas" subregion="Caribbean" languages.nld="Dutch" languages.pap="Papiamento" translations.ces.official="Aruba" translations.ces.common="Aruba" translations.deu.official="Aruba" translations.deu.common="Aruba" translations.est.official="Aruba" translations.est.common="Aruba" translations.fin.official="Aruba" translations.fin.common="Aruba" translations.fra.official="Aruba" translations.fra.common="Aruba" translations.hrv.official="Aruba" translations.hrv.common="Aruba" translations.hun.official="Aruba" translations.hun.common="Aruba" translations.ita.official="Aruba" translations.ita.common="Aruba" translations.jpn.official="アルバ" translations.jpn.common="アルバ" translations.kor.official="아루바" translations.kor.common="아루바" translations.nld.official="Aruba" translations.nld.common="Aruba" translations.per.official="آروبا" translations.per.common="آروبا" translations.pol.official="Aruba" translations.pol.common="Aruba" translations.por.official="Aruba" translations.por.common="Aruba" translations.rus.official="Аруба" translations.rus.common="Аруба" translations.slk.official="Aruba" translations.slk.common="Aruba" translations.spa.official="Aruba" translations.spa.common="Aruba" translations.swe.official="Aruba" translations.swe.common="Aruba" translations.urd.official="اروبا" translations.urd.common="اروبا" translations.zho.official="阿鲁巴" translations.zho.common="阿鲁巴" latlng="12.5,-69.96666666" landlocked="0" borders="" area="180" flag="🇦🇼" demonyms.eng.f="Aruban" demonyms.eng.m="Aruban" demonyms.fra.f="Arubaise" demonyms.fra.m="Arubais" callingCodes="+297"/>
  <country name.common="Afghanistan" name.official="Islamic Republic of Afghanistan" name.native.prs.official="جمهوری اسلامی افغانستان" name.native.prs.common="افغانستان" name.native.pus.official="د افغانستان اسلامي جمهوریت" name.native.pus.common="افغانستان" name.native.tuk.official="Owganystan Yslam Respublikasy" name.native.tuk.common="Owganystan" tld=".af" cca2="AF" ccn3="004" cca3="AFG" cioc="AFG" independent="1" status="officially-assigned" unMember="1" currencies.AFN.name="Afghan afghani" currencies.AFN.symbol="؋" idd.root="+9" idd.suffixes="3" capital="Kabul" altSpellings="AF,Afġānistān" region="Asia" subregion="Southern Asia" languages.prs="Dari" languages.pus="Pashto" languages.tuk="Turkmen" translations.ces.official="Afghánská islámská republika" translations.ces.common="Afghánistán" translations.deu.official="Islamische Republik Afghanistan" translations.deu.common="Afghanistan" translations.est.official="Afganistani Islamivabariik" translations.est.common="Afganistan" translations.fin.official="Afganistanin islamilainen tasavalta" translations.fin.common="Afganistan" translations.fra.official="République islamique d'Afghanistan" translations.fra.common="Afghanistan" translations.hrv.official="Islamska Republika Afganistan" translations.hrv.common="Afganistan" translations.hun.official="Afganisztáni Iszlám Köztársaság" translations.hun.common="Afganisztán" translations.ita.official="Repubblica islamica dell'Afghanistan" translations.ita.common="Afghanistan" translations.jpn.official="アフガニスタン・イスラム共和国" translations.jpn.common="アフガニスタン" translations.kor.official="아프가니스탄 이슬람 공화국" translations.kor.common="아프가니스탄" translations.nld.official="Islamitische Republiek Afghanistan" translations.nld.common="Afghanistan" translations.per.official="جمهوری اسلامی افغانستان" translations.per.common="افغانستان" translations.pol.official="Islamska Republika Afganistanu" translations.pol.common="Afganistan" translations.por.official="República Islâmica do Afeganistão" translations.por.common="Afeganistão" translations.rus.official="Исламская Республика Афганистан" translations.rus.common="Афганистан" translations.slk.official="Afgánsky islamský štát" translations.slk.common="Afganistan" translations.spa.official="República Islámica de Afganistán" translations.spa.common="Afganistán" translations.swe.official="Islamiska republiken Afghanistan" translations.swe.common="Afghanistan" translations.urd.official="اسلامی جمہوریہ افغانستان" translations.urd.common="افغانستان" translations.zho.official="阿富汗伊斯兰共和国" translations.zho.common="阿富汗" latlng="33,65" landlocked="1" borders="IRN,PAK,TKM,UZB,TJK,CHN" area="652230" flag="🇦🇫" demonyms.eng.f="Afghan" demonyms.eng.m="Afghan" demonyms.fra.f="Afghane" demonyms.fra.m="Afghan" callingCodes="+93"/>
  <country name.common="Angola" name.official="Republic of Angola" name.native.por.official="República de Angola" name.native.por.common="Angola" tld=".ao" cca2="AO" ccn3="024" cca3="AGO" cioc="ANG" independent="1" status="officially-assigned" unMember="1" currencies.AOA.name="Angolan kwanza" currencies.AOA.symbol="Kz" idd.root="+2" idd.suffixes="44" capital="Luanda" altSpellings="AO,República de Angola,ʁɛpublika de an'ɡɔla" region="Africa" subregion="Middle Africa" languages.por="Portuguese" translations.ces.official="Angolská republika" translations.ces.common="Angola" translations.deu.official="Republik Angola" translations.deu.common="Angola" translations.est.official="Angola Vabariik" translations.est.common="Angola" translations.fin.official="Angolan tasavalta" translations.fin.common="Angola" translations.fra.official="République d'Angola" translations.fra.common="Angola" translations.hrv.official="Republika Angola" translations.hrv.common="Angola" translations.hun.official="Angola" translations.hun.common="Angola" translations.ita.official="Repubblica dell'Angola" translations.ita.common="Angola" translations.jpn.official="アンゴラ共和国" translations.jpn.common="アンゴラ" translations.kor.official="앙골라 공화국" translations.kor.common="앙골라" translations.nld.official="Republiek Angola" translations.nld.common="Angola" translations.per.official="جمهوری آنگولا" translations.per.common="آنگولا" translations.pol.official="Republika Angoli" translations.pol.common="Angola" translations.por.official="República de Angola" translations.por.common="Angola" translations.rus.official="Республика Ангола" translations.rus.common="Ангола" translations.slk.official="Angolská republika" translations.slk.common="Angola" translations.spa.official="República de Angola" translations.spa.common="Angola" translations.swe.official="Republiken Angola" translations.swe.common="Angola" translations.urd.official="جمہوریہ انگولہ" translations.urd.common="انگولہ" translations.zho.official="安哥拉共和国" translations.zho.common="安哥拉" latlng="-12.5,18.5" landlocked="0" borders="COG,COD,ZMB,NAM" area="1246700" flag="🇦🇴" demonyms.eng.f="Angolan" demonyms.eng.m="Angolan" demonyms.fra.f="Angolaise" demonyms.fra.m="Angolais" callingCodes="+244"/><countries>

YAML

- { name: { common: Aruba, official: Aruba, native: { nld: { official: Aruba, common: Aruba }, pap: { official: Aruba, common: Aruba } } }, tld: [.aw], cca2: AW, ccn3: '533', cca3: ABW, cioc: ARU, independent: false, status: officially-assigned, unMember: false, currencies: { AWG: { name: 'Aruban florin', symbol: ƒ } }, idd: { root: '+2', suffixes: ['97'] }, capital: [Oranjestad], altSpellings: [AW], region: Americas, subregion: Caribbean, languages: { nld: Dutch, pap: Papiamento }, translations: { ces: { official: Aruba, common: Aruba }, deu: { official: Aruba, common: Aruba }, est: { official: Aruba, common: Aruba }, fin: { official: Aruba, common: Aruba }, fra: { official: Aruba, common: Aruba }, hrv: { official: Aruba, common: Aruba }, hun: { official: Aruba, common: Aruba }, ita: { official: Aruba, common: Aruba }, jpn: { official: アルバ, common: アルバ }, kor: { official: 아루바, common: 아루바 }, nld: { official: Aruba, common: Aruba }, per: { official: آروبا, common: آروبا }, pol: { official: Aruba, common: Aruba }, por: { official: Aruba, common: Aruba }, rus: { official: Аруба, common: Аруба }, slk: { official: Aruba, common: Aruba }, spa: { official: Aruba, common: Aruba }, swe: { official: Aruba, common: Aruba }, urd: { official: اروبا, common: اروبا }, zho: { official: 阿鲁巴, common: 阿鲁巴 } }, latlng: [12.5, -69.96666666], landlocked: false, borders: {  }, area: 180, flag: 🇦🇼, demonyms: { eng: { f: Aruban, m: Aruban }, fra: { f: Arubaise, m: Arubais } }, callingCodes: ['+297'] }
- { name: { common: Afghanistan, official: 'Islamic Republic of Afghanistan', native: { prs: { official: 'جمهوری اسلامی افغانستان', common: افغانستان }, pus: { official: 'د افغانستان اسلامي جمهوریت', common: افغانستان }, tuk: { official: 'Owganystan Yslam Respublikasy', common: Owganystan } } }, tld: [.af], cca2: AF, ccn3: '004', cca3: AFG, cioc: AFG, independent: true, status: officially-assigned, unMember: true, currencies: { AFN: { name: 'Afghan afghani', symbol: ؋ } }, idd: { root: '+9', suffixes: ['3'] }, capital: [Kabul], altSpellings: [AF, Afġānistān], region: Asia, subregion: 'Southern Asia', languages: { prs: Dari, pus: Pashto, tuk: Turkmen }, translations: { ces: { official: 'Afghánská islámská republika', common: Afghánistán }, deu: { official: 'Islamische Republik Afghanistan', common: Afghanistan }, est: { official: 'Afganistani Islamivabariik', common: Afganistan }, fin: { official: 'Afganistanin islamilainen tasavalta', common: Afganistan }, fra: { official: "République islamique d'Afghanistan", common: Afghanistan }, hrv: { official: 'Islamska Republika Afganistan', common: Afganistan }, hun: { official: 'Afganisztáni Iszlám Köztársaság', common: Afganisztán }, ita: { official: "Repubblica islamica dell'Afghanistan", common: Afghanistan }, jpn: { official: アフガニスタン・イスラム共和国, common: アフガニスタン }, kor: { official: '아프가니스탄 이슬람 공화국', common: 아프가니스탄 }, nld: { official: 'Islamitische Republiek Afghanistan', common: Afghanistan }, per: { official: 'جمهوری اسلامی افغانستان', common: افغانستان }, pol: { official: 'Islamska Republika Afganistanu', common: Afganistan }, por: { official: 'República Islâmica do Afeganistão', common: Afeganistão }, rus: { official: 'Исламская Республика Афганистан', common: Афганистан }, slk: { official: 'Afgánsky islamský štát', common: Afganistan }, spa: { official: 'República Islámica de Afganistán', common: Afganistán }, swe: { official: 'Islamiska republiken Afghanistan', common: Afghanistan }, urd: { official: 'اسلامی جمہوریہ افغانستان', common: افغانستان }, zho: { official: 阿富汗伊斯兰共和国, common: 阿富汗 } }, latlng: [33, 65], landlocked: true, borders: [IRN, PAK, TKM, UZB, TJK, CHN], area: 652230, flag: 🇦🇫, demonyms: { eng: { f: Afghan, m: Afghan }, fra: { f: Afghane, m: Afghan } }, callingCodes: ['+93'] }
- { name: { common: Angola, official: 'Republic of Angola', native: { por: { official: 'República de Angola', common: Angola } } }, tld: [.ao], cca2: AO, ccn3: '024', cca3: AGO, cioc: ANG, independent: true, status: officially-assigned, unMember: true, currencies: { AOA: { name: 'Angolan kwanza', symbol: Kz } }, idd: { root: '+2', suffixes: ['44'] }, capital: [Luanda], altSpellings: [AO, 'República de Angola', "ʁɛpublika de an'ɡɔla"], region: Africa, subregion: 'Middle Africa', languages: { por: Portuguese }, translations: { ces: { official: 'Angolská republika', common: Angola }, deu: { official: 'Republik Angola', common: Angola }, est: { official: 'Angola Vabariik', common: Angola }, fin: { official: 'Angolan tasavalta', common: Angola }, fra: { official: "République d'Angola", common: Angola }, hrv: { official: 'Republika Angola', common: Angola }, hun: { official: Angola, common: Angola }, ita: { official: "Repubblica dell'Angola", common: Angola }, jpn: { official: アンゴラ共和国, common: アンゴラ }, kor: { official: '앙골라 공화국', common: 앙골라 }, nld: { official: 'Republiek Angola', common: Angola }, per: { official: 'جمهوری آنگولا', common: آنگولا }, pol: { official: 'Republika Angoli', common: Angola }, por: { official: 'República de Angola', common: Angola }, rus: { official: 'Республика Ангола', common: Ангола }, slk: { official: 'Angolská republika', common: Angola }, spa: { official: 'República de Angola', common: Angola }, swe: { official: 'Republiken Angola', common: Angola }, urd: { official: 'جمہوریہ انگولہ', common: انگولہ }, zho: { official: 安哥拉共和国, common: 安哥拉 } }, latlng: [-12.5, 18.5], landlocked: false, borders: [COG, COD, ZMB, NAM], area: 1246700, flag: 🇦🇴, demonyms: { eng: { f: Angolan, m: Angolan }, fra: { f: Angolaise, m: Angolais } }, callingCodes: ['+244'] }

Customising the output

The data files provided in the dist directory include all available fields, but is also possible to build a custom version of the data with certain fields excluded.

To do this, you will first need a working PHP installation, composer and a local copy of this repository. Once you have these, open a terminal in your local version of this project's root directory and run this command to install the necessary dependencies:

composer install

After this finishes, run the following command (here we will exclude the tld field from the output, but you can exclude any field you want):

php countries.php convert --exclude-field=tld

You can also exclude multiple fields:

php countries.php convert --exclude-field=tld --exclude-field=cca2

# Or using the shorter `-x` syntax:
php countries.php convert -x tld -x cca2

If you prefer to include only some fields (this can not be combined with --exclude-field):

php countries.php convert --include-field=name --include-field=area

# or using the shorter `-i` syntax:
php countries.php convert -i name -i area

The generated files are put into the dist directory, but you can change this to another existing directory:

mkdir foobar
php countries.php convert --output-dir=foobar

You can also choose to only generate some of the output formats:

mkdir foobar
php countries.php convert --format=json_unescaped --format=csv

# or using the shorter `-f` syntax:
php countries.php convert -f json_unescaped -f csv

Showcase

Projects using this dataset:

How to contribute?

Please refer to CONTRIBUTING.

To do

  • add the type of the country (country, sovereign state, public body, territory, etc.)
  • pull in data automatically from CLDR at build time (idea from @Munter, see #108)

Sources

https://www.currency-iso.org/ for currency codes.

Region and subregion are taken from https://github.com/hexorx/countries.

GeoJSON outlines come from http://thematicmapping.org/downloads/world_borders.php.

The rest comes from Wikipedia.

Credits

Thanks to:

License

See LICENSE.

Flags are not licensed under the ODbL license; see https://en.wikipedia.org/wiki/Wikipedia:Copyright_on_emblems for more information.

更新履歴

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[5.1.0] - 2024-11-30

Added

  • add Serbian translations (#534)
  • add Turkish translations
  • add Arabic translations
  • add alt spellings found in ourworldindata.org Covid-19 data
  • add missing Chinese translations
  • add missing Japanese translations for Curaçao and Kosovo

    Changed

  • add missing translations for Curaçao (Croatian) and Iran (Persian) (#496)
  • add missing Japanese translations for Curaçao and Kosovo (#498)
  • add missing Chinese translations (#498)
  • renamed Kazakhstan capital from Nur-Sultan to Astana
  • change Turkey country name to Türkiye
  • build: allow usage with Symfony 7.x (#516)
  • build: drop support for PHP 8.1 (#520)
  • ci: add PHP 8.3 version in CI checks (#516)
  • ci: update actions/cache to v4 (#520)
  • ci: separate JSON linting from PHP tests

    Fixed

  • fix column count in CSV export (#497)
    • remove native names
    • remove incomplete "cym" translations
    • use currency names only instead of codes and names
    • add missing "borders" column in CSV export
    • handle false values as "0"
  • fix error when running index.mjs
  • fix duplicate idd suffixes for Canada (#544)
  • fix German Name for Côte d'Ivoire
  • move composer's ext-gettext PHP module to require-dev key
  • rename Slovakia and South Africa common spa translations
  • remove duplicate idd suffixes for Canada.
  • improvements for encoding json file
  • fix Japanese translations
  • fix error when running index.mjs
  • remove empty lines from geo.json files
  • fix convert -i option in README.md (#505)
  • fix column count in CSV export (#503)
  • Update README.md (#499)
  • keep object keys ordered

[5.0.0] - 2023-09-17

Breaking changes

  • drop support for old versions of PHP and Symfony
    • the minimum version of PHP is 8.1
    • the supported Symfony versions are 5.4 and 6.3
  • remove Bower integration

Changed

  • update official name of Turkey (#458)
  • update flags for Afghanistan, France, Honduras and Mauritania (#455)
  • remove empty strings (#488)
  • fix polish translation of United Kingdom (#453)
  • refactor build script
  • add Dependabot integration

[v4.1.1] - 2023-09-17

Fixed

  • adjust package.json for ES6 and CommonJS support (#486)
  • change demonyms property type (#483)
  • fix files listed in npm package (#481)
  • add symfony/console 6.0 support (#450)
  • add ESM support (#469)
  • add Bosnia and Herzegovina convertible mark currency symbol (#464)
  • updated Croatia's currency to EUR as the HRK (#472)
  • mark Guinea-Bissau as a UN member (#473)

[v4.1.0] - 2022-02-25

Added

  • add Swedish translation (#398)
  • add a changelog (#383)
  • add Hungarian translation (#385)
  • add UN membership boolean flag to each country (#401)
  • add geojson and topojson for South Sudan (#406)
  • add geojson and topojson for Sint Maarten (SX) (#407)
  • add geojson and topojson for the Caribbean Netherlands (BQ) (#407)

    Changed

  • sort translations alphabetically (#384)
  • remove South Sudan from Sudan's geojson and topojson (#406)
  • change subregion to Eastern Europe for Slovakia (#413)
  • change first letter of Czechia to uppercase (#431)
  • add capital for Bonaire, Sint Eustatius and Saba (#441)
  • add TLD for Kosovo (#441)

    Fixed

  • fixed missing idd suffixes of Canada and USA (#426)
  • rename capital city of Kazakhstan from Astana to Nur-Sultan (#391)
  • change capital city of Burundi from Bujumbura to Gitega (#391)
  • change demonym of United States Minor Outlying Islands to American Islander (#391)
  • add South African rand as a currency to Eswatini (#391)
  • remove St Barthelemy from Guadaloupe geojson and topojson (#407)
  • set St Barthelemy's geojson and topojson to correct region (#407)
  • remove duplicate viewBox for Cuba's flag (#411)
  • fixed idd of Russia and Kazakhstan by removing XX suffix (#425)
  • remove new line character in Congo's translations (#430)
  • fix Montenegrin language code (#434)
  • fix IOC code for Lebanon and Singapore (#441)

    Build

  • add files in package.json to reduce package size (#388)
  • generate calling codes (callingCodes) from international direct dialing info (idd) (#389)
  • drop support for old versions of PHP and Symfony packages (#435)

[v4.0.1] - 2020-12-24

Fixed

  • correct the file permissions (#414)

[v4.0.0] - 2020-04-04

Breaking changes

  • merge demonym into demonyms (#369)
  • remove property demonym (#369)

Before

"demonym": "Irish",
...
"demonyms": {
    "fra": {
        "f": "Irlandaise",
        "m": "Irlandais"
    }
}

After

"demonyms": {
    "eng": {
        "f": "Irish",
        "m": "Irish"
    },
    "fra": {
        "f": "Irlandaise",
        "m": "Irlandais"
    }
}

Added

  • add translated demonyms in French (#343)
  • add DPRK as an alternative spelling to North Korea (#371)
  • add altSpelling to Macedonia (#377)

    Changed

  • update TypeScript types to v3 (#376)

    Fixed

  • fix Curaçao calling code (#370)
  • fix wrong Iran language code, update the language label (#374)
  • fix Spanish spelling for Haiti (#380)

[v3.0.0] - 2019-12-18

Breaking changes

  • rename property currency to currencies
  • change format of currencies property: it is now an object with currency code as keys. The value is an object with name and symbol properties.

Before

 "currency": ["SHP", "GBP"]

After

"currencies": {
    "GBP": {
        "name": "Pound sterling",
        "symbol": "\u00a3"
    },
    "SHP": {
        "name": "Saint Helena pound",
        "symbol": "\u00a3"
    }
}

Added

  • add International Direct Dialing codes (idd property); example:
"idd": {
    "root": "+2",
    "suffixes": [
        "90",
        "47"
    ]
}
  • add Persian translations
  • add Korean translations
  • add Urdu translations
  • add missing currency codes
  • add missing Korean common translation for Wallis and Futuna
  • add types for TypeScript
  • add Symfony 5 support

    Changed

  • change name of Macedonia to North Macedonia
  • update translations of North Macedonia
  • update flag of Bolivia and Peru
  • reorder currencies codes alphabetically
  • change demonym of Myanmar to Burmese
  • update entry for Curaçao

    Fixed

  • rename 'Dollar' to 'dollar'
  • replace sovereing with sovereign
  • fix names of Saint Kitts and Nevis
  • remove [G] in currency codes
  • fix official German name for Nepal
  • fix Kazakhstan calling code
  • replaces (none) with empty strings

    Build

  • migrate CI from Travis to GitHub Actions

    Miscellaneous

  • add the full ODbL license
  • update build status badge with

[v2.1.0] - 2018-11-09

Added

  • add Czech translations
  • add Polish translations
  • add missing Croatian translation for Sint Maarten

    Fixed

  • replace "Northern America" by "North America"
  • remove fund codes from currencies
  • rename Swaziland to Eswatini
  • revise some German translations
  • fix Vatican City demonym
  • fix Macau demonym
  • fix some Unicode typos
  • fix type of 'name.native' when property is empty
  • fix official and common country name of Korea
  • fix official and native name of the Netherlands (#277)

    Build

  • fix output message when converting with specific format(s) (#281)
  • format code to comply with PSR2 coding standard
  • remove Hungarian notation in PHP Code
  • move dependency roave/security-advisories to require-dev section

    Miscellaneous

  • add badge for PHP minimum version
  • add scrutinizer badge

[v2.0.0] - 2018-02-08

This project now requires the latest version of PHP 5, which is 5.6.33. This will be the last release to support PHP 5. The next major release (v3.0.0) will require PHP 7.2.

Breaking changes

  • change type of property capitals from string to array to support countries with multiple capitals
  • change semicolon to comma for CSV format (see https://github.com/mledoze/countries/blob/e2de3c46402c2b7a90d30fa1d6d1151e97420992/dist/countries.csv)
  • move SHN and BES divisions back into the main countries.json as two separate entries; also removed files data/shn.divisions.json and data/bes.divisions.json
  • remove region specific languages (see #181)
  • remove South Sudan from Chad's neighbours

    Added

  • add ISO 3166-1 independence status (property independent)
  • add ISO 3166-1 assignment status (property status)
  • add TopoJSON formatted files for each country
  • add Estonian translations
  • add Guiana demonym for French French Guiana
  • add "The Netherlands" as alternate spelling of Netherlands
  • add CKD as currency of Cook Islands
  • add "Antarctic" region for multiple countries
  • add latitude and longitude data for United States Minor Outlying Islands

    Build

  • add three new options: --include-field, --format and --output-dir (thank you @emilv)
  • add Travis CI to automatically validate new pull requests
  • update dependencies:
    • php (>=5.5.9 => >=5.6.33)
    • symfony/console (v3.1.3 => v4.0.4)
    • symfony/yaml (v3.1.3 => v4.0.4)

      Changed

  • update alternative spellings of Cocos (Keeling) Islands
  • update official languages of Armenia

    Removed

  • remove province of China and use Traditional Chinese instead of Simplified Chinese

    Fixed

  • fix capital of Ukraine
  • fix non-existing slk language
  • fix land borders for China, Cyprus, Chad, Egypt, India, Jordan and Israel
  • fix Russian translation of Mexico
  • fix existing official names in Welsh
  • fix Russia native official name according to en.wikipedia.org/wiki/Russia
  • fix Czech Republic short names
  • fix Slovakian translation ISO code
  • fix subregion field for Mexico
  • fix altSpellings field for Belarus
  • fix country name and currency code for Belarus

    Miscalleanous

  • change licence label to "ODC Open Database License v1.0" to comply with SPDX names

[v1.8.0] - 2016-09-01

Added

  • add Slovak translations
  • add Chinese translations
  • add Dutch translation for Kosovo
  • add German translations for Kosovo and Curaçao

    Build

  • add composer.lock file to prevent dependencies issues
  • allow setting a custom command name

    Fixed

  • fix native name for Nepal (from apilayer/restcountries#23)
  • change demonym for Argentina to Argentine
  • fix demonym for Christmas Island
  • fix subregion in Slovak Republic
  • replace all "cmn" with "zho"
  • replace Kosovo's International Olympic Committee code by ISO 3166-1 alpha-3 code in land borders array

[v1.7.7] - 2016-01-28

Added

  • add missing French translations for Kosovo and Curaçao.

[v1.7.6] - 2016-01-21

Fixed

  • fix languages key not being excluded with JSON converter (#162)

[v1.7.5] - 2016-01-20

Build

  • Allow both 2.7 and 3.0 for Symfony

[v1.7.4] - 2015-06-20

Build

  • update Symfony to version 2.7

[v1.7.3] - 2015-04-05

Breaking changes

  • remove Bonaire and Saint Helena, Ascension and Tristan da Cunha from countries.json and moved them respectively in data/bes.divisions.json and data/shn.divisions.json (see #93)

    Added

  • add new property: International Olympic Committee country code (cioc)
  • add Ascension and Tristan da Cunha to data/shn.divisions.json
  • add Sint Eustatius and Saba to data/bes.divisions.json
  • add Tamil to the list of Indian languages
  • add missing ISO 3166-1 names to altSpellings
  • add sardinian language to Italy
  • add sardinian translation of the Italian name
  • add finish translations
  • add basque language name to Spain

    Build

  • update composer dependencies

    Fixed

  • made Kuwait border Iraq
  • remove Iran from Kuwait borders

Thank you to all the contributors who helped for this release!

[v1.7.2] - 2015-03-07

Removed

remove src from the ignore list in bower.json

Fixed

fix bugs entry in package.json

[v1.7.1] - 2015-03-07

Breaking changes

  • remove relevance data, see #41

    Added

  • add bower.json to make this project available as a Bower package
  • add note about editing languages in CONTRIBUTING.md

    Build

  • rename CountryData to Converter
  • rename Converter interface to ConverterInterface

    Fixed

  • fix data for South Soudan, Bonaire and Curazao
  • fix spelling in german translation for Egypt
  • remove cca3 code from Kosovo

[v1.7.0] - 2015-02-06

Breaking changes

  • New format for country names.

The country names (property name.native) now contains every native languages. Thus the nativeLanguage property, which used to identify the language code used for the native country names, has been removed.

Before

{
    "name": {
        "common": "Peru",
        "official": "Republic of Peru",
        "native": {
            "common": "Per\u00fa",
            "official": "Rep\u00fablica del Per\u00fa"
        }
    },
    "...": "...",
    "nativeLanguage": "spa",
    "languages": {
        "aym": "Aymara",
        "que": "Quechua",
        "spa": "Spanish"
    }
}

After

{
    "name": {
        "common": "Peru",
        "official": "Republic of Peru",
        "native": {
            "aym": {
                "official": "Piruw Suyu",
                "common": "Piruw"
            },
            "que": {
                "official": "Piruw Ripuwlika",
                "common": "Piruw"
            },
            "spa": {
                "official": "Rep\u00fablica del Per\u00fa",
                "common": "Per\u00fa"
            }
        }
    },
    "...": "...",
    "languages": {
        "aym": "Aymara",
        "que": "Quechua",
        "spa": "Spanish"
    }
}
  • New format for translations

As proposed by @herrniemand, the format for translations has been updated to include official country names. Hereafter an example for Peru:

Before

{
      "translations": {
        "deu": "Peru",
        "fra": "P\u00e9rou",
        "hrv": "Peru",
        "ita": "Per\u00f9",
        "jpn": "\u30da\u30eb\u30fc",
        "nld": "Peru",
        "por": "Per\u00fa",
        "rus": "\u041f\u0435\u0440\u0443",
        "spa": "Per\u00fa"
    }
}

After

{
    "translations": {
        "deu": {"official": "Republik Peru", "common": "Peru"},
        "fra": {"official": "R\u00e9publique du P\u00e9rou", "common": "P\u00e9rou"},
        "hrv": {"official": "Republika Peru", "common": "Peru"},
        "ita": {"official": "Repubblica del Per\u00f9", "common": "Per\u00f9"},
        "jpn": {"official": "\u30da\u30eb\u30fc\u5171\u548c\u56fd", "common": "\u30da\u30eb\u30fc"},
        "nld": {"official": "Republiek Peru", "common": "Peru"},
        "por": {"official": "Rep\u00fablica do Peru", "common": "Per\u00fa"},
        "rus": {"official": "\u0420\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430 \u041f\u0435\u0440\u0443", "common": "\u041f\u0435\u0440\u0443"},
        "spa": {"official": "Rep\u00fablica de Per\u00fa", "common": "Per\u00fa"}
    }
}

Added

  • add alternative name and spellings for East Timor

    Build

    A new build system has been introduced by @petert82. The single script is split up into individual files in src/ and the symfony Console component as a dependency, to make it nice and easy to extend the conversion options in future.

To build the dist files, the command is now php countries.php convert.

Changed

  • change Lithuania currency to EUR
  • change zambian currency to ZMW

    Fixed

  • fix Kosovo calling code
  • fix demonym of Myanmar
  • fix official Swahili name of Kenya

Again, a huge thank you goes to @herrniemand and @petert82 for their ideas and help on this.

[v1.6.2] - 2015-01-21

Added

  • add landlocked data (as proposed by @romsson)
  • add commands in CONTRIBUTING.md to generate dist files

    Fixed

  • fix Saint-Martin and Saint-Pierre-and-Miquelon mixed up names
  • fix flags ratio -fix Western Sahara names

[v1.6.1] - 2015-01-12

Added

  • this project is now available on Packagist: https://packagist.org/packages/mledoze/countries
  • add demonym for Antarctica
  • add Countries of the World in showcase list
  • add portuguese country name translations
  • add missing area data
  • add russian language to Azerbaijan

    Build

  • add a yaml converter
  • add processEmptyArrays method for JSON converters
  • refactor loop for fields to keep
  • change PHP_EOL to \n

    Fixed

  • fix DR Congo common name
  • fix afghanistan portuguese translation
  • fix denonym for Mayotte and South Georgia
  • fix names for Kosovo bump version
  • fix Georgia's area
  • remove Armenian language to Azerbaijan

[v1.6] - 2014-09-12

Breaking changes

New format for country names. The name property is now an object containing the common and official names of the country both in english and in the official native language of the country (the language used for this is identified by the new nativeLanguage property; see below).

Before

{
      "name": "Switzerland",
      "nativeName": "Schweiz",
      "..."
}

After

{
    "name": {
        "common": "Switzerland",
        "official": "Swiss Confederation",
        "native": {
            "common": "Schweiz",
            "official": "Schweizerische Eidgenossenschaft"
        }
    },
    "..."
}
  • New format for country languages:
    • The language property is now an object where keys are ISO 639-3 codes (alpha 3) and values are the name of the language in english.
    • The nativeLanguage property contains the ISO 639-3 code of the language used for the native country names.

Before

{
    "...",
    "language": ["Finnish", "Swedish"],
    "languageCodes": ["fi", "sv"]
    "..."
}

After

{
    "...",
    "nativeLanguage": "fin",
    "languages": {
        "fin": "Finnish",
        "swe": "Swedish"
    },
    "..."
}
  • The keys in the translations property are ISO 639-3 languages codes as well.

Credits to @herrniemand and @petert82 for the original idea and help on this.

Added

  • add official names in english and in the country native language
  • add TLD's for Tailand, Taiwan, Syria, Sri Lanka, South Korea, Singapore, Algeria, Jordan, Morocco, Palestine and Qatar

    Build

  • update the convertArrays function to handle multi dimensionnal arrays

    Fixed

  • fix data for Saint Kitts and Nevis
  • fix demonym for Niger
  • fix broken link in README update examples
  • fix Thailand borders
  • fix Senegal borders

[v1.5.1] - 2014-07-31

Fixed

  • fix data for Israel
  • fix data for Sint Maarten
  • fix data for Saint Martin
  • fix Bolivia borders (PER instead of PRU)

[v1.5] - 2014-07-30

Breaking changes

  • remove Ascension Island (merged with Saint Helena, see #57)

    Added

  • add countries GeoJSON outline (example https://github.com/mledoze/countries/blob/4251a5f95d5255a913a397d831dd75080e370f33/data/deu.geo.json)
  • add russian translations for all countries (thanks @eugene-lazarev)
  • add unescaped JSON version
  • add "How to contribute" section in README
  • This project is now available as a NPM package: https://www.npmjs.org/package/world-countries

    Fixed

  • fix Libya CCA3 in Algeria's borders
  • fix russian translations, replace \x20 and \x2d with a space and a hyphen
  • fix calling code for Vatican City
  • fix data for Hong Kong
  • fix language and language codes for Norway (fix #56)
  • remove BRA-FRA, SUR-FRA, MAF-NED borders for Brazil, Suriname and France

[v1.4] - 2014-05-07

Breaking changes

  • remove population data (see #6)
  • rename Côte d'Ivoire to Ivory Coast

    Added

  • add area data in km²
  • add countries flag in SVG format (see data folder, source: https://github.com/tinata/tinatapi)
  • add welsh translations
  • add Ascension Island
  • add showcase section in README
  • add CONTRIBUTING

    Fixed

  • fix missing borders, latitude/longitude and language codes
  • fix encoding of accented characters in translations
  • fix native names for countries with right-to-left language
  • fix/reorder language codes for some countries
  • fix spanish translation of Chad
  • fix language for Egypt
  • fix denonym for United Arab Emirates
  • fix region and subregion for Cyprus

[v1.3] - 2014-02-22

Breaking changes

  • remove english translations since they are redundant with the name parameter
  • rename languagesCodes to languageCodes

    Build

  • move generated files to the dist folder
  • prettify JSON source to ease the contributions
  • add script to generate other formats (the source is the JSON file)

    Added

  • add geolocation, population, borders and demonym data
  • add language codes and translations for multiple countries
  • add Republic of Kosovo (#27)
  • add missing population field for some countries (-1 is used if there is no data)

    Fixed

  • fix many type inconsistencies
  • fix/add translations, mainly french
  • fix NL translation of Macedonia
  • fix currency for Colombia and Mexico
  • fix denonym for Åland Islands
  • fix null values for latitude/longitude
  • rename Macao to Macau
  • convert multiple values to real JSON arrays

[v1.2] - 2013-11-18

Added

  • add license (Open Database License)
  • add country native name in its native language
  • add country official language(s) in english
  • add alt spellings: official country name in english and in its official language(s)
  • add region and subregion for Bonaire, Sint Maarten and South Sudan
  • add capital for British Indian Ocean Territory, Micronesia, Réunion, South Georgia, Virgin Islands (British) and Virgin Islands (U.S.)
  • add currency for Palestinian Territory
  • add examples in README

    Changed

  • change TLD for the UK from .gb to .uk
  • use camelCase in countries.json
  • rename Brunei Darussalam to Brunei
  • rename Falkland Islands (Malvinas) to Falkland Islands
  • rename French Southern Territories to French Southern and Antarctic Lands
  • rename Myanmar (Burma) to Myanmar (added Burma in alt-spellings)
  • rename Palestinian Territory to Palestine
  • rename Pitcairn to Pitcairn Islands
  • rename Russian Federation to Russia
  • rename Syrian Arab Republic to Syria
  • rename Virgin Islands (British) to British Virgin Islands
  • rename Virgin Islands (U.S.) to United States Virgin Islands

    Fixed

  • fix alt spellings for Czech Republic
  • fix typo in Canada's and Russia's capital
  • fix currency and alt-spelling for Slovakia
  • fix currency code for Solomon Islands, Somalia and South Africa
  • fix South Georgia currency
  • fix relevance for Åland Islands and Finland
  • fix ccn3 padding
  • fix subregion for Brunei Darussalam, Cambodia, Indonesia, Laos, Malaysia, Myanmar, Philippines, Singapore, Thailand, Timor-Leste and Vietnam
  • fix TLD for Bonaire, Heard and McDonald Islands, Kazakhstan and Saint Martin
  • fix capital for Moldova
  • fix alt-spellings for United Kingdom

[v1.1] - 2013-10-05

Added

  • add capital cities

    Fixed

  • fix accented characters encoding in JSON file

[v1.0] - 2013-07-26

Added

  • initial release