---
type: api
title: Get async ES|QL query results
description: Get the current status and available results or stored results for an ES|QL asynchronous query.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-esql-async-query-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-esql-async-query-get
products:
  - Elasticsearch
---

# Get async ES|QL query results

Availability: 8.13+

## Paths

- `GET` `/_query/async/{id}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

#### Path Parameters

- `id` (string Id)
  The unique identifier of the query.
A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time.
A query ID is also provided when the request was submitted with the `keep_on_completion` parameter set to `true`.

## Description

Get the current status and available results or stored results for an ES|QL asynchronous query.
If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API.

## Required authorization

* Index privileges: `read`

[More about ES|QL reference](https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql)

## Query String Parameters

- `drop_null_columns` (boolean · default: false)
  Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.
If `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.
- `format` (enum EsqlFormat)
  A short version of the Accept header, for example `json` or `yaml`.
  Values: `csv`, `json`, `tsv`, `txt`, `yaml`, `cbor`, `smile`, `arrow`
- `keep_alive` (string Duration)
  The period for which the query and its results are stored in the cluster.
When this period expires, the query and its results are deleted, even if the query is still ongoing.
- `wait_for_completion_timeout` (string Duration)
  The period to wait for the request to finish.
By default, the request waits for complete query results.
If the request completes during the period specified in this parameter, complete query results are returned.
Otherwise, the response returns an `is_running` value of `true` and no results.

## Response

`application/json`

- `took` (DurationValueUnitMillis)
- `is_partial` (boolean)
- `all_columns` ([] EsqlColumnInfo)
  - `name` (string)
  - `type` (string)
- `columns` ([] EsqlColumnInfo)
  - `name` (string)
  - `type` (string)
- `values` ([] union FieldValue)
  One of: `number` or `string` or `boolean`
- `_clusters` ({} EsqlClusterInfo)
  Cross-cluster search information. Present if `include_ccs_metadata` was `true` in the request
and a cross-cluster search was performed.
  - `total` (number)
  - `successful` (number)
  - `running` (number)
  - `skipped` (number)
  - `partial` (number)
  - `failed` (number)
  - `details` (map string to EsqlClusterDetails)
    Map values ({} EsqlClusterDetails)
    - `status` (enum EsqlClusterStatus)
      Values: `running`, `successful`, `partial`, `skipped`, `failed`
    - `indices` (string)
    - `took` (DurationValueUnitMillis)
    - `_shards` ({} EsqlShardInfo)
      - `total` (number)
      - `successful` (number)
      - `skipped` (number)
      - `failed` (number)
    - `failures` ([] EsqlShardFailure)
      - `shard` (number)
      - `index` (union IndexName | string) — nullable
      - `node` (string)
      - `reason` ({} ErrorCause)
        - `type` (string)
          The type of error
        - `reason` (union string) — nullable
          A human-readable explanation of the error, in English.
          One of: `string`
        - `stack_trace` (string)
          The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
        - `caused_by` ({} ErrorCause) — recursive
          Same fields as `reason` in `failures`
        - `root_cause` ([] ErrorCause) — recursive
          Same fields as `reason` in `failures`
        - `suppressed` ([] ErrorCause) — recursive
          Same fields as `reason` in `failures`
- `profile` (object)
  Profiling information. Present if `profile` was `true` in the request.
The contents of this field are currently unstable.
- `id` (string)
  The ID of the async query, to be used in subsequent requests to check the status or retrieve results.

Also available in the `X-Elasticsearch-Async-Id` HTTP header.
- `is_running` (boolean)
  Indicates whether the async query is still running or has completed.

Also available in the `X-Elasticsearch-Async-Is-Running` HTTP header.
## Code Examples

#### Console

```console
GET /_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=30s
```

#### JavaScript

```javascript
const response = await client.esql.asyncQueryGet({
  id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
  wait_for_completion_timeout: "30s",
});
```

#### Python

```python
resp = client.esql.async_query_get(
    id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
    wait_for_completion_timeout="30s",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=30s" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### C#

```c#
var response = await client.Esql
    .AsyncQueryGetAsync(id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=", d1 => d1
        .WaitForCompletionTimeout("30s")
    );
```

#### PHP

```php
$resp = $client->esql()->asyncQueryGet([
    "id" => "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
    "wait_for_completion_timeout" => "30s",
]);
```

#### Ruby

```ruby
response = client.esql.async_query_get(
  id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
  wait_for_completion_timeout: "30s"
)
```

