Coder Social home page Coder Social logo

ngrcovid19api's Introduction

NIGERIA COVID19 API

This is a full covid19 data API for nigeria with full timeline.

Source:

Live at https://covid19ngr.herokuapp.com

REST API

The endpoints to the API is described below.

Get latest totals

Request

GET /api/totals/

curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/totals/

Response

{
    "data":
    {
        "confirmedCases": Number,
        "activeCases": Number,
        "discharged": Number,
        "death": Number,
        "samplesTested": Number
    }
}

Get latest totals for all states

Request

GET /api/states/

curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/states/

Response

{
    "data":
        [
            {
                "state": String,
                "confirmedCases": Number,
                "activeCases": Number,
                "discharged": Number,
                "death": Number
            },
            {
                "state": String,
                "confirmedCases": Number,
                "activeCases": Number,
                "discharged": Number,
                "death": Number
            },
            ....
        ]
 }

Get latest totals for a state

Request

GET /api/states/:statename

curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/states/lagos

Response

{
    "data":
        {
            "state": String,
            "confirmedCases": Number,
            "activeCases": Number,
            "discharged": Number,
            "death": Number
        }
}

Get timeline

Request

GET /api/timelines/

curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/timelines/

Response

{
    "data":
        [
            {
                "dailyConfirmed": 1,
                "dailyDeceased": 0,
                "dailyRecovered": 0,
                "date": "2020-02-27",
                "totalConfirmed": 1,
                "totalDeath": 0,
                "totalDischarged": 0
            },
            {
                "dailyConfirmed": 0,
                "dailyDeceased": 0,
                "dailyRecovered": 0,
                "date": "2020-02-28",
                "totalConfirmed": 1,
                "totalDeath": 0,
                "totalDischarged": 0
            },
            ...
        ]
  }

Get timeline with date range

Query

  • from = Date format: YYYY-MM-DD
  • to = Date format: YYYY-MM-DD

Request

GET /api/timelines?from=2020-02-29&to=2020-03-02

curl -i -H 'Accept: application/json' \
https://covid19ngr.herokuapp.com/api/timelines?from=2020-02-29&to=2020-03-02

Response

{
    "data":
        [
            {
                "dailyConfirmed":0,
                "dailyDeceased":0,
                "dailyRecovered":0,
                "date":"2020-02-29T00:00:00.000Z",
                "totalConfirmed":1,
                "totalDeath":0,
                "totalDischarged":0
            },
            {
                "dailyConfirmed":0,
                "dailyDeceased":0,
                "dailyRecovered":0,
                "date":"2020-03-01T00:00:00.000Z",
                "totalConfirmed":1,
                "totalDeath":0,
                "totalDischarged":0
            },
            {
                "dailyConfirmed":0,
                "dailyDeceased":0,
                "dailyRecovered":0,
                "date":"2020-03-02T00:00:00.000Z",
                "totalConfirmed":1,
                "totalDeath":0,
                "totalDischarged":0
            }
        ]
 }

Contribution

Wanna contribute? Amazing...

This API uses Node.js and the Express.Js web application framework.

Read this guide The beginner's guide to contributing to a GitHub project

Install the app, write your feature and make your pull request.

Todo

  • Timeline for all states
  • Tests
  • Send mail to admin if cron job fails

ngrcovid19api's People

Contributors

ethical-ralph 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.