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