This is a full covid19 data API for nigeria with full timeline.
Source:
Live at https://covid19ngr.herokuapp.com/
The endpoints to the API is described below.
GET /api/totals/
curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/totals/
{
"data":
{
"confirmedCases": Number,
"activeCases": Number,
"discharged": Number,
"death": Number,
"samplesTested": Number
}
}
GET /api/states/
curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/states/
{
"data":
[
{
"state": String,
"confirmedCases": Number,
"activeCases": Number,
"discharged": Number,
"death": Number
},
...
...
...
]
}
GET /api/states/:statename
curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/states/lagos
{
"data":
{
"state": String,
"confirmedCases": Number,
"activeCases": Number,
"discharged": Number,
"death": Number
}
}
GET /api/timelines/
curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/timelines/
{
"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
},
...
...
...
]
}
- from =
Date
format: YYYY-MM-DD - to =
Date
format: YYYY-MM-DD
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
{
"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 /api/timelines/states
curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/timelines/states/
{
"data":
[
{
"state": String,
"data": [
{
"date": Date,
"confirmed": Number,
"totalConfirmed": Number
}
]
}
...
...
]
}
- statename =
String
GET /api/timelines/states/:statename
curl -i -H 'Accept: application/json' https://covid19ngr.herokuapp.com/api/timelines/states/:statename
{
"data":
[
{
"state": String,
"data": [
{
"date": Date,
"confirmed": Number,
"totalConfirmed": Number
}
]
}
]
}
- date =
Date
format: YYYY-MM-DD
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
{
"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
}
]
},
...
...
]
}
Wanna contribute? Amazing...
-
Give this project a star.
-
Fork the repo and Read this guide The beginner's guide to contributing to a GitHub project
-
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
Create an issue here
- Writing Tests