Access API of Grafana Cloud instance through grafana.com authentication, without service account

Hello,

On a Grafana Cloud instance, what is the authentication flow required to be able to make API calls (authentication must be via grafana.com; service account is not an option)?

Specifically, I am happy to do the initial login through a web browser and export the session from there. However, the next steps need to be feasible programmatically (e.g., through Python).

The API endpoint I would like to access is: /api/ds/query.

When observing what happens in the browser, the initial cookies are always modified from the initial ones stored in the browser, before they are used for the API request. I am unable to find documentation of what exactly is happening in that step, so that the API endpoint can be queried.

Thanks!