Metrics

Query timeseries points

Query timeseries points.

get/api/v1/query

Request

  • Base URL
    https://api.datadoghq.com
  • URL
    https://api.datadoghq.com/api/v1/query
  • Auth
    • API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
    • or OAuth 2
      Authorization code: /oauth2/v1/authorize
      Token URL: /oauth2/v1/token scopes: timeseries_query

Query parameters

frominteger required

Start of the queried time period, seconds since the Unix epoch.

tointeger required

End of the queried time period, seconds since the Unix epoch.

querystring required

Query string.

Response

OK

errorstring

Message indicating the errors if status is not ok.

from_dateinteger

Start of requested time window, milliseconds since Unix epoch.

group_bystring[]

List of tag keys on which to group.

messagestring

Message indicating success if status is ok.

querystring

Query string

res_typestring

Type of response.

statusstring

Status of the query.

to_dateinteger

End of requested time window, milliseconds since Unix epoch.

Example response

{
  "res_type": "time_series",
  "series": [
    {
      "aggr": "avg",
      "display_name": "system.cpu.idle",
      "expression": "system.cpu.idle{host:foo,env:test}",
      "metric": "system.cpu.idle",
      "pointlist": [
        [
          1681683300000,
          77.62145685254418
        ]
      ],
      "scope": "host:foo,env:test",
      "unit": [
        {
          "family": "time",
          "name": "minute",
          "plural": "minutes",
          "scale_factor": 60,
          "short_name": "min"
        }
      ]
    }
  ],
  "status": "ok"
}

Changes

No recorded changes to this operation across all 1 revision of this API.