---
title: pydo.insights.get_prom_query()
description: Execute an instant PromQL query
product: Reference
url: https://docs.digitalocean.com/reference/pydo/reference/insights/get_prom_query/
last_updated: "2026-10-16"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# pydo.insights.get_prom_query()

Generated on 16 Oct 2026 from `pydo` version [`v0.44.0`](https://github.com/digitalocean/pydo/releases/tag/v0.44.0v0.44.0)

## Usage

```python
client.insights.get_prom_query(
    region="nyc3",
    query="do.droplets.cpu_time",
    time=None,
    timeout=None,
)
```

Returns `JSON` Raises `HttpResponseError`

## Description

To evaluate a PromQL expression at a single point in time, send a GET request to [`/v2/insights/query/{region}/prom/api/v1/query`](https://docs.digitalocean.com/reference/api/reference/insights/index.html.md#insights_get_promQuery).

## Parameters

`region` string required

The datacenter region slug for the query.

`query` string required

A PromQL expression. This may be a metric selector (for example `do.droplets.cpu_time`) or a fuller expression (for example `rate(do.droplets.cpu_time[5m])`).

`time` string optional

Evaluation timestamp for an instant query. Accepts a RFC3339 string or a UNIX timestamp. Defaults to now when omitted.

`timeout` string optional

Optional evaluation timeout as a Prometheus duration string.

## Response Example

## Show Response Example

```json
{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "__name__": "do_droplets_cpu_time"
        },
        "value": [
          1620683817,
          "1"
        ]
      }
    ]
  }
}
```

## More Information

See [`/v2/insights/query/{region}/prom/api/v1/query`](https://docs.digitalocean.com/reference/api/reference/insights/index.html.md#insights_get_promQuery) in the API reference for additional detail on responses, headers, parameters, and more.