You can fetch all metrics with following curl expression:

url=http://{urIPorhostname}:9090    
curl -s  $url/api/v1/label/__name__/values | jq -r ".data[]" | sort 
Answer from Boris Ivanov on Stack Overflow
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › api
HTTP API | Prometheus
The data section of the query result consists of a list of objects that contain metric metadata and the target label set. The following example returns all metadata entries for the go_goroutines metric from the first two targets with label job="prometheus". curl -G http://localhost:9091/api/v1/targets/metadata \ --data-urlencode 'metric=go_goroutines' \ --data-urlencode 'match_target={job="prometheus"}' \ --data-urlencode 'limit=2'
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › examples
Query examples | Prometheus
Join PromCon EU 2026 , the Prometheus users conference, on October 7–8, 2026 in Munich. PromCon EU 2026 — Oct 7–8, Munich. ... Return a whole range of time (in this case 5 minutes up to the query time) for the same vector, making it a range vector: http_requests_total{job="apiserver", handler="/api/comments"}[5m]
🌐
Last9
last9.io › blog › prometheus-api
Prometheus HTTP API: Query and Manage Metrics (2026) | Last9
March 6, 2025 - Use the Prometheus HTTP API to run instant and range queries, read metadata and targets, and manage rules, with curl examples for each endpoint.
🌐
Google Groups
groups.google.com › g › prometheus-developers › c › exc5RKBLpOg
Prometheus Query Rest API for Multiple metrics
Let say i want to do single api request to get both rate(http_requests_total[5m]), rate(memory_free[5m]) Will it be possible ? No, you need to make two requests. It also doesn't make sense to take a rate on a gauge like memory_free. ... I could find only four type of query( Instant queries, Range queries, Querying metadata, Querying label values ). -- You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
🌐
GitHub
github.com › samber › prometheus-query-js
GitHub - samber/prometheus-query-js: 📊 A Javascript client for Prometheus query API
import { PrometheusDriver } from 'prometheus-query'; const prom = new PrometheusDriver({ endpoint: "https://prometheus.demo.do.prometheus.io", baseURL: "/api/v1" // default value });
Author: samber
🌐
Rust
docs.rs › prometheus-http-query
prometheus_http_query - Rust
This crate provides an interface to the Prometheus HTTP API. The Client is used to interact with a Prometheus server. It is basically a wrapper around a reqwest::Client and implements additional methods to execute PromQL queries and fetch metadata.
🌐
Medium
medium.com › @Tom1212121 › prometheus-api-v1-query-vs-promql-19335397b6aa
Prometheus API (v1/query) vs. PromQL | by Tomer Ben David | Medium
October 9, 2024 - Prometheus, provides two primary interfaces for querying time series data: the API (specifically /v1/query) and PromQL. While both serve…
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › azure › azure-monitor › metrics › prometheus-api-promql
Query Prometheus Metrics using the API and PromQL - Azure Monitor | Microsoft Learn
Prometheus Query Language (PromQL) is a functional query language that you can use to query and aggregate time-series data. Use PromQL to query and aggregate metrics stored in an Azure Monitor workspace.
🌐
Postman
postman.com › oracledevs › verrazzano-1-x-apis › documentation › wdd55hg › prometheus-http-api
Prometheus HTTP API | Documentation | Postman API Network
NOTE: This endpoint marks samples from series as deleted, but will not necessarily prevent associated series metadata from still being returned in metadata queries for the affected time range (even after cleaning tombstones). The exact extent of metadata deletion is an implementation detail that may change in the future. ... (Required) Repeated label matcher argument that selects the series to delete. At least one match[] argument must be provided. Example: ?match[]=up&match[]=process_start_time_seconds{job="prometheus"}'
Top answer
1 of 4
7

You can fetch all metrics with following curl expression:

url=http://{urIPorhostname}:9090    
curl -s  $url/api/v1/label/__name__/values | jq -r ".data[]" | sort 
2 of 4
2

All the metrics for a particular instance IP:9100 can be obtained via the following PromQL query:

{instance="IP:9100"}

This query returns all the metrics, which have the given instance="IP:9100" label. See time series selector docs for more details. See also PromQL tutorial.

The {instance="IP:9100"} query can be sent to the following Prometheus querying APIs:

  • /api/v1/query - this endpoint returns matching time series values at the given timestamp specified via time query arg. For example, curl 'http://prometheus:9090/api/v1/query?query={instance="IP:9100"}' . Make sure you properly encoded query arg with percent encoding. See this demo.
  • /api/v1/series - this endpoint returns matching time series without any data, e.g. only metric names and labels are returned. For example, curl 'http://prometheus:9090/api/v1/series?match[]={instance="IP:9100"}'. Make sure you properly encoded match[] arg with percent encoding. See this demo
  • /api/v1/query_range - this endpoint returns calculated datapoints for matching time series on the selected time range [start ... end] with the given step interval between samples. See more details about calculated datapoints in these docs.

If you want returning just unique metric names without labels, then you can query /api/v1/label/__name__/values endpoint: curl http://prometheus:9090/api/v1/label/__name__/values . The __name__ is a special label name used in Prometheus for referring to metric names. Note that multiple time series may share the same metric name. For example, http_requests_total{path="/foo"} and http_requests_total{path="/bar"} time series share http_requests_total metric name, while they differ by path label values.

      » pip install prometheus-api-client
    
Published: Apr 13, 2026
Version: 0.7.2
🌐
Grafana
community.grafana.com › prometheus
How to query Grafana Cloud prometheus endpoint from client? - Prometheus - Grafana Labs Community Forums
November 28, 2024 - As far as I’m aware, the only way to access data posted to the Grafana Cloud Prometheus endpoint is to query it from a Grafana dashboard. Is it possible to query the Prometheus endpoint from outside the dashboard? Or c…
🌐
Thanos
thanos.io › v0.6 › components › query
Query API
The query component implements the Prometheus HTTP v1 API to query data in a Thanos cluster via PromQL.
🌐
Stack Overflow
stackoverflow.com › questions › 77389374 › query-prometheus-http-api-by-list-of-metrics
promql - query Prometheus HTTP API by list of metrics - Stack Overflow
If you need list grouped by metric, you might use endpoint api/v1/series. It returns the list of time series matching selector (basically all the possible labels for every selected metric). ... curl -g 'https://prometheus.demo.do.prometheus.io/api/v1/series?'
🌐
Alibaba Cloud
alibabacloud.com › help › en › arms › prometheus-monitoring › http-api-urls
Use an HTTP API URL to access Prometheus data in a self-managed Grafana system or a custom application - Application Real-Time Monitoring Service - Alibaba Cloud Documentation Center
March 10, 2026 - curl -G '<your-http-api-url>/api/v1/query' \ -u '<your-accesskey-id>:<your-accesskey-secret>' \ -H 'Accept: application/json' \ --data-urlencode 'query=arms_prometheus_target_interval_length_seconds_sum' \ --data-urlencode 'time=1635302655' \ --data-urlencode 'timeout=1000'
🌐
Last9
last9.io › blog › prometheus-api-guide
An Easy and Comprehensive Guide to Prometheus API | Last9
March 27, 2025 - The Prometheus API has several endpoints, but these five will handle 90% of your needs: ... This endpoint gives you a snapshot of metrics right now. Perfect for current status checks. ... When you need metrics over time (like for graphs), this is your go-to. ... curl 'http://localhost:9090/api/v1/query_range?query=rate(http_requests_total[5m])&start=2023-01-01T20:10:30.781Z&end=2023-01-01T20:11:00.781Z&step=15s'
🌐
Google
docs.cloud.google.com › google cloud observability › query using the prometheus api or ui
Query using the Prometheus API or UI | Google Cloud Observability | Google Cloud Documentation
As a Google Cloud API, the API uses OAuth2 authentication, and as part of the Cloud Monitoring API, the value of the PROJECT_ID is the scoping project of a metrics scope, so you can retrieve data from any project in the metrics scope. For more information about scoping, see Metrics scopes. To use this endpoint, provide a PromQL expression. For example, the following instant query retrieves all time series that have the metric name up: curl https://monitoring.googleapis.com/v1/projects/PROJECT_ID/location/global/prometheus/api/v1/query \ -d "query=up" \ -H "Authorization: Bearer $(gcloud auth print-access-token)"
🌐
Grafana
grafana.com › docs › grafana-cloud › cost-management-and-billing › analyze-costs › metrics-costs › prometheus-metrics-costs › usage-analysis-api
Analyze metrics usage with the Prometheus API | Grafana Cloud documentation
To learn more about the Prometheus HTTP API, see the Prometheus API docs. ... This method may report some inactive metrics. To use the metadata API to quickly fetch a list of all metrics, perform the following HTTP request using curl: ... This queries the /api/v1/label endpoint for metric names using the __name__ meta-label.
🌐
Thomas Suedbroecker
suedbroecker.net › 2022 › 04 › 12 › access-prometheus-queries-using-the-prometheus-rest-api
Access Prometheus queries using the Prometheus HTTP API – Thomas Suedbroecker's Blog
April 12, 2022 - The following simplified diagram shows the dependencies. Prometheus gets the counter values over the /metrics endpoint and we will use the Prometheus HTTP API /api/v1/query?query=goobers_total to extract the goobers_total counter values from Prometheus.