Query data (v1-compatible)
/query endpoint./queryExecute InfluxQL query (v1-compatible)
Executes an InfluxQL query to retrieve data from the specified database.
This endpoint is compatible with InfluxDB 1.x client libraries and third-party integrations such as Grafana. Use query parameters to specify the database and the InfluxQL query.
Parameters
Query parameters
u
stringu is required, but can be any value.p
stringdb
required
stringrp
stringepoch
stringns
, u
, µ
, ms
, s
, m
, hq
required
string;).Header parameters
Zap-Trace-Span
stringAccept
stringapplication/json
, application/csv
, text/csv
, application/x-msgpackapplication/jsonAccept-Encoding
stringgzip
, identityidentityContent-Type
stringapplication/jsoncurl --request GET \
"http://localhost:8086/query?db=DB&q=Q" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
results
object[]A resultset object that contains the statement_id and the series array.
Except for statement_id, all properties are optional and omitted if empty. If a property is not present, it is assumed to be null.
error
stringpartial
booleanseries
object[]An array of series objects–the results of the query. A series of rows shares the same group key returned from the execution of a statement.
If a property is not present, it is assumed to be null.
columns
string[]name
stringpartial
booleantags
objectnull.values
array[]statement_id
integerstatement_id is used to combine statement results.InfluxDB Cloud:
- returns this error if a read or write request exceeds your plan’s adjustable service quotas or if a delete request exceeds the maximum global limit
- returns
Retry-Afterheader that describes when to try the write again.
InfluxDB OSS v2:
- doesn’t return this error.
code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/queryExecute InfluxQL query (v1-compatible)
Executes an InfluxQL query to retrieve data from the specified database.
This endpoint is compatible with InfluxDB 1.x client libraries and third-party integrations such as Grafana. Use query parameters to specify the database and the InfluxQL query.
Parameters
Query parameters
u
stringu is required, but can be any value.p
stringdb
required
stringrp
stringepoch
stringns
, u
, µ
, ms
, s
, m
, hHeader parameters
Zap-Trace-Span
stringAccept
stringapplication/json
, application/csv
, text/csv
, application/x-msgpackapplication/jsonAccept-Encoding
stringgzip
, identityidentityContent-Type
stringapplication/jsonRequest body
application/jsoncurl --request POST \
"http://localhost:8086/query?db=DB" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: text/plain" \
--data-raw 'measurement,tag=value field=1.0'Responses
results
object[]A resultset object that contains the statement_id and the series array.
Except for statement_id, all properties are optional and omitted if empty. If a property is not present, it is assumed to be null.
error
stringpartial
booleanseries
object[]An array of series objects–the results of the query. A series of rows shares the same group key returned from the execution of a statement.
If a property is not present, it is assumed to be null.
columns
string[]name
stringpartial
booleantags
objectnull.values
array[]statement_id
integerstatement_id is used to combine statement results.code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
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 and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.