Example of how to use the API made available by french compagny RTE
The goal is:
-to display values for the current day and the two days after (ie J, J+1, J+2),
-to create in the current directory, three images (png) as logo, that can be use where you want.
Create an account, then register for this API: https://data.rte-france.com/catalog/-/api/consumption/Ecowatt/v4.0
must replaced by https://data.rte-france.com/catalog/-/api/consumption/Ecowatt/v5.0
Create an application for this API (do create a new application for v5)
Select this application and get the ID client and the ID secret in base64
This is the only change to make in the script!
Usage: php ecowatt.php { prod | sandbox ] [ local | web ]
first argument:
prod: url for production information will be used
sandbox: url for test information will be used
second argument:
local: information will be only displayed localy
web: information will be displayed localy, generation for web done
otherwise usage is displayed
Using URL for production:
One call per quarter is allowed. Meaning:
-a call at H:01 next call possible at H+15 + 1s
-a call at H:10 next call possible at H+15 +1s
-a call at H:31 next call possible at H+45 +1s
so it is not in elapse time, strange but it is what it is.
Using URL for sandbox: