---
type: api
title: Get the cluster health status
description: IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-cat-health
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-cat-health
products:
  - Elasticsearch
---

# Get the cluster health status

Availability:

## Paths

- `GET` `/_cat/health`

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

## Description

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 cluster health API.
This API is often used to check malfunctioning clusters.
To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats:
`HH:MM:SS`, which is human-readable but includes no date information;
`Unix epoch time`, which is machine-sortable and includes date information.
The latter format is useful for cluster recoveries that take multiple days.
You can use the cat health API to verify cluster health across multiple nodes.
You also can use the API to track the recovery of a large cluster over a longer period of time.

## Required authorization

* Cluster privileges: `monitor`

## Query String Parameters

- `ts` (boolean · default: true)
  If true, returns `HH:MM:SS` and Unix epoch timestamps.
- `h` (union Names)
  List of columns to appear in the response. Supports simple wildcards.
  One of: `Name` or `Name[]`
- `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: `[] HealthRecord`

- `epoch` (StringifiedEpochTimeUnitSeconds)
  seconds since 1970-01-01 00:00:00
- `timestamp` (string TimeOfDay)
  time in HH:MM:SS
- `cluster` (string)
  cluster name
- `status` (string)
  health status
- `node.total` (string)
  total number of nodes
- `node.data` (string)
  number of nodes that can store data
- `shards` (string)
  total number of shards
- `pri` (string)
  number of primary shards
- `relo` (string)
  number of relocating nodes
- `init` (string)
  number of initializing nodes
- `unassign.pri` (string)
  number of unassigned primary shards
- `unassign` (string)
  number of unassigned shards
- `pending_tasks` (string)
  number of pending tasks
- `max_task_wait_time` (string)
  wait time of longest task pending
- `active_shards_percent` (string)
  active number of shards in percent
## Code Examples

#### Console

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

#### JavaScript

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

#### Python

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

#### curl

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

#### Java

```java
client.cat().health();
```

#### PHP

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

#### Ruby

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

## Response Examples

#### Cat health response example1

A successful response from `GET /_cat/health?v=true&format=json`. By default, it returns `HH:MM:SS` and Unix epoch timestamps.

```json
[
  {
    "epoch": "1475871424",
    "timestamp": "16:17:04",
    "cluster": "elasticsearch",
    "status": "green",
    "node.total": "1",
    "node.data": "1",
    "shards": "1",
    "pri": "1",
    "relo": "0",
    "init": "0",
    "unassign": "0",
    "unassign.pri": "0",
    "pending_tasks": "0",
    "max_task_wait_time": "-",
    "active_shards_percent": "100.0%"
  }
]
```

