Community
OpenEnergyMonitor

Community

Read only APIKEY not working

Tags: #<Tag:0x00007f6e087210a0>

I’ve been unsuccessful in trying to export data from emoncms.org using the read only apikey provided. I can only export data using the read/write apikey. Is your system generating the correct read only apikey?

Python code:
import requests
import json
apikey = "my-read-only-api-key"
params = {“apikey”: apikey}
headers = {“Content-type”: “application/json”,
‘Authorization’: 'Bearer '+ apikey}
url = “https://emoncms.org/input/get&apikey=”+apikey
response = requests.get(url, params=params, headers=headers)
print(response.status_code)
print(response.content)