Home

Awesome

CovidSharp

All Contributors Build status NuGet NuGet GitHub stars GitHub forks HitCount

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

Installation

You can install it as a nuget package

Usage

Call the Library

using CovidSharp;
CoronavirusData data = new CoronavirusData();

Get the Latest Data

 Console.WriteLine("Confirmed: " + data.LatestConfirmed());
 Console.WriteLine("Recovered: " + data.LatestRecovered());
 Console.WriteLine("Deaths: " + data.LatestDeaths());

Get Data by country code

 Console.WriteLine("Denmark Confirmed: " + data.FromCountryConfirmed("DK"));
 Console.WriteLine("Denmark Recovered: " + data.FromCountryRecovered("DK"));
 Console.WriteLine("Denmark Deaths: " + data.FromCountryDeaths("DK"));
 Console.WriteLine("Denmark Population: " + data.FromCountryCodePopulation("DK"));

Get Data by country name

   Console.WriteLine("China Confirmed: " + data.FromCountryNameConfirmed("China"));
   Console.WriteLine("China Recovered: " + data.FromCountryNameRecovered("China"));
   Console.WriteLine("China population: " + data.FromCountryNamePopulation("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

 Console.WriteLine("Denmark ID Confirmed: " + data.FromIDConfirmed("94"));
 Console.WriteLine("Denmark  ID Recovered: " + data.FromCountryRecovered("94"));
 Console.WriteLine("Denmark ID Deaths: " + data.FromCountryDeaths("94"));
  Console.WriteLine("Name of the Faroe Islands: " + data.FromIDProvince("92"));
  Console.WriteLine("Name of the country of the Faroe Islands: " + data.FromIDCountry("92"));
  Console.WriteLine("Denmark Latitude: " + data.FromIDLatitude("94"));
  Console.WriteLine("Denmark Longtitude: " + data.FromIDLongitude("94"));
   Console.WriteLine("Denmark Population: " + data.FromIDPopulation("94"));

Get a list of data

You can easily fetch a list of your desired data, the default source is always jhs

  Console.WriteLine(data.GetCountryList());
  Console.WriteLine(data.GetPopulationList());
  Console.WriteLine(data.GetProvinceList());
  Console.WriteLine(data.GetCountyList("csbs"));

Contributors ✨

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://github.com/Abdirahiim"><img src="https://avatars0.githubusercontent.com/u/13730460?v=4" width="100px;" alt=""/><br /><sub><b>Abdirahiim Yassin </b></sub></a><br /><a href="https://github.com/Abdirahiim/covidtrackerapiwrapper/commits?author=Abdirahiim" title="Code">💻</a> <a href="https://github.com/Abdirahiim/covidtrackerapiwrapper/commits?author=Abdirahiim" title="Documentation">📖</a> <a href="#example-Abdirahiim" title="Examples">💡</a> <a href="#maintenance-Abdirahiim" title="Maintenance">🚧</a> <a href="https://github.com/Abdirahiim/covidtrackerapiwrapper/commits?author=Abdirahiim" title="Tests">⚠️</a></td> <td align="center"><a href="https://github.com/haseeb-heaven"><img src="https://avatars0.githubusercontent.com/u/11544739?v=4" width="100px;" alt=""/><br /><sub><b>HaseeB Mir</b></sub></a><br /><a href="https://github.com/Abdirahiim/covidtrackerapiwrapper/commits?author=haseeb-heaven" title="Code">💻</a> <a href="#example-haseeb-heaven" title="Examples">💡</a></td> <td align="center"><a href="https://github.com/Raamyy"><img src="https://avatars3.githubusercontent.com/u/29176293?v=4" width="100px;" alt=""/><br /><sub><b>Ramy Gamal</b></sub></a><br /><a href="https://github.com/Abdirahiim/covidtrackerapiwrapper/commits?author=Raamyy" title="Documentation">📖</a></td> <td align="center"><a href="https://jacobtonder.dk"><img src="https://avatars1.githubusercontent.com/u/13803549?v=4" width="100px;" alt=""/><br /><sub><b>Jacob Tønder</b></sub></a><br /><a href="#maintenance-jacobtonder" title="Maintenance">🚧</a></td> <td align="center"><a href="https://github.com/Aleksey-Nikonov"><img src="https://avatars2.githubusercontent.com/u/11257605?v=4" width="100px;" alt=""/><br /><sub><b>Aleksey-Nikonov</b></sub></a><br /><a href="#ideas-Aleksey-Nikonov" title="Ideas, Planning, & Feedback">🤔</a></td> </tr> </table> <!-- markdownlint-enable --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

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