---
title: Legacy Query
description: Query data using InfluxQL via the v1-compatible /query endpoint in InfluxDB Cloud.
url: https://docs.influxdata.com/influxdb/cloud/api/legacy-query/
estimated_tokens: 3596
product: InfluxDB Cloud (TSM)
version: cloud
---

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

Query data using InfluxQL via the v1-compatible `/query` endpoint in InfluxDB Cloud.

GET `/query`

### Query with the 1.x compatibility API

Queries InfluxDB using InfluxQL.

#### 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](/influxdb/cloud/reference/glossary/#bucket). For more information, see [Database and retention policy mapping](/influxdb/cloud/api-guide/influxdb-1x/dbrp/).

`rp` string

The retention policy to query data from. This is mapped to an InfluxDB [bucket](/influxdb/cloud/reference/glossary/#bucket). For more information, see [Database and retention policy mapping](/influxdb/cloud/api-guide/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](/influxdb/cloud/reference/glossary/#unix-timestamp) with the specified precision instead of [RFC3339 timestamps](/influxdb/cloud/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

`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](/influxdb/cloud/account-management/limits/#adjustable-service-quotas) or if a **delete** request exceeds the maximum [global limit](/influxdb/cloud/account-management/limits/#global-limits)
-   returns `Retry-After` header that describes when to try the write again.

#### InfluxDB OSS v2:

-   doesn’t return this error.

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.
