Prometheus Query API

Query and evaluate PromQL expressions.

GitHub OpenAPI
Business capability
Observability Management BC-4220.20

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /query Evaluate a PromQL instant query · Evaluate an instant query #
Ask an LLM
“How do I run a PromQL expression against Prometheus right now?”
“Can I cap how far back a single instant query looks?”
Tell an agent
Evaluate {query} as an instant query.
Run {query} now with a {timeout} timeout.
POST /query Evaluate a PromQL instant query (POST) · Evaluate an instant query #
Ask an LLM
“Can I POST a PromQL expression to get an instant result?”
“Is there a POST form for evaluating a single PromQL expression?”
Tell an agent
POST the PromQL expression {query} and return its instant result.
Evaluate {query} as a POST request with stats {stats}.
GET /query_range Evaluate a PromQL range query · Evaluate a range query #
Ask an LLM
“How do I get Prometheus time series over a range of time?”
“Can I set the step size for a range query?”
Tell an agent
Evaluate {query} from {start} to {end} in steps of {step}.
Fetch {query} over {start} to {end} at {step} steps.
POST /query_range Evaluate a PromQL range query (POST) · Evaluate a range query #
Ask an LLM
“Can I POST a PromQL range query with a step size?”
“Is there a POST form for a time-range query?”
Tell an agent
POST the range query {query} from {start} to {end} at {step}.
Evaluate {query} over {start} to {end} in {step} steps via POST.
GET /query_exemplars Query exemplars for a metric · Query exemplars #
Ask an LLM
“How do I find the exemplars behind a particular metric?”
“Can I get exemplars for a time range?”
Tell an agent
Query exemplars for {query}.
Get exemplars for {query} between {start} and {end}.
POST /query_exemplars Query exemplars for a metric (POST) · Query exemplars #
Ask an LLM
“Can I POST a PromQL query to get exemplars?”
“Is there a POST form for exemplar queries?”
Tell an agent
POST the exemplar query {query}.
Get exemplars for {query} from {start} to {end} via POST.
GET /format_query Format a PromQL query · Format a PromQL query #
Ask an LLM
“How do I make a PromQL expression readable with proper indentation?”
“Can I pretty-print a PromQL query?”
Tell an agent
Format the PromQL expression {query}.
Pretty-print {query} with proper spacing.
POST /format_query Format a PromQL query (POST) · Format a PromQL query #
Ask an LLM
“Can I POST a PromQL expression to get it formatted?”
“Is there a POST form for PromQL formatting?”
Tell an agent
POST the PromQL expression {query} and return it formatted.
Format {query} as a POST request.
GET /parse_query Parse a PromQL query · Parse a PromQL query #
Ask an LLM
“How do I check whether a PromQL expression is valid?”
“Can I parse a PromQL query without evaluating it?”
Tell an agent
Parse the PromQL expression {query}.
Validate {query} as a PromQL query.
POST /parse_query Parse a PromQL query (POST) · Parse a PromQL query #
Ask an LLM
“Can I POST a PromQL expression to parse it?”
“Is there a POST form for PromQL parsing?”
Tell an agent
POST the PromQL expression {query} and parse it.
Parse {query} as a POST request.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/prometheus-io:prometheus-io-query-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

prometheus-io-query-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Prometheus Query API
  description: Prometheus is an Open-Source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
  contact:
    name: Prometheus Community
    url: https://prometheus.io/community/
  version: 0.0.1-undefined
servers:
- url: /api/v1
tags:


# --- truncated at 32 KB (43 KB total) ---
# Full source: https://artifacts.apis.io/prometheus-io/openapi/prometheus-io-query-api-openapi.yml