---
title: Query data
description: Query data stored in InfluxDB 3 Cloud Serverless using InfluxQL via the v1-compatible /query endpoint, or using SQL and InfluxQL via Flight+gRPC clients.
url: https://docs.influxdata.com/influxdb3/cloud-serverless/api/query-data/
estimated_tokens: 3842
product: InfluxDB Cloud Serverless
version: cloud-serverless
---

[Download InfluxDB Cloud Serverless API Spec](/openapi/influxdb-cloud-serverless-api.yml)

Query data stored in InfluxDB 3 Cloud Serverless using InfluxQL via the v1-compatible `/query` endpoint, or using SQL and InfluxQL via Flight+gRPC clients.

GET `/query`

### Query using the InfluxDB v1 HTTP API

Queries InfluxDB using InfluxQL with InfluxDB v1 request and response formats.

#### Related guides

-   [Use the InfluxDB v1 HTTP API](/influxdb3/cloud-serverless/guides/api-compatibility/v1/)
-   [Query data](/influxdb3/cloud-serverless/query-data/)

#### Parameters

##### Query parameters

`u` string

The InfluxDB 1.x username to authenticate the request.

`p` string

The InfluxDB 1.x password to authenticate the request.

`db` required string

The database to query data from. This is mapped to an InfluxDB [bucket](/influxdb3/cloud-serverless/reference/glossary/#bucket). For more information, see [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/).

`rp` string

The retention policy to query data from. This is mapped to an InfluxDB [bucket](/influxdb3/cloud-serverless/reference/glossary/#bucket). For more information, see [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/).

`q` required string

The InfluxQL query to execute. To execute multiple queries, delimit queries with a semicolon (`;`).

`epoch` string

A unix timestamp precision. Formats timestamps as [unix (epoch) timestamps](/influxdb3/cloud-serverless/reference/glossary/#unix-timestamp) with the specified precision instead of [RFC3339 timestamps](/influxdb3/cloud-serverless/reference/glossary/#rfc3339-timestamp) with nanosecond precision.

Allowed values: `ns` , `u` , `µ` , `ms` , `s` , `m` , `h`

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

`Accept` string

Allowed values: `application/json` , `application/csv` , `text/csv` , `application/x-msgpack`

Default: `application/json`

`Accept-Encoding` string

The content encoding (usually a compression algorithm) that the client can understand.

Allowed values: `gzip` , `identity`

Default: `identity`

`Content-Type` string

Allowed values: `application/json`

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "https://us-east-1-1.aws.cloud2.influxdata.com/query?db=DB&q=Q" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200

Query results.

If a DBRP doesn’t exist for the `db=DATABASE_NAME` and `rp=RETENTION_POLICY_NAME` combination in the query request, the response body contains an error message, for example `"database not found:..."`.

`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` string

`partial` boolean

True if the resultset is not complete–the response data is chunked; otherwise, false or omitted.

`series` 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\[\]

An array of column names

`name` string

The name of the series

`partial` boolean

True if the series is not complete–the response data is chunked; otherwise, false or omitted.

`tags` object

A map of tag key-value pairs. If a tag key is not present, it is assumed to be `null`.

`values` array\[\]

An array of rows, where each row is an array of values.

`statement_id` integer

An integer that represents the statement’s position in the query. If statement results are buffered in memory, `statement_id` is used to combine statement results.

429

#### InfluxDB Cloud:

-   returns this error if a **read** or **write** request exceeds your plan’s [adjustable service quotas](/influxdb3/cloud-serverless/account-management/limits/#adjustable-service-quotas) or if a **delete** request exceeds the maximum [global limit](/influxdb3/cloud-serverless/account-management/limits/#global-limits)
-   returns `Retry-After` header that describes when to try the write again.

default Error processing query

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

#### Related

-   [Get started querying InfluxDB](/influxdb3/cloud-serverless/get-started/query/)
-   [Execute queries](/influxdb3/cloud-serverless/query-data/execute-queries/)
-   [InfluxDB 3 API client libraries](/influxdb3/cloud-serverless/reference/client-libraries/v3/)
