The Worldwide Country Informations are available over the nuget
package or as json
in the zip package. The collection contains the Informations for 250 Countries.
Example Data
{
"commonName": "Austria",
"officialName": "Republic of Austria",
"nativeName": "Österreich",
"translations": [
{
"languageCode": "EN",
"name": "Austria"
},
{
"languageCode": "ES",
"name": "Austria"
},
{
"languageCode": "FR",
"name": "Autriche"
},
...
],
"alpha2Code": "AT",
"alpha3Code": "AUT",
"numericCode": 40,
"tld": [
".at"
],
"region": "Europe",
"subRegion": "Western Europe",
"borderCountries": [
"CZ",
"DE",
"HU",
"IT",
"LI",
"SK",
"SI",
"CH"
],
"currencies": [
{
"symbol": "€",
"singular": "euro",
"plural": "euro",
"isoCode": "EUR",
"numericCode": "978",
"name": "Euro"
}
],
"callingCodes": [
"43"
]
}
The package is available via NuGet
PM> install-package Nager.Country
PM> install-package Nager.Country.Translation
var countryProvider = new CountryProvider();
var countries = countryProvider.GetCountries();
var countryProvider = new CountryProvider();
var countryInfo = countryProvider.GetCountryByName("Germany");
//countryInfo.Alpha2Code -> DE
//countryInfo.Alpha3Code -> DEU
//countryInfo.NumericCode -> 276
//countryInfo.Region -> Europe
//countryInfo.SubRegion -> WesternEurope
//countryInfo...
Require the translation package Install-Package Nager.Country.Translation
var countryProvider = new CountryProvider();
var countryInfo = countryProvider.GetCountryByNameConsiderTranslation("Germania"); // <- Germany
//countryInfo.Alpha2Code -> DE
//countryInfo.Alpha3Code -> DEU
//countryInfo.NumericCode -> 276
//countryInfo.Region -> Europe
//countryInfo.SubRegion -> WesternEurope
//countryInfo...
Get the name of the country in the requested language (nuget -> Nager.Country.Translation)
var translationProvider = new TranslationProvider();
var translatedCountryName = translationProvider.GetCountryTranslatedName(Alpha2Code.DE, LanguageCode.EN);
//translatedCountryName -> Germany
Get all Languages (nuget -> Nager.Country.Translation)
var translationProvider = new TranslationProvider();
var languages = translationProvider.GetLanguages();
Language | Project |
---|---|
* | mledoze countries |
* | umpirsky country-list |
* | dr5hn countries-states-cities-database |
javascript | michaelwittig node-i18n-iso-countries |
.net | anghelvalentin CountryValidator |