Datadog APM Spans API

Search, list and aggregate APM spans. Three operations covering cursor-paginated span search (POST and GET forms) and a span analytics aggregation that returns single numbers, single strings or timeseries buckets.

Business capability
Observability Management BC-4220.20

Operations 3

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /api/v2/spans/analytics/aggregate Aggregate spans into metrics and timeseries · Aggregate spans #
Ask an LLM
“Can I compute p95 latency per service from my spans over a time range?”
“How do I bucket spans and count them as a timeseries?”
Tell an agent
Aggregate spans using {aggregation} and return the computed buckets.
Count error spans grouped by service as a timeseries for the last day.
GET /api/v2/spans/events List recent spans matching a query · Get a list of spans #
Ask an LLM
“What are the latest spans for a service in the last 15 minutes?”
“Can I pull spans with a simple query string and time range in the URL?”
Tell an agent
Get the latest spans matching {query} from {from} to {to}.
List up to {limit} of my most recent spans.
POST /api/v2/spans/events/search Search spans with a complex filter body · Search spans #
Ask an LLM
“How do I run an advanced span search with a full filter object in the request body?”
“Which spans match a complex search across several attributes?”
Tell an agent
Search spans using the filter body {search}.
Run a complex span search for slow checkout requests with errors, sorted by duration.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/datadog-apm:datadog-apm-spans-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

datadog-apm-spans-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Datadog APM — APM, and Service Definitions (API v2) Spans…
  description: The APM, retention filter, span, span-metric and service-definition surface of the Datadog API v2, extracted verbatim from the OpenAPI definition Datadog publishes for its own API clients.
  version: '1.0'
  contact:
    email: support@datadoghq.com
    name: Datadog Support
    url: https://www.datadoghq.com/support/
  x-source: https://raw.githubusercontent.com/DataDog/datadog-api-client-go/master/.generator/schemas/v2/openapi.yaml
  x-extracted: '2026-09-05'
  x-extraction-note: Path items, components and security schemes copied VERBATIM from the Datadog-published OpenAPI at x-source; only the APM-relevant subset of paths is retained. No content was authored by API Evangelist.
servers:
- url: https://{subdomain}.{site}
  variables:
    site:
      default: datadoghq.com
      description: The regional site for Datadog customers.
      enum:
      - datadoghq.com
      - us3.datadoghq.com
      - us5.datadoghq.com
      - ap1.datadoghq.com
      - ap2.datadoghq.com
      - uk1.datadoghq.com
      - datadoghq.eu
      - ddog-gov.com
      - us2.ddog-gov.com
      - uk1.datadoghq.com
    subdomain:
      default: api
      description: The subdomain where the API is deployed.
- url: '{protocol}://{name}'
  variables:
    name:
      default: api.datadoghq.com
      description: Full site DNS name.
    protocol:
      default: https
      description: The protocol for accessing the API.
- url: https://{subdomain}.{site}
  variables:
    site:
      default: datadoghq.com
      description: Any Datadog deployment.
    subdomain:
      default: api
      description: The subdomain where the API is deployed.
security:
- apiKeyAuth: []
  appKeyAuth: []
tags:


# --- truncated at 32 KB (41 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/datadog-apm/refs/heads/main/openapi/datadog-apm-spans-api-openapi.yml