项目作者: aitahtman

项目描述 :
api dedicated to serve Coronavirus data
高级语言: JavaScript
项目地址: git://github.com/aitahtman/coronavirus-api.git
创建时间: 2020-02-08T11:26:21Z
项目社区:https://github.com/aitahtman/coronavirus-api

开源协议:MIT License

下载


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

  1. {
  2. "current": [
  3. {
  4. "province": "Anhui",
  5. "country": "Mainland China",
  6. "lat": "31.8257",
  7. "long": "117.2264",
  8. "date": "3/3/20",
  9. "Confirmed": "990",
  10. "Deaths": "6",
  11. "Recovered": "936"
  12. },
  13. {
  14. "province": "Beijing",
  15. "country": "Mainland China",
  16. "lat": "40.1824",
  17. "long": "116.4142",
  18. "date": "3/3/20",
  19. "Confirmed": "414",
  20. "Deaths": "8",
  21. "Recovered": "288"
  22. }
  23. ],
  24. // with evolution stats of the confirmed cases,deaths and recovered
  25. "stats": {
  26. "Confirmed": [
  27. {
  28. "date": "1/22/20",
  29. "value": 555
  30. },
  31. {
  32. "date": "1/23/20",
  33. "value": 653
  34. },
  35. {
  36. "date": "1/24/20",
  37. "value": 941
  38. }
  39. ],
  40. "Deaths":[ ]
  41. }
  42. }

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

  1. {
  2. "Confirmed":{
  3. "histo":[
  4. {
  5. "province":"Anhui",
  6. "country":"Mainland China",
  7. "lat":"31.8257",
  8. "long":"117.2264",
  9. "date":"1/22/20",
  10. "value":"1"
  11. },
  12. {
  13. "province":"Anhui",
  14. "country":"Mainland China",
  15. "lat":"31.8257",
  16. "long":"117.2264",
  17. "date":"1/24/20",
  18. "value":"15"
  19. }
  20. ],
  21. "current":[
  22. {
  23. "province":"Anhui",
  24. "country":"Mainland China",
  25. "lat":"31.8257",
  26. "long":"117.2264",
  27. "date":"3/2/20",
  28. "value":"990"
  29. },
  30. {
  31. "province":"Beijing",
  32. "country":"Mainland China",
  33. "lat":"40.1824",
  34. "long":"116.4142",
  35. "date":"3/2/20",
  36. "value":"414"
  37. }
  38. ]
  39. },
  40. "Deaths":{
  41. "histo":[
  42. ],
  43. "current":[
  44. ]
  45. }
  46. }

Contributing

All bug reports and pull requests are welcome.

CHANGE TRACKER

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