Skip to content

aitahtman/coronavirus-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coronavirus-api

api dedicated to serve Coronavirus data

License: MIT HitCount

Data source

the Data (csv files) used on this API is provided by the Center for Systems Science and Engineering of Jhons Hopkins university repository link

Installation

After cloning the repo, run npm install to get all dependencies related to this work.

## Execution

When all dependencies are installed, execute npm start to run the API.

Usage

To get only summarized data with evolution stats of the confirmed cases,deaths and recovered , use the route localhost:8080\getData with GET method

{
   "current": [
      {
         "province": "Anhui",
         "country": "Mainland China",
         "lat": "31.8257",
         "long": "117.2264",
         "date": "3/3/20",
         "Confirmed": "990",
         "Deaths": "6",
         "Recovered": "936"
      },
      {
         "province": "Beijing",
         "country": "Mainland China",
         "lat": "40.1824",
         "long": "116.4142",
         "date": "3/3/20",
         "Confirmed": "414",
         "Deaths": "8",
         "Recovered": "288"
      }
      
   ],
   //  with evolution stats of the confirmed cases,deaths and recovered 

   "stats": {
        "Confirmed": [
            {
                "date": "1/22/20",
                "value": 555
            },
            {
                "date": "1/23/20",
                "value": 653
            },
            {
                "date": "1/24/20",
                "value": 941
            }
        ],
        "Deaths":[ ]
}
} 

For getting times series and summarized data, use the route localhost:8080\getDataHisto with GET method

{
   "Confirmed":{
      "histo":[
         {
            "province":"Anhui",
            "country":"Mainland China",
            "lat":"31.8257",
            "long":"117.2264",
            "date":"1/22/20",
            "value":"1"
         },
         {
            "province":"Anhui",
            "country":"Mainland China",
            "lat":"31.8257",
            "long":"117.2264",
            "date":"1/24/20",
            "value":"15"
         }
      ],
      "current":[
         {
            "province":"Anhui",
            "country":"Mainland China",
            "lat":"31.8257",
            "long":"117.2264",
            "date":"3/2/20",
            "value":"990"
         },
         {
            "province":"Beijing",
            "country":"Mainland China",
            "lat":"40.1824",
            "long":"116.4142",
            "date":"3/2/20",
            "value":"414"
         }
      ]
   },
   "Deaths":{
      "histo":[

      ],
      "current":[

      ]
   }
}

Contributing

All bug reports and pull requests are welcome.

## CHANGE TRACKER

  • March 22, 2020 : Recovered cases variable is no longer updated

About

api dedicated to serve Coronavirus data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published