---
type: api
title: Get field data cache information
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-cat-fielddata
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-cat-fielddata
products:
  - Elasticsearch
---

# Get field data cache information


Availability:

## Paths

- `GET` `/_cat/fielddata/{fields}`
- `GET` `/_cat/fielddata`

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

#### Path Parameters

- `fields` (union Field | [] Field) — optional, leave it out to use `/_cat/fielddata`
  Comma-separated list of fields used to limit returned information.
To retrieve all fields, omit this parameter.

## Description

Get the amount of heap memory currently used by the field data cache on every data node in the cluster.

IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.
They are not intended for use by applications. For application consumption, use the nodes stats API.

## Required authorization

* Cluster privileges: `monitor`

## Query String Parameters

- `fields` (union Fields)
  Comma-separated list of fields used to limit returned information.
  One of: `Field` or `Field[]`
- `h` (union CatFieldDataColumns)
  A comma-separated list of columns names to display. It supports simple wildcards.

Supported values include:
  - `id`: The node ID.
  - `host` (or `h`): The host name of the node.
  - `ip`: The IP address of the node.
  - `node` (or `n`): The node name.
  - `field` (or `f`): The field name.
  - `size` (or `s`): The field data usage.
  Values: `id`, `host`, `h`, `ip`, `node`, `n`, `field`, `f`, `size`, `s`
- `s` (union Names)
  List of columns that determine how the table should be sorted.
Sorting defaults to ascending and can be changed by setting `:asc`
or `:desc` as a suffix to the column name.
  One of: `Name` or `Name[]`

## Response

`application/json`

Type: `[] FielddataRecord`

- `id` (string)
  node id
- `host` (string)
  host name
- `ip` (string)
  ip address
- `node` (string)
  node name
- `field` (string)
  field name
- `size` (string)
  field data usage
## Code Examples

#### Console

```console
GET /_cat/fielddata?v=true&fields=body&format=json
```

#### JavaScript

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

#### Python

```python
resp = client.cat.fielddata(
    v=True,
    fields="body",
    format="json",
)
```

#### curl

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

#### Java

```java
client.cat().fielddata(f -> f
    .fields("body")
);
```

#### PHP

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

#### Ruby

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

## Response Examples

#### Single field data

A successful response from `GET /_cat/fielddata?v=true&fields=body&format=json`. You can specify an individual field in the request body or URL path. This example retrieves heap memory size information for the `body` field.

```json
[
  {
    "id": "Nqk-6inXQq-OxUfOUI8jNQ",
    "host": "127.0.0.1",
    "ip": "127.0.0.1",
    "node": "Nqk-6in",
    "field": "body",
    "size": "544b"
  }
]
```

#### Multiple fields data

A successful response from `GET /_cat/fielddata/body,soul?v=true&format=json`. You can specify a comma-separated list of fields in the request body or URL path. This example retrieves heap memory size information for the `body` and `soul` fields. To get information for all fields, run `GET /_cat/fielddata?v=true`.

```json
[
  {
    "id": "Nqk-6inXQq-OxUfOUI8jNQ",
    "host": "1127.0.0.1",
    "ip": "127.0.0.1",
    "node": "Nqk-6in",
    "field": "body",
    "size": "544b"
  },
  {
    "id": "Nqk-6inXQq-OxUfOUI8jNQ",
    "host": "127.0.0.1",
    "ip": "127.0.0.1",
    "node": "Nqk-6in",
    "field": "soul",
    "size": "480b"
  }
]
```

