Giter Site home page Giter Site logo

assetcorp / covid-stats Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.42 MB

Coronavirus COVID-19 live updates. Provides API access and a webpage for simple user-interaction.

Home Page: https://covid.delalify.com/

License: GNU General Public License v3.0

JavaScript 99.07% CSS 0.88% HTML 0.05%
covid-19 nodejs coronavirus coronavirus-api coronavirus-tracking nextjs reactjs

covid-stats's Introduction

COVID STATS

Coronavirus COVID-19 live updates. Provides API access and a webpage for simple user-interaction.

Visit COVID STATS to view website.

API REFERENCE

The API URI endpoint for all routes is https://covid.delalify.com/api/. Responses are served via HTTPS and all responses are of the form:

{
 "error": false,
 "status": 200,
 "message": "",
 "response": {}
}

API ROUTES

GET GLOBAL LATEST DATA

Send a GET request to http://covid.delalify.com/api/latest

>> GET http://covid.delalify.com/api/latest

{
 "error": false,
 "status": 200,
 "message": "",
 "response": {
    "confirmed": 1196944,
    "recovered": 246110,
    "deaths": 64577,
    "active": 886257,
    "lastUpdated": "2020-04-04T22:07:08.204Z"
  }
}

GET COUNTRIES DATA

Send a GET request to http://covid.delalify.com/api/countries to get data for all countries

>> GET http://covid.delalify.com/api/countries

{
 "error": false,
 "status": 200,
 "message": "",
 "response": [
    {
      "confirmed": 309728,
      "confirmedToday": 32567,
      "recovered": 14741,
      "deaths": 8441,
      "deathsToday": 1037,
      "country": "USA",
      "countryCode": "USA",
      "confirmedByDay": [],
      "recoveredByDay": [],
      "deathsByDay": [],
      "lastUpdated": "2020-04-04T23:07:07.251Z",
      "active": 286546,
      "critical": 8206,
      "mortalityPer": "2.73",
      "recoveredPer": "4.76"
    }
  ]
}

Send a GET request to http://covid.delalify.com/api/countries/GH to get data for a single country with country code GH

You can obtain the country code from all countries data as described above.

>> GET http://covid.delalify.com/api/countries/GH

{
  "error": false,
  "status": 200,
  "message": "",
  "response": {
    "confirmed": 205,
    "confirmedToday": 0,
    "recovered": 31,
    "deaths": 5,
    "deathsToday": 0,
    "country": "Ghana",
    "countryCode": "GH",
    "confirmedByDay": [],
    "recoveredByDay": [],
    "deathsByDay": [],
    "lastUpdated": "2020-04-04T22:15:12.566968Z",
    "active": 169,
    "critical": 2,
    "mortalityPer": "2.44",
    "recoveredPer": "15.12"
    }
  }
}

GET GENERAL DATA

Send a GET request to http://covid.delalify.com/api/general to get all data in the system covering all countries and locations. This route is useful if you want to get records pertaining to not just countries, but locations.

The data is grouped according to latest, confirmed, recovered, and deaths.

>> GET http://covid.delalify.com/api/general

{
 "error": false,
 "status": 200,
 "message": "",
 "response": {
    "latest": {
      "confirmed": 1196944,
      "recovered": 246110,
      "deaths": 64577,
      "active": 886257,
      "lastUpdated": "2020-04-04T22:07:08.204Z"
    },
    "confirmed": [
      {
        "country": "Afghanistan",
        "country_code": "AF",
        "province": "",
        "coordinates": {
          "lat": "33.0",
          "long": "65.0"
        },
        "history": {},
        "latest": 281,
      }
    ],
    "recovered": [
      {
        "country": "Afghanistan",
        "country_code": "AF",
        "province": "",
        "coordinates": {
          "lat": "33.0",
          "long": "65.0"
        },
        "history": {},
        "latest": 10,
      }
    ],
    "deaths": [
      {
        "country": "Afghanistan",
        "country_code": "AF",
        "province": "",
        "coordinates": {
          "lat": "33.0",
          "long": "65.0"
        },
        "history": {},
        "latest": 6,
      },
    ]
  }
}

API SOURCES

There are 2 major API sources used in the project. The first is from @javieraviles covidAPI. I rely on data from this project to provide information on all affected countries. The second source is from @ExpDev coronavirus-tracker-api. I use data from this project to handle location information for all affected places.

I conjoin data from these sources to store them in a database. I update the database with the fetched data every hour to ensure that updates are served without too much delay.

These 2 projects also pull data from one or more of the following sources:

World Health Organization (WHO) Ghana Health Service China CDC (CCDC) US CDC Government of Canada Australia Government Department of Health European Centre for Disease Prevention and Control (ECDC) Italy Ministry of Health 1Point3Arces WorldoMeters

covid-stats's People

Contributors

assetcorp avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.