In this article, Let me show you my open source Nuget package RESTCountries.NET developed in .NET Standard.
htpps://restcountries.eu is a RESTful API which provides information about countries such as name , capital city , population , currencies ,borders info , languages , flag , calling codes , etc.
With RESTCountries.NET , we can:
- Retrieve a list of countries.
- Get a list of country names in others languages such as German , Spanish , French , Italian, Portuguese, Dutch, Croatian , Japanese , Breton , and Persian language.
- Search by country name.
- Search by capital city.
- Search by ISO 4217 currency code.
- Search by continent: Africa, Americas, Asia, Europe, Oceania.
- Search by regional bloc.
- Apply filters to retrieve what we need.
- The library is available on NuGet at https://www.nuget.org/packages/RESTCountries.NET/
- Install it into your .NET project(.NET Standard, .NET Core, Xamarin, etc).
- Add namespace
- Get all countries
- Get a list of country names
Country names are in English by default.
- Retrieve a list of country names in Spanish
Available languages are: de(German language), es(Spanish language), fr(French language), ja(Japanese language), it(Italian language), br(Breton language), pt(Portuguese language), nl(Dutch language), hr(Croatian language) and fa(Persian language).
- Search by country partial name or full name
The first method could return a list of countries or a list of one element.
- Search by continent: Africa, Americas, Asia, Europe, Oceania
Possibles values of “continent” are Africa, Americas, Asia, Europe and Oceania.
For more information, check out the full documentation at https://github.com/egbakou/RESTCountries.NET
In web applications(.NET or .NET Core) RESTCountries.NET allows us to populate country select tag options dynamically. Populate Xamarin Picker with a list of countries become easy.