---
title: Metrics API
description: Query your hosted Coralogix metrics over a Prometheus-compatible API, either programmatically or as a Grafana data source.
url: https://coralogix.com/docs/user-guides/data-query/metrics-api/
product: dataengine
feature: PromQL Queries
feature_id: metrics.promql-queries
feature_identifier: dataengine/metrics.promql-queries
last_updated: '2026-09-02'
---

# Metrics API

The Metrics API gives you access to every metric you have sent to Coralogix through a Prometheus-compatible interface. That means two things in practice: you can query metrics programmatically with `curl` or any HTTP client, and you can point a [Grafana Prometheus data source](https://grafana.com/docs/grafana/latest/datasources/prometheus/) straight at it.

## What you need

* A [custom API key](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md) with the `DataQuerying` role preset, or the `Query Metrics` permission `metrics.data-api#high:ReadData`. A `Legacy Logs Query API Key` also works.
* The metrics endpoint for your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md). Use the domain selector at the top of this page to resolve it:
  <!-- -->
  https\://api./metrics

Every request carries the key in an `Authorization` header:

```
Authorization: Bearer <API-Key>
```

## Query metrics programmatically

An instant query evaluates an expression at a single point in time:

```
curl --location --request GET 'https://api.eu2.coralogix.com/metrics/api/v1/query?query=vector(1)' --header 'Authorization: Bearer <API-Key>'
```

Substitute the endpoint for your domain and your own API key.

## Use it as a Grafana data source

1

<!-- -->

.

Add the data source

In Grafana, select **Home**, then **Connections**, then **Add new connection**. Search for **Prometheus**, then select **Add new data source**.

2

<!-- -->

.

Configure the connection

Set **Prometheus server URL** to the metrics endpoint for your Coralogix domain.

3

<!-- -->

.

Configure authentication

Under **HTTP headers**, add a header named `Authorization` with the value `Bearer <API-Key>`.

4

<!-- -->

.

Set the Prometheus version

Under **Advanced settings**, then **Performance**, set **Prometheus type** to `Prometheus` and **Prometheus version** to `2.24.x`.

5

<!-- -->

.

Save and test

Select **Save & test**. A successful query to the Prometheus API confirms the data source works.

Grafana's own [Prometheus data source documentation](https://grafana.com/docs/grafana/latest/datasources/prometheus/) covers the remaining options.

## Supported endpoints

Available for both GET and POST. See the [Prometheus HTTP API reference](https://prometheus.io/docs/prometheus/latest/querying/api) for their parameters.

| Endpoint                            | Purpose                       |
| ----------------------------------- | ----------------------------- |
| `/api/v1/query`                     | Instant query                 |
| `/api/v1/query_range`               | Range query                   |
| `/api/v1/label/<label_name>/values` | Query label values            |
| `/api/v1/labels`                    | Get label names               |
| `/api/v1/series`                    | Find series by label matchers |

## Unsupported endpoints

These Prometheus endpoints are not available on the Coralogix Metrics API.

| Endpoint                   | Purpose                                    |
| -------------------------- | ------------------------------------------ |
| `/api/v1/alerts`           | List active alerts                         |
| `/api/v1/query_exemplars`  | Query exemplars for a series over time     |
| `/api/v1/rules`            | List alerting and recording rules          |
| `/api/v1/targets/metadata` | Return metadata about metrics from targets |

## Related resources

[API keys](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md)[Coralogix domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md)[Prometheus HTTP API](https://prometheus.io/docs/prometheus/latest/querying/api/)
