---
type: api
title: Get ES|QL data sources
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-esql-get-data-source
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-esql-get-data-source
products:
  - Elasticsearch Serverless
---

# Get ES|QL data sources


Availability:

## Paths

- `GET` `/_query/data_source/{name}`
- `GET` `/_query/data_source`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/authentication#apikeyauth)

#### Path Parameters

- `name` (union Name | [] Name) — optional, leave it out to use `/_query/data_source`
  A comma-separated list of data source names or wildcard patterns. Omit to return all data sources.

## Description

Returns one or more data sources used in ES|QL data federation.
A concrete-name miss returns `404`; a wildcard pattern or list-all request with no match
returns `200` with an empty array.

## Required authorization

* Cluster privileges: `manage`

[ES|QL Data Federation](https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation)

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node.

## Response

`application/json`

- `data_sources` ([] ESQLDataSource)
  The matching data sources.
Credential values in each data source's settings are redacted as `::es_redacted::` in the response.
  - `name` (string Name)
    The data source name.
  - `type` (string)
    The data source type. Currently, `s3` is supported.
  - `description` (string)
    A free-text description.
  - `settings` (map string to object)
    Type-specific connection and authentication settings.
## Code Examples

#### Console

```console
GET /_query/data_source/prod_s3_logs
```

#### JavaScript

```javascript
const response = await client.esql.getDataSource({
  name: "prod_s3_logs",
});
```

#### Python

```python
resp = client.esql.get_data_source(
    name="prod_s3_logs",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_query/data_source/prod_s3_logs" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.esql().getDataSource(g -> g
    .name("prod_s3_logs")
);
```

#### PHP

```php
$resp = $client->esql()->getDataSource([
    "name" => "prod_s3_logs",
]);
```

#### Ruby

```ruby
response = client.esql.get_data_source(
  name: "prod_s3_logs"
)
```

## Response Examples

#### Data source details

The response contains the requested data source. Credential values are replaced by the ::es_redacted:: sentinel.

```json
{
  "data_sources": [
    {
      "name": "prod_s3_logs",
      "type": "s3",
      "description": "Production S3 logs bucket",
      "settings": {
        "region": "us-east-1",
        "auth": "static_credentials",
        "access_key": "::es_redacted::",
        "secret_key": "::es_redacted::"
      }
    }
  ]
}
```

#### No data sources matched

A wildcard or list-all request with no matches returns an empty array.

```json
{
  "data_sources": []
}
```

