Inspiration
I was inspired by the other API wrappers I saw so I decided to make a C# API wrapper for the Coronavirus tracking API
What it does
It fetches the data from the Coronavirus tracking API and let's the developers easily integrate the data into their projects
How we built it
We use .NET and C# plus the libraries RestSharp and Newtonsoft.Json
Accomplishments that we're proud of
The fact that we've made a project that will make other developers jobs easier while helping others to get the numbers and not stay in the dark
What's next for CovidSharp
We'll try to keep up with the API and add support when it introduces new data entries
Usage
CoronavirusData data = new CoronavirusData();
Console.WriteLine("Confirmed: " + data.LatestConfirmed());
Console.WriteLine("Recovered: " + data.LatestRecovered());
Console.WriteLine("Deaths: " + data.LatestDeaths());
// Fetches the latest data of a country code.
string country_code = "DK";
Console.WriteLine("Denmark Confirmed: " + data.FromCountryCodeConfirmed(country_code));
Console.WriteLine("Denmark Recovered: " + data.FromCountryCodeRecovered(country_code));
Console.WriteLine("Denmark Deaths: " + data.FromCountryCodeDeaths(country_code));
Console.WriteLine("Denmark population: " + data.FromCountryCodePopulation(country_code));
// Fetches data of a country Name.
string country_name = "China";
Console.WriteLine("China Confirmed: " + data.FromCountryNameConfirmed(country_name));
Console.WriteLine("China Recovered: " + data.FromCountryNameRecovered(country_name));
Console.WriteLine("China Deaths: " + data.FromCountryNameDeaths(country_name));
Console.WriteLine("China population: " + data.FromCountryNamePopulation(country_name));
//Fetches the data of the Country/province associated with the ID
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"));
// Fetches lists of data, if not defined the default source will be jhu
Console.WriteLine(data.GetCountryList());
Console.WriteLine(data.GetPopulationList());
Console.WriteLine(data.GetProvinceList());
Console.WriteLine(data.GetCountyList("csbs")); //The source is set to csbs
Log in or sign up for Devpost to join the conversation.