Skip to content

Instantly share code, notes, and snippets.

@dewomser
Created June 22, 2023 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dewomser/121bef88b5df46f08c65ca3837ef175f to your computer and use it in GitHub Desktop.
Save dewomser/121bef88b5df46f08c65ca3837ef175f to your computer and use it in GitHub Desktop.
API Luftqualität deutsche Messstationen der Länder
#!/bin/bash
ba=https://www.umweltbundesamt.de
readarray -td ";" lq <<< $(curl "$ba/api/air_data/v3/airquality/csv?date_from=$(date -d 'yesterday' +%F)&time_from=24&date_to=$(date +%F)&time_to=24&station=1460&lang=de" |grep -E x\|$(date -d '1 hours ago' +%H))
echo ${lq[1]}:${lq[7]};echo ${lq[2]}:${lq[8]};echo ${lq[3]}:${lq[9]};echo ${lq[4]}:${lq[10]};echo ${lq[5]}:${lq[11]};echo ${lq[6]}:${lq[12]}
#Messtationen gibts hier:
#https://www.umweltbundesamt.de/daten/luft/luftdaten/stationen/
#Messtationcode kopieren und in Zeile 3 ersetzen
@dewomser
Copy link
Author

Für Worms hab ich das getestet und es funktioniert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment