NL COVID API

NL COVID API

Today I am opening an easy to use API that exposes data on Dutch COVID-19 cases from the RIVM. The API can be used with industry standard tools for data analysis.

  • Products

Using this simple API allows developers to rapidly access COVID-19 data that is normally exposed through the RIVM website . The structure can be readily used with Python Pandas' read_json function (documentation) . Note that this is an unofficial API that is not supported by the RIVM.

The API can be found here: https://covid.stephanheijl.com/api

The following endpoints are available:

This API is hosted on Google Cloud Run, with caching on CloudFlare, which means that it may take some time for data to become up-to-date.

Example usage

import pandas

df = pandas.read_json(
    "https://covid.stephanheijl.com/api/v1/deaths_per_day"
)

Results in a dataframe

             date  new  until_yesterday  total
0   [2020, 2, 27]    0                0      0
1   [2020, 2, 28]    0                0      0
2   [2020, 2, 29]    0                0      0
3    [2020, 3, 1]    0                0      0
4    [2020, 3, 2]    0                0      0
...
70   [2020, 5, 7]    1               32     33
71   [2020, 5, 8]    2               20     22
72   [2020, 5, 9]    4               12     16
73  [2020, 5, 10]    8                0      8
74  [2020, 5, 11]    0                0      0

[75 rows x 4 columns]

Attribution/citation

If you use this API in your work you are required to attribute the RIVM as the primary source of the data: Rijksinstituut voor Volksgezondheid en Milieu (RIVM), "Ontwikkeling COVID-19 in grafieken", 2020.

I also kindly request that you attribute me by name and website (Stephan Heijl, https://stephanheijl.com).