Skip to content

Corona statistics API. Which can detect your country from your IP address and retrieve current stats.

License

Notifications You must be signed in to change notification settings

nsadisha/covid-stats-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

covid-stats-api

Heroku

About

This is a simple api made with ExpressJs which provides you accurate corona stats.

Documentation

Get covid stats for your country

Request

GET https://stats19.herokuapp.com

This will automatically ditect your country from your ip address and provide current COVID19 stats of your country.

Responce

{
    "Country":"United States of America",
    "CountryCode":"",
    "Province":"",
    "City":"",
    "CityCode":"",
    "Lat":"0",
    "Lon":"0",
    "Confirmed":34054952,
    "Deaths":608815,
    "Recovered":0,
    "Active":33444265,
    "Date":"2021-07-16T00:00:00Z"
}

Get stats for a specific country

Request

GET https://stats19.herokuapp.com/country/in

Provide 2 letter country code after https://stats19.herokuapp.com/country/ and your will get current stats of that country.

Responce

{
    "Country":"India",
    "CountryCode":"",
    "Province":"",
    "City":"",
    "CityCode":"",
    "Lat":"0",
    "Lon":"0",
    "Confirmed":31064908,
    "Deaths":413091,
    "Recovered":30227792,
    "Active":430422,
    "Date":"2021-07-16T00:00:00Z"
}

Get summary

Request

GET https://stats19.herokuapp.com/summary

Responce

{
  "Global": {
    "NewConfirmed": 100282,
    "TotalConfirmed": 1162857,
    "NewDeaths": 5658,
    "TotalDeaths": 63263,
    "NewRecovered": 15405,
    "TotalRecovered": 230845
  },
  "Countries": []
}

Get a list of countries

Request

GET https://stats19.herokuapp.com/countries

Responce

All available countries will be listed.

[
    {"Country":"Nauru","Slug":"nauru","ISO2":"NR"},
    {"Country":"Algeria","Slug":"algeria","ISO2":"DZ"},
    {"Country":"Ghana","Slug":"ghana","ISO2":"GH"},
    {"Country":"Finland","Slug":"finland","ISO2":"FI"},
    {"Country":"France","Slug":"france","ISO2":"FR"},
    {"Country":"Russian Federation","Slug":"russia","ISO2":"RU"},
    {"Country":"Macao, SAR China","Slug":"macao-sar-china","ISO2":"MO"}
]

Get daily stats in a specific country

Request #1

GET https://stats19.herokuapp.com/days/us

Provide country code just after https://stats19.herokuapp.com/days/ and you will get daily stats of the country you provided.

Responce #1

[
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":7,"Deaths":0,"Recovered":0,"Active":24,"Date":"2020-03-01T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":23,"Deaths":5,"Recovered":0,"Active":42,"Date":"2020-03-02T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":19,"Deaths":1,"Recovered":0,"Active":60,"Date":"2020-03-03T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":33,"Deaths":4,"Recovered":0,"Active":89,"Date":"2020-03-04T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":77,"Deaths":1,"Recovered":0,"Active":165,"Date":"2020-03-05T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":53,"Deaths":2,"Recovered":0,"Active":216,"Date":"2020-03-06T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":166,"Deaths":3,"Recovered":0,"Active":379,"Date":"2020-03-07T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":116,"Deaths":4,"Recovered":0,"Active":491,"Date":"2020-03-08T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":75,"Deaths":1,"Recovered":0,"Active":565,"Date":"2020-03-09T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":188,"Deaths":6,"Recovered":1,"Active":746,"Date":"2020-03-10T00:00:00Z"}
]

Request #2

GET https://stats19.herokuapp.com/days/us?cumulative=true

Provide country code just after https://stats19.herokuapp.com/days/ and you will get daily stats(cumulative) of the country you provided.

Responce #2

[
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":55,"Deaths":6,"Recovered":7,"Active":42,"Date":"2020-03-02T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":74,"Deaths":7,"Recovered":7,"Active":60,"Date":"2020-03-03T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":107,"Deaths":11,"Recovered":7,"Active":89,"Date":"2020-03-04T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":184,"Deaths":12,"Recovered":7,"Active":165,"Date":"2020-03-05T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":237,"Deaths":14,"Recovered":7,"Active":216,"Date":"2020-03-06T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":403,"Deaths":17,"Recovered":7,"Active":379,"Date":"2020-03-07T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":519,"Deaths":21,"Recovered":7,"Active":491,"Date":"2020-03-08T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":594,"Deaths":22,"Recovered":7,"Active":565,"Date":"2020-03-09T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":782,"Deaths":28,"Recovered":8,"Active":746,"Date":"2020-03-10T00:00:00Z"},
    {"Country":"United States of America","CountryCode":"","Province":"","City":"","CityCode":"","Lat":"0","Lon":"0","Confirmed":1147,"Deaths":33,"Recovered":8,"Active":1106,"Date":"2020-03-11T00:00:00Z"}
]

Set up

Requirements

Local development

After the above requirements have been met:

1. Clone this repository and cd into it

git clone https://github.com/nsadisha/covid-stats-api.git
cd covid-stats-api

2. Install dependencies

npm install

3. Run the server

npm start

Contributing

This project is open source and welcomes contributions.
Visit the project on GitHub

License

MIT

Disclaimer

No warranty expressed or implied. Software is as is.

About

Corona statistics API. Which can detect your country from your IP address and retrieve current stats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published