Discussions

Ask a Question
Back to All

Trouble getting started

I'd like to write a Python interface to access my Govee devices. I have applied for and received an API key. I have reviewed the API reference, particularly the request example, and written the following code:

url = 'https://openapi.api.govee.com/router/api/v1/user/devices'
params = {'Govee-API-Key': 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'}
response = requests.get(url, params=params, timeout=5)

...and the API responds with HTTP 400 Bad Request. Any suggestions as to what I should do differently?

Most APIs I've used include an initial step of providing auth credentials (including an API key) and receiving a session token, and then require that session token with every other HTTPS GET or HTTP POST request instead of the credentials. That might be what I'm missing here, but the documentation does not currently include any such example.