Nager.Country provides a comprehensive dataset of worldwide country information, designed for developers who need reliable and structured country-related data.
The dataset includes 250 countries and territories with detailed information such as:
- β Official country names
- π ISO 3166 Alpha-2, Alpha-3, and numeric country codes
- π± Associated currencies and ISO 4217 currency codes
- π£οΈ Official and spoken languages (ISO 639)
- π Continent and subregion classification
- π Country borders
- π Translations in multiple languages
You can access the data in two formats:
- Via NuGet package β ideal for .NET applications
- As a downloadable ZIP archive containing structured JSON files (latest zip package)
Perfect for projects that require up-to-date and standardized country data, such as:
- International e-commerce systems
- Travel and booking platforms
- Localization (i18n) features
- Data validation and enrichment
- Geographic analytics and reporting
Below is a sample JSON structure returned for the country Austria (AT
).
This data is available via the NuGet package or as part of the JSON export.
{
"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 project is available as NuGet packages for easy integration into any .NET application.
PM> install-package Nager.Country
Provides localized country names (translations in multiple languages).
PM> install-package Nager.Country.Translation
Retrieve a full list of all 250 countries and territories.
var countryProvider = new CountryProvider();
var countries = countryProvider.GetCountries();
Get detailed information by specifying the official English country name.
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...
Enables country name lookup using translations (e.g. "Germania" instead of "Germany").
β‘οΈ Requires the translation 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...
Translate the official country name into a desired language.
β‘οΈ Requires the translation package Nager.Country.Translation
var translationProvider = new TranslationProvider();
var translatedCountryName = translationProvider.GetCountryTranslatedName(Alpha2Code.DE, LanguageCode.EN);
//translatedCountryName -> Germany
List all language codes available for translation purposes. β‘οΈ Requires the translation package Nager.Country.Translation
var translationProvider = new TranslationProvider();
var languages = translationProvider.GetLanguages();
Here are some useful projects that also provide country-related data, validation, or localization features:
Language | Project |
---|---|
* | mledoze countries |
* | umpirsky country-list |
* | dr5hn countries-states-cities-database |
javascript | michaelwittig node-i18n-iso-countries |
.net | anghelvalentin CountryValidator |