Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active November 19, 2024 07:45
Show Gist options
  • Save dewomser/e018a9cf9f191c0f00c4967d9dc46e17 to your computer and use it in GitHub Desktop.
Save dewomser/e018a9cf9f191c0f00c4967d9dc46e17 to your computer and use it in GitHub Desktop.
Anmeldefreies API / schönes Json zum Strommix in Deutschland.
# für die Bash Kommandozeile
# Datum anpassen !
heute=$(date -u -d "-1 hour" +%Y-%m-%d-%H:00:00)
gestern=$(date -u -d yesterday +%Y-%m-%d-%H:00:00)
curl -X 'GET' "https://api.energy-charts.info/total_power?country=de&start=$gestern&end=$heute" -H 'accept: application/json'|jq .[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment