prometheus-api-client
A small python api to collect data from prometheus
Decision gist · record as of 2026-08-14
Yes. Active maintenance, permissive license, low install friction, no known vulnerabilities, and a straightforward API make this a solid choice for any Python application that needs to query Prometheus. Install the minimal version if you only need API access; add optional extras only if you need DataFrame or plotting support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only 2 runtime dependencies (requests and dateparser).
- Active maintenance with a recent release and ongoing repository activity.
- Optional dependencies for DataFrame and plotting support can be installed separately to minimize footprint.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive). No restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2026-04-13 (123 days) · last repo commit 2026-07-23 · 277 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,725,574 downloads/mo, #2,919 on PyPI
Alternatives
Verify before relying
pip install prometheus-api-client
from prometheus_api_client import PrometheusConnect
prom = PrometheusConnect(url="<prometheus-host>")
metrics = prom.all_metrics()
data = prom.custom_query(query="up")- Whether the package supports authentication methods beyond bearer tokens and basic HTTP headers.
- Performance characteristics when querying large time ranges or high-cardinality metrics.
- Compatibility with Prometheus remote storage or federation setups.
What it is and what it does
prometheus-api-client is a Python wrapper around Prometheus's HTTP API designed to simplify metrics collection and analysis. It provides the PrometheusConnect class for establishing connections to Prometheus servers, fetching metric lists, and executing instant and range queries. The library handles common tasks like label filtering, time-range chunking, and datetime parsing through its utils module.
Beyond basic API wrapping, the package includes higher-level abstractions: MetricsList and Metric classes for working with result sets as objects, optional DataFrame conversion for data analysis workflows, and plotting support via matplotlib. Core dependencies are minimal (requests and dateparser), with pandas, numpy, and matplotlib available as optional extras. This modular design lets you use just the query layer without pulling in data-science dependencies if your use case doesn't need them.
Use it for
- Fetch current or historical metrics from a Prometheus server for custom dashboards or alerting logic.
- Aggregate and combine multiple time-series queries programmatically for analysis or reporting.
- Export Prometheus metrics to pandas DataFrames for statistical analysis or machine-learning pipelines.
- Build monitoring automation that queries Prometheus and triggers actions based on metric values.
- Plot time-series data directly from Prometheus for ad-hoc visualization or debugging.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Active maintenance, permissive license, low install friction, no known vulnerabilities, and a straightforward API make this a solid choice for any Python application that needs to query Prometheus. Install the minimal version if you only need API access; add optional extras only if you need DataFrame or plotting support.
Install
prometheus-api-client on PyPI
Before you install
Low friction: pure Python wheel with only 2 runtime dependencies (requests and dateparser). Active maintenance with a recent release and ongoing repository activity. Optional dependencies for DataFrame and plotting support can be installed separately to minimize footprint.
License in practice
MIT license (permissive). No restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install prometheus-api-client
from prometheus_api_client import PrometheusConnect
prom = PrometheusConnect(url="<prometheus-host>")
metrics = prom.all_metrics()
data = prom.custom_query(query="up")
Verify before relying
- Whether the package supports authentication methods beyond bearer tokens and basic HTTP headers.
- Performance characteristics when querying large time ranges or high-cardinality metrics.
- Compatibility with Prometheus remote storage or federation setups.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesrequestsdateparser |
| Maintenance | Actively maintained 123 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,725,574 / month, #2,919 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.13 |
Evidence: prometheus_api_client-0.7.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “prometheus http api wrapper”
- prometheus-api-clientConnects to Prometheus monitoring systems and fetches time-series…
- prometheus-asyncAdds async/await support to Prometheus metrics collection for asyncio…
- opentelemetry-exporter-prometheusExports OpenTelemetry metrics to Prometheus for scraping and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also aioprometheus · prometheus-remote-writer · prometheus-fastapi-instrumentator · opentelemetry-exporter-prometheus · prometheus-flask-exporter · py-grpc-prometheus · prometheus-client · prometheus-client-python-speedups · signalfx · dt