---
title: "Retrieve Trace Metadata"
url: https://docs.sentry.io/api/discover/retrieve-trace-metadata/
---

# Retrieve Trace Metadata | Sentry Docs

GET /api/0/organizations/{organization\_id\_or\_slug}/trace-meta/{trace\_id}/

Retrieve aggregate metadata for a single trace, including counts of spans, errors, performance issues, logs, and metrics, along with per-span-operation and per-transaction child-count breakdowns.

### Path Parameters

* `organization_id_or_slug` *(string)*

  REQUIRED

  The ID or slug of the organization the resource belongs to.

* `trace_id` *(string)*

  REQUIRED

  The ID of the trace, a 32-character hexadecimal string.

### Query Parameters:

* `statsPeriod` *(string)*

  The period of time for the query, will override the start & end parameters, a number followed by one of:

  * `d` for days
  * `h` for hours
  * `m` for minutes
  * `s` for seconds
  * `w` for weeks

  For example, `24h`, to mean query data starting from 24 hours ago to now.

* `start` *(string)*

  The start of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`.

* `end` *(string)*

  The end of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`.

* `timestamp` *(string)*

  The timestamp of an event in the trace, as an ISO 8601 string or Unix timestamp in seconds. When passed, the query is narrowed to a window around this time, which is faster than searching the full time range.

* `include_uptime` *(string)*

  **choices**:

  * `0
    1`

  Set to `1` to include uptime check counts in the response. Defaults to `0` (disabled).

### Scopes

You need to [authenticate via bearer auth token.](https://docs.sentry.io/api/auth.md)

`<auth_token>` requires one of the following scopes:

* `org:admin`
* `org:read`
* `org:write`

```
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/trace-meta/{trace_id}/ \
 -H 'Authorization: Bearer <auth_token>'
```

RESPONSESCHEMA

```
Copied
{
  "errorsCount": 0,
  "logsCount": 5,
  "metricsCount": 0,
  "performanceIssuesCount": 0,
  "spansCount": 195,
  "transactionChildCountMap": [
    {
      "transaction.event_id": "280027d94f30428c83a2de46f932612a",
      "count()": 7
    },
    {
      "transaction.event_id": "66087f4e87c847759db67fd62e32829c",
      "count()": 38
    }
  ],
  "spansCountMap": {
    "db": 58,
    "cache.get": 56,
    "http.server": 6
  }
}
```

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
