---
title: "Run multiple Prometheus queries in one request"
method: POST
path: "/api/v1/prometheus/query_batch"
tags: ["Prometheus Metrics"]
---

# Run multiple Prometheus queries in one request

`POST /api/v1/prometheus/query_batch`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/prometheus/query_batch`
- Auth: API key in header `Authorization`

Executes up to 20 PromQL queries (instant and/or range) concurrently against the default Prometheus instance and returns results keyed by query id. Replaces many separate /query and /query_range calls.

## Request body

- PrometheusApiBatchQueryRequest: Batch of PromQL queries. start/end/step are shared by all range queries.
  - `end` string
  - `queries` PrometheusApiBatchQueryItem[]
    - `id` string
    - `query` string
    - `type` 'instant' | 'range'
  - `start` string
  - `step` string

## Response `200`

Results keyed by query id

- object

## Other responses

- `400`: Bad request
- `500`: Internal server error

---

[API](https://skmtc.dev/nife/apis/nife-io-swagger-api.md) - [All operations](https://skmtc.dev/nife/apis/nife-io-swagger-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nife/apis/nife-io-swagger-api/revisions/6e868dc62795?raw)
