---
type: api
title: "Find Prometheus series"
description: "Get the time series that match the given selectors."
url: https://www.elastic.co/elastic/docs-builder/docs/4904/api/elasticsearch/operation/operation-prometheus-series
resource: https://www.elastic.co/elastic/docs-builder/docs/4904/api/elasticsearch/operation/operation-prometheus-series
products:
  - Elasticsearch
---

# Find Prometheus series

Authentication: required

Availability: Preview since 9.4

## Paths

- `POST` (also `GET`) `/_prometheus/{index}/api/v1/series`
- `POST` (also `GET`) `/_prometheus/api/v1/series`

#### Path parameters

- `index` (string) — optional, leave it out to use `/_prometheus/api/v1/series`
  An index expression that restricts which indices are considered, for example `metrics-generic.prometheus-*`.
If you omit it, the default expression `metrics-*` is used.
Only indices with `index.mode: time_series` are considered.

## Description

Get the time series that match the given selectors.
The endpoint mirrors the Prometheus `/api/v1/series` endpoint.

## Required privileges

- Index privileges: `read`

## Query string parameters

- `match[]` (string[]) — required
  Repeated series selectors, for example `up{job="prometheus"}`. At least one is required.
- `start` (string) — optional
  The start of the time range, as an RFC 3339 timestamp or Unix time in seconds.
Defaults to 24 hours before `end`.
- `end` (string) — optional
  The end of the time range, as an RFC 3339 timestamp or Unix time in seconds.
Defaults to the current time.
- `limit` (number) — optional
  The maximum number of series to return. `0` means no limit from the request.

## Responses

`application/json`

- `status` (string)
  The status of the request: `success`.
- `data` (string to string[])
  The label sets of the matching series.
- `warnings` (string[])
  Warnings, such as a notice that the results were truncated because of `limit`.
## Code examples

#### Console

```console
POST /_prometheus/api/v1/series?match[]=up
```

#### JavaScript

```javascript
const response = await client.prometheus.series({
  match: "up",
});
```

#### Python

```python
resp = client.prometheus.series(
    match="up",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_prometheus/api/v1/series?match[]=up" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### PHP

```php
$resp = $client->prometheus()->series([
    "match[]" => "up",
]);
```

#### Ruby

```ruby
response = client.prometheus.series(
  match[]: "up"
)
```

## Response examples

#### A successful response

`application/json`

A successful response from `GET /_prometheus/api/v1/series`.

```json
{
  "status": "success",
  "data": [
    {
      "__name__": "up",
      "job": "prometheus",
      "instance": "localhost:9090"
    }
  ]
}
```

