Giter Site home page Giter Site 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
            },
            ...
            ...
            ...
        ]
 }

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 national timeline

Request

GET /api/timelines/

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

Response

{
    "data":
        [
            {
                "date": "2020-02-27T00:00:00.000Z",
                "total": 1,
                "totalConfirmed": 1
            },
            {
                "date": "2020-03-09T00:00:00.000Z",
                "total": 1,
                "totalConfirmed": 2
            },
            {
                "date": "2020-03-17T00:00:00.000Z",
                "total": 1,
                "totalConfirmed": 3
            },
            ...
            ...
            ...
        ]
}

Get national 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-27&to=2020-03-17

Response

{
    "data":
        [
            {
                "date": "2020-02-27T00:00:00.000Z",
                "total": 1,
                "totalConfirmed": 1
            },
            {
                "date": "2020-03-09T00:00:00.000Z",
                "total": 1,
                "totalConfirmed": 2
            },
            {
                "date": "2020-03-17T00:00:00.000Z",
                "total": 1,
                "totalConfirmed": 3
            }
        ]

}

Get timeline for all states

Request

GET /api/timelines/states

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

Response

{
    "data":
        [
            {
                "state": String,
                "data": [
                    {
                        "date": Date,
                        "confirmed": Number,
                        "totalConfirmed": Number
                    }
                ]
            }
            ...
            ...
        ]
}

Get timeline for a state

Params

  • statename = String

Request

GET /api/timelines/states/:statename

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

Response

{
    "data":
        [
            {
                "state": String,
                "data": [
                    {
                        "date": Date,
                        "confirmed": Number,
                        "totalConfirmed": Number
                    }
                ]
            }
        ]
}

Get states with confirmed cases on a particular day

Query

  • date = Date format: YYYY-MM-DD

Request

GET /api/timelines/states?date=2020-05-05

curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/timelines/states?date=2020-05-05

Response

{
    "data":
        [
            {
                "state": "borno",
                "data": [
                    {
                        "date": "2020-05-05T00:00:00.000Z",
                        "confirmed": 6,
                        "totalConfirmed": Number
                    }
                ]
            },
            {
                "state": "bauchi",
                "confirmed": [
                    {
                        "date": "2020-05-05T00:00:00.000Z",
                        "confirmed": 3,
                        "totalConfirmed": Number
                    }
                ]
            },
            {
                "state": "sokoto",
                "confirmed": [
                    {
                        "date": "2020-05-05T00:00:00.000Z",
                        "confirmed": 1,
                        "totalConfirmed": Number
                    }
                ]
            },
            ...
            ...
    ]
}

Contribution

Wanna contribute? Amazing...

  1. Give this project a star.

  2. Fork the repo and Read this guide The beginner's guide to contributing to a GitHub project

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

This API uses

  • Node.js - JavaScript Runtime.
  • Express.Js - Web application framework.
  • CheerioJs - Analyze web pages using a jQuery-like syntax.
  • You can view the package.json for more

Issues

Create an issue here

Todo

  • Writing Tests

ngrcovid19api's People

Contributors

ethical-ralph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

makozi

ngrcovid19api's Issues

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.