Query data
Query data stored in InfluxDB 3 Cloud using SQL or InfluxQL.
GET
/api/v3/query_influxqlExecute InfluxQL query
Executes an InfluxQL query to retrieve data from the specified database.
Parameters
Query parameters
db
stringThe name of the database.
If you provide a query that specifies the database, you can omit the ‘db’ parameter from your request.
q
required
stringformat
stringparams
stringJSON-encoded query parameters for parameterized queries.
Header parameters
Accept
stringThe content type that the client can understand.
Allowed values:
application/json
, application/jsonl
, application/vnd.apache.parquet
, text/csvDefault:
application/jsonRequest body required
Content-Type:
application/jsonExample request
Ask AI about this
curl --request GET \
"https://cluster-host.a.influxdb.io/api/v3/query_influxql?q=Q" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json"Responses
200
Success. The response body contains query results.
results
object[]Example request body
{
"results": [
{
"series": [
{
"columns": [
"time",
"value"
],
"name": "mytable",
"values": [
[
"2024-02-02T12:00:00Z",
42
]
]
}
]
}
]
}400
Bad request.
401
Unauthorized access.
data
objecterror
string403
Access denied.
404
Database not found.
405
Method not allowed.
422
Unprocessable entity.
POST
/api/v3/query_influxqlExecute InfluxQL query
Executes an InfluxQL query to retrieve data from the specified database.
Parameters
Header parameters
Accept
stringThe content type that the client can understand.
Allowed values:
application/json
, application/jsonl
, application/vnd.apache.parquet
, text/csvDefault:
application/jsonContent-Type
stringThe format of the data in the request body.
Allowed values:
application/jsonRequest body
Content-Type:
application/jsonExample request
Ask AI about this
curl --request POST \
"https://cluster-host.a.influxdb.io/api/v3/query_influxql" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{"db":"mydb","format":"json","params":{},"q":"SELECT * FROM mytable"}'Responses
200
Success. The response body contains query results.
results
object[]Example request body
{
"results": [
{
"series": [
{
"columns": [
"time",
"value"
],
"name": "mytable",
"values": [
[
"2024-02-02T12:00:00Z",
42
]
]
}
]
}
]
}400
Bad request.
401
Unauthorized access.
data
objecterror
string403
Access denied.
404
Database not found.
405
Method not allowed.
422
Unprocessable entity.
GET
/api/v3/query_sqlExecute SQL query
Executes an SQL query to retrieve data from the specified database.
Parameters
Query parameters
db
required
stringThe name of the database.
q
required
string <SQL>The query to execute.
format
stringparams
stringJSON-encoded query parameters for parameterized queries.
Header parameters
Accept
stringThe content type that the client can understand.
Allowed values:
application/json
, application/jsonl
, application/vnd.apache.parquet
, text/csvDefault:
application/jsonContent-Type
stringThe format of the data in the request body.
Allowed values:
application/jsonRequest body required
Content-Type:
application/jsonExample request
Ask AI about this
curl --request GET \
"https://cluster-host.a.influxdb.io/api/v3/query_sql?db=DB&q=Q" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json"Responses
200
Success. The response body contains query results.
results
object[]Example request body
{
"results": [
{
"series": [
{
"columns": [
"time",
"value"
],
"name": "mytable",
"values": [
[
"2024-02-02T12:00:00Z",
42
]
]
}
]
}
]
}400
Bad request.
401
Unauthorized access.
data
objecterror
string403
Access denied.
404
Database not found.
405
Method not allowed.
422
Unprocessable entity.
POST
/api/v3/query_sqlExecute SQL query
Executes an SQL query to retrieve data from the specified database.
Parameters
Header parameters
Accept
stringThe content type that the client can understand.
Allowed values:
application/json
, application/jsonl
, application/vnd.apache.parquet
, text/csvDefault:
application/jsonContent-Type
stringThe format of the data in the request body.
Allowed values:
application/json