Coder Social home page Coder Social logo

raamyy / covidtrackerapiwrapper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdirahiim/covidtrackerapiwrapper

0.0 1.0 1.0 8.25 MB

CovidSharp a C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)

License: MIT License

C# 100.00%

covidtrackerapiwrapper's Introduction

CovidSharp

All Contributors NuGet NuGet GitHub stars GitHub forks HitCount

CovidSharp is a C# API wrapper for the Coronavirus tracking API

Installation

You can install it as a nuget package

Usage

Call the Library

using CovidSharp;
  • Declares the instance of the library
CoronavirusData data = new CoronavirusData();

Get the Latest Data

  • Fetches the latest worldwide data
 Console.WriteLine("Confirmed: " + data.LatestConfirmed());
 Console.WriteLine("Recovered: " + data.LatestRecovered());
 Console.WriteLine("Deaths: " + data.LatestDeaths());

Get Data by country code

  • Use a country code and fetch the latest data of that country
 Console.WriteLine("Denmark Confirmed: " + data.FromCountryConfirmed("DK"));
 Console.WriteLine("Denmark Recovered: " + data.FromCountryRecovered("DK"));
 Console.WriteLine("Denmark Deaths: " + data.FromCountryDeaths("DK"));

Get Data by country name

  • Use a country code and fetch the latest data of that country
   Console.WriteLine("China Confirmed: " + data.FromCountryNameConfirmed("China"));
   Console.WriteLine("China Recovered: " + data.FromCountryNameRecovered("China"));
   Console.WriteLine("China Deaths: " + data.FromCountryNameDeaths("China"));

Get Data by ID

You can use the associated ID of a province or country to get the desired information You can find countries IDs here

  • This code gets the latest data of Denmark using ID instead of a country code
 Console.WriteLine("Denmark ID Confirmed: " + data.FromIDConfirmed("94"));
 Console.WriteLine("Denmark  ID Recovered: " + data.FromCountryRecovered("94"));
 Console.WriteLine("Denmark ID Deaths: " + data.FromCountryDeaths("94"));
  • Get the province name associated with an ID, in this case the ID of 92 is associated with the Faroe Islands province
  Console.WriteLine("Name of the Faroe Islands: " + data.FromIDProvince("92"));
  • Get the country name associated with an ID, in this case the ID of 92 is associated with the Faroe Islands province
  Console.WriteLine("Name of the country of the Faroe Islands: " + data.FromIDCountry("92"));
  • Get the latitude associated with an ID
  Console.WriteLine("Denmark Latitude: " + data.FromIDLatitude("94"));
  • Get the longitude associated with an ID
  Console.WriteLine("Denmark Longtitude: " + data.FromIDLongitude("94"));

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Abdirahiim Yassin

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿšง

HaseeB Mir

๐Ÿ’ป ๐Ÿ’ก

This project follows the all-contributors specification. Contributions of any kind welcome!

covidtrackerapiwrapper's People

Watchers

 avatar

Forkers

fady-nabil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.