All Projects → egbakou → RESTCountries.NET

egbakou / RESTCountries.NET

Licence: MIT license
.NET Standard wrapper library around the API provided by REST Countries https://restcountries.com. The world in .NET 🔥.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to RESTCountries.NET

Rx.Http
A reactive way to make HTTP Request in .NET Core 🚀
Stars: ✭ 62 (+87.88%)
Mutual labels:  dotnet-standard, csharp-library
covidtrackerapiwrapper
CovidSharp is a crossplatform C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)
Stars: ✭ 11 (-66.67%)
Mutual labels:  dotnet-standard, csharp-library
CSLisp
C# Scheme / Lisp implementation for embedding in .NET projects
Stars: ✭ 27 (-18.18%)
Mutual labels:  dotnet-standard, csharp-library
elgamalext
Extension for the .NET Framework cryptography subsystem, which introduces the ElGamal public key cryptosystem with support for homomorphic multiplication.
Stars: ✭ 14 (-57.58%)
Mutual labels:  dotnet-standard, csharp-library
LiteNetwork
A simple and fast .NET networking library compatible with .NET Standard 2, .NET 5, 6 and 7.
Stars: ✭ 66 (+100%)
Mutual labels:  dotnet-standard, csharp-library
travels-api
API for Travels Management - UFLA Comp Jr/20 anniversary event
Stars: ✭ 22 (-33.33%)
Mutual labels:  restful-api
AnomalyDetection
基于智能计算框架nupic的异常检测restful Api.
Stars: ✭ 31 (-6.06%)
Mutual labels:  restful-api
project-3-crm
⭐crm 客户关系管理系统模板⭐一个不错的后台管理种子项目,拥有自由设置角色自由分配权限🔑的权限管理功能,三员管理多员管理均可,前端antd vue admin后端spring-boot-api-seedling 拥有完善的功能。文档包含需求文档,设计文档和测试文档等。同时配置了travis,拥有集成测试和自动构建的功能。
Stars: ✭ 128 (+287.88%)
Mutual labels:  restful-api
cubic
📦 Easy to scale, zero-config, real-time focused app platform for node.js
Stars: ✭ 16 (-51.52%)
Mutual labels:  restful-api
COVID19-Algeria-and-World-Dataset
A COVID-19 dataset with 90 World countries including Algeria.
Stars: ✭ 18 (-45.45%)
Mutual labels:  world
gateCracker
No description or website provided.
Stars: ✭ 20 (-39.39%)
Mutual labels:  restful-api
HelloWorld
About Add any Program in any language you like or add a hello world Program ❣️ if you like give us ⭐
Stars: ✭ 15 (-54.55%)
Mutual labels:  world
dawn-api
A RESTful API package
Stars: ✭ 25 (-24.24%)
Mutual labels:  restful-api
go-onion-architecture-sample
Sample RestAPI project write in Go
Stars: ✭ 40 (+21.21%)
Mutual labels:  restful-api
grapevine
Fast, unopinionated, embeddable, minimalist web framework for .NET
Stars: ✭ 72 (+118.18%)
Mutual labels:  restful-api
egg-RESTfulAPI
基于egg.js2.x的RESTfulAPI风格的项目模板,用于快速构建高性能的服务端。
Stars: ✭ 70 (+112.12%)
Mutual labels:  restful-api
node-server-template
This is Node.js server tidy template / boilerplate with Express (with asyncified handlers, custom error handler) framework and MongoDb. The server use ES6 and above. On different branches you can see different techniques' and technologies' usage, such as Kafka, nodemailer, file download... You also can find postman collections.
Stars: ✭ 116 (+251.52%)
Mutual labels:  restful-api
YuiAPI
一个浏览器API测试客户端,API文档生成器,支持chrome/firefox/新版edge
Stars: ✭ 25 (-24.24%)
Mutual labels:  restful-api
ogen
OpenAPI v3 code generator for go
Stars: ✭ 436 (+1221.21%)
Mutual labels:  restful-api
springboot-bestpractice
SpringBoot best practice architecture. Using Spring Security, Spring Data JPA.
Stars: ✭ 51 (+54.55%)
Mutual labels:  restful-api

IconRESTCountries.NET

This is a .NET wrapper library around the API provided by REST Countries https://restcountries.com (Get information about countries via a RESTful API).

Setup

Note

Add namespace RESTCountries.Services and call RESTCountriesAPI class to access all methods.

Each method returns an object of type Country or a List of Country. You can apply filters on the returned value to retrieve what you need.

Example:

  • Just get the name and capital city of all countries.
  • Get country name in French language or Spanish language.

The default language for the country name is English, but you can also get the name in other languages such as: 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).

Usage

  • Get all countries.
// Get all countries
List<Country> countries = await RESTCountriesAPI.GetAllCountriesAsync();
  • Search by country name. It can be the native name or partial name.
// Search by country name
List<Country> result = await RESTCountriesAPI.GetCountriesByNameContainsAsync(string name);

If partial name, this method could return a list of countries,otherwise a List of one element.

  • Search by country full name.
// Search by country full name
Country result = await RESTCountriesAPI.GetCountryByFullNameAsync(string fullName);
  • Search by ISO 3166-1 2-letter or 3-letter country code.
// Search by list of ISO 3166-1 2-letter or 3-letter country codes
Country result = await RESTCountriesAPI.GetCountryByCodeAsync(string countryCode);
  • Search by a list of ISO 3166-1 2-letter or 3-letter country codes.
// Search by list of ISO 3166-1 2-letter or 3-letter country codes
List<Country> result = await RESTCountriesAPI.GetCountriesByCodesAsync(params string[] codes);
  • Search by ISO 4217 currency code.
// Search by ISO 4217 currency code
List<Country> result = await RESTCountriesAPI.GetCountriesByCurrencyCodeAsync(string currencyCode);
  • Search by ISO 639-1 language code.
// Search by ISO 639-1 language code
List<Country> result = await RESTCountriesAPI.GetCountriesByLanguageCodeAsync(string languageCode);
  • Search by the capital city.
// Search by capital city
var result = await RESTCountriesAPI.GetCountryByCapitalCityAsync(string capitalCity);

You can use var instead of explicit types. I use explicit types to show you the return type of each method.

  • Search by calling code.
// Search by calling code
List<Country> result = await RESTCountriesAPI.GetCountriesByCallingCodeAsync(string callingCode);
  • Search by continent: Africa, Americas, Asia, Europe, Oceania.
//  Search by continent: Africa, Americas, Asia, Europe, Oceania
List<Country> result = await RESTCountriesAPI.GetCountriesByContinentAsync(string continent);
  • Search by regional bloc: EU, EFTA, CARICOM, AU, USAN, EEU, AL, ASEAN , CAIS, CEFTA , NAFTA , SAARC.
//  Search by regional bloc
List<Country> result = await RESTCountriesAPI.GetCountriesByRegionalBlocAsync(string regionalBloc);

EU (European Union), EFTA (European Free Trade Association), CARICOM (Caribbean Community), PA (Pacific Alliance), AU (African Union), USAN (Union of South American Nations), EEU (Eurasian Economic Union), AL (Arab League), ASEAN (Association of Southeast Asian Nations), CAIS (Central American Integration System), CEFTA (Central European Free Trade Agreement), NAFTA (North American Free Trade Agreement), SAARC (South Asian Association for Regional Cooperation).

Apply filters

// Get all countries in Spanish language
var countries = await RESTCountriesAPI.GetAllCountriesAsync();
List<string> countriesInSpanish = countries.Select(c => c.Translations.Es).ToList();

// Get Europe countries in French language
var europeCountries = await RESTCountriesAPI.GetCountriesByContinentAsync("Europe"); ;
List<string> europeCountriesInFrench = europeCountries.Select(c => c.Translations.Fr).ToList();

// Fell free to apply filters 🤓

Country class

public class Country
{    
    // Gets or sets the Name
    public string Name { get; set; }

    // Gets or sets the Top Level Domain
    public IList<string> TopLevelDomain { get; set; }

    // Gets or sets the Alpha2 Code
    public string Alpha2Code { get; set; }

    // Gets or sets the Alpha3 Code
    public string Alpha3Code { get; set; }

    // Gets or sets the Calling Codes
    public IList<string> CallingCodes { get; set; }

    // Gets or sets the Capital City
    public string Capital { get; set; }

    // Gets or sets the Alt Spellings
    public IList<string> AltSpellings { get; set; }    

    // Gets or sets the Region
    public string Region { get; set; }

    // Gets or sets the Subregion
    public string Subregion { get; set; }

    // Gets or sets the Population
    public int Population { get; set; }

    // Gets or sets the Latlng(Latitude and Longitude)
    public IList<double> Latlng { get; set; }

    // Gets or sets the Demonym
    public string Demonym { get; set; }

    // Gets or sets the Area
    public double? Area { get; set; }

    // Gets or sets the Gini
    public double? Gini { get; set; }

    // Gets or sets the Timezones
    public IList<string> Timezones { get; set; }

    // Gets or sets the Borders
    public IList<string> Borders { get; set; }

    // Gets or sets the Native Name
    public string NativeName { get; set; }

    // Gets or sets the Numeric Code
    public string NumericCode { get; set; }

    // Gets or sets the Currencies
    public IList<Currency> Currencies { get; set; }

    // Gets or sets the Languages
    public IList<Language> Languages { get; set; }

    // Gets or sets the Translations
    public Translations Translations { get; set; }

    // Gets or sets the Flag (Svg and PNG format)
    public Flag Flag { get; set; }

    // Gets or sets the Regional Blocs
    public IList<RegionalBloc> RegionalBlocs { get; set; }

    // Gets or sets the Cioc(International Olympic Committee Code)
    public string Cioc { get; set; }
}

Created by: Kodjo Laurent Egbakou

License

The MIT License (MIT) see License file

Contribution

Feel free to create issues and PRs 😃

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].