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.
Datadog APM Spans API declares
4 security schemes
for authenticating requests.
It supports OAuth 2.0 (AuthZ) using the authorizationCode flow, exposing 96 scopes.
An API key is passed in the header as DD-API-KEY (apiKeyAuth).
An API key is passed in the header as DD-APPLICATION-KEY (appKeyAuth).
It accepts HTTP bearer tokens (bearerAuth).
By default, every request must be authenticated.
AuthZ — This API uses OAuth 2 with the implicit grant flow.
apiKeyAuth — Your Datadog API Key.
appKeyAuth — Your Datadog APP Key.
Paths & Operations 3
Across 3 paths, the API surfaces 3 operations — 1 GET, 2 POST. Each is listed below with its method, path, parameters, and response codes.
Spans 3
Search and aggregate your spans from your Datadog platform over HTTP.
POST
/api/v2/spans/analytics/aggregate
Aggregate spans
AggregateSpansbody→ 200400403429
GET
/api/v2/spans/events
Get a list of spans
ListSpansGet6 params→ 200400403422429
POST
/api/v2/spans/events/search
Search spans
ListSpansbody→ 200400403422429
Schemas 50
The contract defines 50 schemas that model the data the API accepts and returns. The most detailed are SpansAttributes (17 properties), SpansGroupBy (6 properties), SpansListResponseMetadata (5 properties), JSONAPIErrorItem (5 properties). Each schema is shown below with its type and property counts.
SpansType
string
Type of the span.
SpansListRequestType
string
The type of resource. The value should always be searchrequest.
SpansAggregateBucketValueSingleNumber
number
A single number value.
SpansListRequestData
object
The object containing the query content.
2 properties
SpansAggregateResponseMetadata
object
The metadata associated with a request.
4 properties
SpansAggregateResponse
object
The response object for the spans aggregate API endpoint.
2 properties
SpansAggregateBucket
object
Spans aggregate.
3 properties
SpansAggregateRequest
object
The object sent with the request to retrieve a list of aggregated spans from your organization.
1 property
SpansAggregateRequestAttributes
object
The object containing all the query parameters.
4 properties
SpansQueryOptions
object
Global query options that are used during the query. Note: You should only supply timezone or time offset but not both otherwise the query will fail.
2 properties
SpansAggregateBucketAttributes
object
A bucket values.
3 properties
SpansAggregateBucketType
string
The spans aggregate bucket type.
JSONAPIErrorResponse
object
API error response.
1 property1 required
SpansListRequest
object
The request for a spans list.
1 property
SpansAggregateSort
object
A sort rule.
4 properties
SpansGroupByTotal
A resulting object to put the given computes in over all the matching records.
SpansSortOrder
string
The order to use, ascending or descending.
SpansListRequestAttributes
object
The object containing all the query parameters.
4 properties
JSONAPIErrorItem
object
API error response body
5 properties
SpansAggregateBucketValueSingleString
string
A single string value.
SpansGroupByMissingNumber
number
The missing value to use if there is a number valued facet.
SpansAggregateBucketValue
A bucket value, can be either a timeseries or a single value.
SpansAggregationFunction
string
An aggregation function.
SpansQueryFilter
object
The search and filter query settings.
3 properties
SpansAggregateRequestType
string
The type of resource. The value should always be aggregaterequest.
SpansGroupByTotalBoolean
boolean
If set to true, creates an additional bucket labeled "$facettotal".
SpansWarning
object
A warning message indicating something that went wrong with the query.
3 properties
SpansGroupByMissingString
string
The missing value to use if there is string valued facet.
SpansResponseMetadataPage
object
Paging attributes.
1 property
SpansCompute
object
A compute rule to compute metrics or timeseries.
4 properties1 required
SpansListResponse
object
Response object with all spans matching the request and pagination information.
3 properties
SpansAggregateBucketValueTimeseriesPoint
object
A timeseries point.
2 properties
APIErrorResponse
object
API error response.
1 property1 required
SpansGroupByMissing
The value to use for spans that don't have the facet used to group by.
JSONAPIErrorItemSource
object
References to the source of the error.
3 properties
SpansListResponseLinks
object
Links attributes.
1 property
SpansAggregateSortType
string
The type of sorting algorithm.
SpansAggregateData
object
The object containing the query content.
2 properties
SpansSort
string
Sort parameters when querying spans.
Span
object
Object description of a spans after being processed and stored by Datadog.
3 properties
SpansListRequestPage
object
Paging attributes for listing spans.
2 properties
SpansGroupByHistogram
object
Used to perform a histogram computation (only for measure facets). Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.
3 properties3 required
SpansGroupByTotalNumber
number
A number to use as the key value for the total bucket.
SpansGroupBy
object
A group by rule.
6 properties1 required
SpansAttributes
object
JSON object containing all span attributes and their associated values.
17 properties
SpansListResponseMetadata
object
The metadata associated with a request.
5 properties
SpansComputeType
string
The type of compute.
SpansAggregateBucketValueTimeseries
array
A timeseries array.
SpansGroupByTotalString
string
A string to use as the key value for the total bucket.
SpansAggregateResponseStatus
string
The status of the response.
Specification
The full machine-readable OpenAPI contract behind this narrative.
Every API here is available over the API and to AI agents over MCP. APIs is not yet its own endpoint on the v1 API. Reach this content through network search and the tag graph, or the MCP server below.
Installs https://mcp.apievangelist.com/mcp in Claude, Cursor, VS Code and the rest — one button, every client.
MCP tools for apis
4 tools reach this content
search_api_evangelistSearch every content type across the network at once.
find_relatedThe shared-tag relevance graph — what else covers this.
get_tagEverything one tag labels, across all content types.
guide_topicPRO — a curated bundle for a topic: area, guidance, rules, papers, stories, services.
A second provider on the same verified email joins the account you already have.
Your account
ⓘWhere this information came from
This is an independent, third-party profile of Datadog APM Spans API, published by
API Evangelist. We do not operate, host, resell, or
support these APIs, and we are not affiliated with or endorsed by the company unless stated above.
Everything here is built from publicly available information — the company's own site,
developer portal, documentation, public repositories, and the specifications it publishes for public use.
Nothing is obtained by breaching a system, defeating an access control, or using credentials.
The Kin Score and Agent Readiness rating are independently calculated assessments of a company's
public API artifacts, scored against a published rubric. They are not certifications,
endorsements, security assessments, or audits.
Corrections, re-scores, and removal are free — no partnership or purchase required, and
you do not need to justify the request. A removed company is recorded as unrated, never scored
zero for having asked. Acknowledgement within one business day; removal within two.
info@apievangelist.com
·
Read the full data-sourcing policy → On a security or compliance team? Put security in the subject line and
you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.