Octopus give an example of the command needed to access their API:
curl -u "sk_live_************************:" "https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-M/standard-unit-rates/"
The ************************ represents what will be my password or unique key
My code is:
import urllib.request
curlplusurl = 'curl -u "sk_live_************************:" "https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-M/standard-unit-rates/"'
with urllib.request.urlopen(curlplusurl) as response
answer = response.read()
I get the following error:
raise URLError('unknown url type: %s' % type)
urllib.error.URLError: urlopen error unknown url type: curl -u "sk_live_************************
the bit with the password/unique key is vital - so how do I give it if I can't do it the way Octopus describe?