---
type: api
title: Get datafeeds
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-cat-ml-datafeeds
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-cat-ml-datafeeds
products:
  - Elasticsearch Serverless
---

# Get datafeeds


## Paths

- `GET` `/_cat/ml/datafeeds/{datafeed_id}`
- `GET` `/_cat/ml/datafeeds`

#### Path parameters

- `datafeed_id` (string) — optional, leave it out to use `/_cat/ml/datafeeds`
  A numerical character string that uniquely identifies the datafeed.

## Description

Get configuration and usage information about datafeeds.
This API returns a maximum of 10,000 datafeeds.
If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage`
cluster privileges to use this API.

IMPORTANT: CAT APIs are only intended for human consumption using the Kibana
console or command line. They are not intended for use by applications. For
application consumption, use the get datafeed statistics API.

## Required authorization

- Cluster privileges: `monitor_ml`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs use key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  For more information about where to find API keys for the Elasticsearch endpoint (${ES_URL}) for a project, go to [Get started with Elasticsearch Serverless](https://www.elastic.co/docs/solutions/search/serverless-elasticsearch-get-started).

## Query string parameters

- `allow_no_match` (boolean · default: true) — optional
  Specifies what to do when the request:

* Contains wildcard expressions and there are no datafeeds that match.
* Contains the `_all` string or no identifiers and there are no matches.
* Contains wildcard expressions and there are only partial matches.

If `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when
there are partial matches. If `false`, the API returns a 404 status code when there are no matches or only
partial matches.
- `h` (union · default: ['bc', 'id', 'sc', 's']) — optional
  Comma-separated list of column names to display.

Supported values include:
  - `ae` (or `assignment_explanation`): For started datafeeds only, contains messages relating to the selection of
a node.
  - `bc` (or `buckets.count`, `bucketsCount`): The number of buckets processed.
  - `id`: A numerical character string that uniquely identifies the datafeed.
  - `na` (or `node.address`, `nodeAddress`): For started datafeeds only, the network address of the node where the
datafeed is started.
  - `ne` (or `node.ephemeral_id`, `nodeEphemeralId`): For started datafeeds only, the ephemeral ID of the node where the
datafeed is started.
  - `ni` (or `node.id`, `nodeId`): For started datafeeds only, the unique identifier of the node where the
datafeed is started.
  - `nn` (or `node.name`, `nodeName`): For started datafeeds only, the name of the node where the datafeed is
started.
  - `sba` (or `search.bucket_avg`, `searchBucketAvg`): The average search time per bucket, in milliseconds.
  - `sc` (or `search.count`, `searchCount`): The number of searches run by the datafeed.
  - `seah` (or `search.exp_avg_hour`, `searchExpAvgHour`): The exponential average search time per hour, in milliseconds.
  - `st` (or `search.time`, `searchTime`): The total time the datafeed spent searching, in milliseconds.
  - `s` (or `state`): The status of the datafeed: `starting`, `started`, `stopping`, or `stopped`.
If `starting`, the datafeed has been requested to start but has not yet
started. If `started`, the datafeed is actively receiving data. If
`stopping`, the datafeed has been requested to stop gracefully and is
completing its final action. If `stopped`, the datafeed is stopped and will
not receive data until it is re-started.
- `s` (union oneOf) — optional
  Comma-separated list of column names or column aliases used to sort the response.

Supported values include:
  - `ae` (or `assignment_explanation`): For started datafeeds only, contains messages relating to the selection of
a node.
  - `bc` (or `buckets.count`, `bucketsCount`): The number of buckets processed.
  - `id`: A numerical character string that uniquely identifies the datafeed.
  - `na` (or `node.address`, `nodeAddress`): For started datafeeds only, the network address of the node where the
datafeed is started.
  - `ne` (or `node.ephemeral_id`, `nodeEphemeralId`): For started datafeeds only, the ephemeral ID of the node where the
datafeed is started.
  - `ni` (or `node.id`, `nodeId`): For started datafeeds only, the unique identifier of the node where the
datafeed is started.
  - `nn` (or `node.name`, `nodeName`): For started datafeeds only, the name of the node where the datafeed is
started.
  - `sba` (or `search.bucket_avg`, `searchBucketAvg`): The average search time per bucket, in milliseconds.
  - `sc` (or `search.count`, `searchCount`): The number of searches run by the datafeed.
  - `seah` (or `search.exp_avg_hour`, `searchExpAvgHour`): The exponential average search time per hour, in milliseconds.
  - `st` (or `search.time`, `searchTime`): The total time the datafeed spent searching, in milliseconds.
  - `s` (or `state`): The status of the datafeed: `starting`, `started`, `stopping`, or `stopped`.
If `starting`, the datafeed has been requested to start but has not yet
started. If `started`, the datafeed is actively receiving data. If
`stopping`, the datafeed has been requested to stop gracefully and is
completing its final action. If `stopped`, the datafeed is stopped and will
not receive data until it is re-started.
  One of: `string[]` or `string`
- `format` (string · default: text) — optional
  Specifies the format to return the columnar data in, can be set to
`text`, `json`, `cbor`, `yaml`, or `smile`.
- `help` (boolean · default: false) — optional
  When set to `true` will output available columns. This option
can't be combined with any other query string option.
- `v` (boolean · default: false) — optional
  When set to `true` will enable verbose output.
- `bytes` (enum) — optional
  Sets the units for columns that contain a byte-size value.
Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes.
If omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.
Values that are not an exact multiple of the chosen unit are rounded down.
  Values: `b`, `kb`, `mb`, `gb`, `tb`, `pb`
- `time` (enum) — optional
  Sets the units for columns that contain a time duration.
If omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
If given, time duration values are rendered as an integer with no suffix.
Values that are not an exact multiple of the chosen unit are rounded down.
  Values: `nanos`, `micros`, `ms`, `s`, `m`, `h`, `d`

## Response

`application/json`

Type: `object[]`

An array; each item has these fields:

- `id` (string)
  The datafeed identifier.
- `state` (enum)
  The status of the datafeed.
  Values: `started`, `stopped`, `starting`, `stopping`
- `assignment_explanation` (string)
  For started datafeeds only, contains messages relating to the selection of a node.
- `buckets.count` (string)
  The number of buckets processed.
- `search.count` (string)
  The number of searches run by the datafeed.
- `search.time` (string)
  The total time the datafeed spent searching, in milliseconds.
- `search.bucket_avg` (string)
  The average search time per bucket, in milliseconds.
- `search.exp_avg_hour` (string)
  The exponential average search time per hour, in milliseconds.
- `node.id` (string)
  The unique identifier of the assigned node.
For started datafeeds only, this information pertains to the node upon which the datafeed is started.
- `node.name` (string)
  The name of the assigned node.
For started datafeeds only, this information pertains to the node upon which the datafeed is started.
- `node.ephemeral_id` (string)
  The ephemeral identifier of the assigned node.
For started datafeeds only, this information pertains to the node upon which the datafeed is started.
- `node.address` (string)
  The network address of the assigned node.
For started datafeeds only, this information pertains to the node upon which the datafeed is started.
## Code examples

#### Console

```console
GET _cat/ml/datafeeds?v=true&format=json
```

#### JavaScript

```javascript
const response = await client.cat.mlDatafeeds({
  v: "true",
  format: "json",
});
```

#### Python

```python
resp = client.cat.ml_datafeeds(
    v=True,
    format="json",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cat/ml/datafeeds?v=true&format=json" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cat().mlDatafeeds(m -> m);
```

#### PHP

```php
$resp = $client->cat()->mlDatafeeds([
    "v" => "true",
    "format" => "json",
]);
```

#### Ruby

```ruby
response = client.cat.ml_datafeeds(
  v: "true",
  format: "json"
)
```

## Response examples

#### Cat datafeeds response example1

A successful response from `GET _cat/ml/datafeeds?v=true&format=json`.

```json
[
  {
    "id": "datafeed-high_sum_total_sales",
    "state": "stopped",
    "buckets.count": "743",
    "search.count": "7"
  },
  {
    "id": "datafeed-low_request_rate",
    "state": "stopped",
    "buckets.count": "1457",
    "search.count": "3"
  },
  {
    "id": "datafeed-response_code_rates",
    "state": "stopped",
    "buckets.count": "1460",
    "search.count": "18"
  },
  {
    "id": "datafeed-url_scanning",
    "state": "stopped",
    "buckets.count": "1460",
    "search.count": "18"
  }
]
```

