How to fetch query id for performed queries

Hi everybody. I am trying to calculate how many points are consumed by my queries to the v1 API using python.

I see that i can make a query to { utilities { metrics { points } } }, but i need to specify the query id. How can i retrieve the query id for a query that my application performed? It is not available in the query response.

Hello @Blocknaut,

Every query request returns a query_id, which you can find in the response headers. For example, in Python:

response = requests.post(url, headers=headers, json=payload)
print(response.headers.get('x-graphql-query-id'))

This will give the query_id.