Query timeseries or scalar data across multiple Datadog products via the v2 query API
domain: docs.datadoghq.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
POST a query definition to /api/v2/query/timeseries to get time-bucketed results, or to /api/v2/query/scalar for single aggregated values.
Structure the request body to reference the specific data source being queried, per the v2 query request schema.
Authenticate with the DD-API-KEY header (and DD-APPLICATION-KEY where required).
Use the regional API host matching your Datadog site, consistent with other Datadog API v2 endpoints.
Use these endpoints instead of the legacy /api/v1/query endpoint when a dashboard or integration needs to query beyond plain metrics.
Known gotchas
The v2 query endpoints are POST-based with a structured JSON body, unlike the GET-with-query-string style of the legacy /api/v1/query endpoint — existing v1 integration code can't simply be repointed at v2 without rewriting the request.
Because querying is cross-product, the exact request schema depends on which data source is being queried — don't assume metrics-only query syntax applies uniformly across all sources.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?