Query with the InfluxDB API
- Send a Flux query request to the /api/v2/query endpoint.
- Send an InfluxQL query request to the .
In your request, set the following:
Authorization
header toToken
+ your API token.- header to
application/csv
. - Query in Flux or InfluxQL with the request’s raw data.
Use gzip to compress the query response
Flux - Example query request
Below is an example curl
request that sends a Flux query to InfluxDB 2.2:
InfluxQL - Example query request
Below is an example request that sends an InfluxQL query to InfluxDB 2.2:
InfluxDB returns the query results in .