Query
/query endpoint, supporting both read queries (SELECT, SHOW) and management queries (CREATE, DROP, ALTER)./queryQuery data (GET)
Query data using InfluxQL. Use GET for read-only queries that start with:
SELECT(except queries withINTOclause)SHOW
For write operations (CREATE, DROP, ALTER, etc.), use POST.
Parameters
Query parameters
db
stringq
required
stringepoch
stringns
, u
, µ
, ms
, s
, m
, hpretty
booleanchunked
stringtrue to chunk by series
or every 10,000 points. Set to a number to chunk by that many points.u
stringp
stringcurl --request GET \
"http://localhost:8086/query?q=Q" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
results
object[]error
stringseries
object[]statement_id
integererror
required
stringerror
required
string/queryQuery data (POST)
Query data or execute database management commands using InfluxQL. Use POST for queries that start with:
SELECTwithINTOclauseALTERCREATEDELETEDROPGRANTKILLREVOKE
Parameters
Query parameters
db
stringepoch
stringns
, u
, µ
, ms
, s
, m
, hpretty
booleanchunked
stringtrue to chunk by series
or every 10,000 points. Set to a number to chunk by that many points.u
stringp
stringRequest body required
application/jsoncurl --request POST \
"http://localhost:8086/query" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/x-www-form-urlencoded"Responses
results
object[]error
stringseries
object[]statement_id
integererror
required
stringerror
required
string/api/v2/query
v2Query with Flux (v2 compatible)
Query data using Flux language. This endpoint provides forward compatibility with InfluxDB 2.x client libraries.
Required Headers:
Accept: application/csvContent-type: application/vnd.fluxAuthorization: Token username:password(if authentication is enabled)
Request body required
application/jsoncurl --request POST \
"http://localhost:8086/api/v2/query" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/vnd.flux"Responses
error
required
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB Enterprise v1 and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.