An API that allows you to easily generate predictions for worldwide COVID-19 cases. The data is fetched using pomber COVID-19 API and FastAPI is used as web framework for building the API. There is also a small Streamlit dashboard that allows you to easily interact with the API.
The following models are currently implemented for univariate forecasting:
Within the project root directory run the API within you CLI as follows:
uvicorn api:api --reload
Access FastAPI UI by open your browser at http://127.0.0.1:8000/docs. Open the POST method tab and click on Try it out
.
You can manipulate the JSON request body as you desire. Clicking on Execute
does the following:
- Make an API call to pomber COVID-19 API to fetch the latest data
- Check whether the desired model has already been trained at pred_start and trains it if is has not been trained
- Makes prediction in your desired prediction horizon
The default JSON request body:
{
"country": "Germany",
"pred_start": "2020-11-01",
"type": "auto_arima",
"horizon": 7
}
Check out all avaliable countries at https://pomber.github.io/covid19/timeseries.json
To host the dashboard and API locally run the following command within project root directory
make setup
make run
These commands install all the required packages and start the API and dashboard. The dashboard should start in a new browser tab at http://localhost:8501/, while the API is running at http://localhost:8000/. To interact with the API only check out the previous section.
The data is under CSSEGISandData/COVID-19 terms of use.