Use Toar statistics api v2
As Toar Statistics API v1 is offline, adjust code to load aggregated data (like dma8eu ozone) from new API v2.
When the old code looks like
from io import BytesIO
import pandas as pd
import requests
resp = requests.get("https://toar-data.fz-juelich.de/statistics/api/v1/?format=csv×eries_id=31099&names=dma8eu&sampling=daily")
df = pd.read_csv(BytesIO(resp.content), index_col="datetime", parse_dates=True)
the new code could look like
from io import BytesIO
import zipfile
import pandas as pd
import requests
resp = requests.get("https://toar-data.fz-juelich.de/api/v2/analysis/statistics/?sampling=daily&statistics=dma8eu&id=31099")
while True:
resp = requests.get(resp.json()["status"], timeout=(3.05, 5))
if resp.history:
break
with zipfile.ZipFile(BytesIO(resp.content)) as file:
df = pd.read_csv(BytesIO(file.read("31099_dma8eu.csv")), comment="#", index_col="datetime", parse_dates=True)