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

# Retrieve a Trace | Sentry Docs

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

Retrieve the spans, errors, and (optionally) uptime checks that make up a single trace.

The response is a list of top-level events; each item may have nested `children`, `errors`, and `occurrences` arrays representing related items. Top-level entries are spans by default and may also be uptime checks when `include_uptime=1` is passed.

### 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`.

* `referrer` *(string)*

  Internal referrer identifier used for query tracing. Most clients can omit this.

* `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.

* `errorId` *(string)*

  A 32-character hexadecimal event ID to bias the trace results toward including.

* `additional_attributes` *(array(string))*

  Additional span attributes to include on each event. Repeat to request multiple.

* `include_uptime` *(string)*

  **choices**:

  * `0
    1`

  Set to `1` to include uptime check results in the trace. Defaults to `0`.

### 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/{trace_id}/ \
 -H 'Authorization: Bearer <auth_token>'
```

RESPONSESCHEMA

```
Copied
[
  {
    "event_id": "0123456789abcdef0123456789abcdef",
    "event_type": "span",
    "transaction_id": "280027d94f30428c83a2de46f932612a",
    "project_id": 4505281256090153,
    "project_slug": "javascript",
    "transaction": "POST /api/0/projects/{org}/{proj}/events/{event_id}/attachments/",
    "description": "POST /api/0/projects/{org}/{proj}/events/{event_id}/attachments/",
    "op": "http.server",
    "name": "http.server",
    "parent_span_id": null,
    "profile_id": "",
    "profiler_id": "",
    "sdk_name": "sentry.python",
    "is_transaction": true,
    "start_timestamp": 1776277351,
    "end_timestamp": 1776277351.25,
    "duration": 250,
    "measurements": {
      "measurements.frames_slow_rate": 0.02,
      "measurements.frames_frozen_rate": 0.01
    },
    "browser_web_vital": {
      "browser.web_vital.lcp.value": 2807.335,
      "browser.web_vital.cls.value": 0.0382,
      "browser.web_vital.inp.value": 120,
      "browser.web_vital.ttfb.value": 450,
      "browser.web_vital.fcp.value": 2258.06
    },
    "mobile_app_vital": {
      "app.vitals.start.cold.value": 1600,
      "app.vitals.start.warm.value": 400,
      "app.vitals.ttid.value": 1200,
      "app.vitals.ttfd.value": 2400
    },
    "children": [],
    "errors": [],
    "occurrences": []
  }
]
```

---

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.
