Get information about countries via a RESTful API https://restcountries.eu
570€ per year aprox. is the cost to maintain and update REST Countries. Please help me cover these costs so I can keep improving this service.
Follow RESTCountries on Twitter
Or subscribe to the mailing list
Below are described the REST endpoints available that you can use to search for countries
https://restcountries.eu/rest/v2/all
Search by country name. It can be the native name or partial name
https://restcountries.eu/rest/v2/name/{name}
https://restcountries.eu/rest/v2/name/eesti
https://restcountries.eu/rest/v2/name/united
Search by country full name
https://restcountries.eu/rest/v2/name/{name}?fullText=true
https://restcountries.eu/rest/v2/name/aruba?fullText=true
Search by ISO 3166-1 2-letter or 3-letter country code
https://restcountries.eu/rest/v2/alpha/{code}
https://restcountries.eu/rest/v2/alpha/co
https://restcountries.eu/rest/v2/alpha/col
Search by list of ISO 3166-1 2-letter or 3-letter country codes
https://restcountries.eu/rest/v2/alpha?codes={code};{code};{code}
https://restcountries.eu/rest/v2/alpha?codes=col;no;ee
Search by ISO 4217 currency code
https://restcountries.eu/rest/v2/currency/{currency}
https://restcountries.eu/rest/v2/currency/cop
Search by ISO 639-1 language code
https://restcountries.eu/rest/v2/lang/{et}
https://restcountries.eu/rest/v2/lang/es
Search by capital city
https://restcountries.eu/rest/v2/capital/{capital}
https://restcountries.eu/rest/v2/capital/tallinn
Search by calling code
https://restcountries.eu/rest/v2/callingcode/{callingcode}
https://restcountries.eu/rest/v2/callingcode/372
Search by region: Africa, Americas, Asia, Europe, Oceania
https://restcountries.eu/rest/v2/region/{region}
https://restcountries.eu/rest/v2/region/europe
https://restcountries.eu/rest/v2/name/afghanistan
[{
"name": "Afghanistan",
"topLevelDomain": [".af"],
"alpha2Code": "AF",
"alpha3Code": "AFG",
"callingCodes": ["93"],
"capital": "Kabul",
"altSpellings": ["AF", "Afġānistān"],
"region": "Asia",
"subregion": "Southern Asia",
"translations": {
"de": "Afghanistan",
"es": "Afganistán",
"fr": "Afghanistan",
"ja": "アフガニスタン",
"it": "Afghanistan"
},
"population": 27657145,
"latlng": [33.0, 65.0],
"demonym": "Afghan",
"area": 652230.0,
"gini": 27.8,
"timezones": ["UTC+04:30"],
"borders": ["IRN", "PAK", "TKM", "UZB", "TJK", "CHN"],
"nativeName": "افغانستان",
"numericCode": "004",
"currencies": [{
"code": "AFN",
"name": "Afghan afghani",
"symbol": "؋"
}],
"languages": [{
"iso639_1": "ps",
"iso639_2": "pus",
"name": "Pashto",
"nativeName": "پښتو"
}, {
"iso639_1": "uz",
"iso639_2": "uzb",
"name": "Uzbek",
"nativeName": "Oʻzbek"
}, {
"iso639_1": "tk",
"iso639_2": "tuk",
"name": "Turkmen",
"nativeName": "Türkmen"
}]
}]
You can filter the output of your request to include only the specified fields.
https://restcountries.eu/rest/v2/{service}?fields={field};{field};{field}
https://restcountries.eu/rest/v2/all?fields=name;capital;currencies