Go API for retrieving Covid-19 statistics
- Data structure (see below)
- Time series data is now stored globally at runtime and updated daily when fetching a new set of results
- Removed the
/all
endpoint and replaced it with separate endpoints to handle different levels of data analysis
GET /latest
- retrieve the latest statisticsGET /countries
- retrieve all countriesGET /ping
- ping to see if the server is runningGET /all
- retrieve statistics of all countries
Test if the server is running.
Returns all statistics.
country
- case sensitive search for the country to returnstate
- case sensitive search for the state to returnfirst
- get the first n number of recordslast
- get the last n number of recordssort-total
- sort the results by the total value of each categorysort-records
- sort the results by the total value of each category
{
"<country>": {
"<state>": {
"long": 0.0,
"lat": 0.0,
"confirmed": {
"total": 0,
"data": {
"<date - dd-MM-yyyy>": 0
}
},
"recovered": {
"total": 0,
"data": {
"<date - dd-MM-yyyy>": 0
}
},
"deaths": {
"total": 0,
"data": {
"<date - dd-MM-yyyy>": 0
}
}
}
}
}
Returns all available countries and states.
Ensure that you have Docker installed
Run the Docker compose file to load all necessary information.
$ docker-compose up
- Auto-pull the repository every day
- Compute the overall changes of the data since the data is accumulative now
- Deployment guide
- Endpoint for country information
- Fully migrate to use database to query data
- Use middleware to handle errors thrown
- Use bubble chart for showing most prominent countries
- Endpoint for grouping countries that have states
- CORS must be configured before any API routes are created otherwise the client will encounter CORS issues
- GORM is limited in its functionality with tags; for foreign keys, the association must be declared during table creation and not during struct declaration