---
title: "Fetch Legacy Analytics"
method: POST
path: "/preview/tracing/spans/analytics"
tags: ["Deprecated"]
---

# Fetch Legacy Analytics

`POST /preview/tracing/spans/analytics`

## Query parameters

- `focus` 'trace' | 'span'
- `format` 'agenta' | 'opentelemetry'
- `oldest` union
  - string
  - integer
- `newest` union
  - string
  - integer
- `limit` integer, nullable
- `interval` integer, nullable
- `rate` number, nullable
- `filter` unknown

## Response `200`

Successful Response

- OldAnalyticsResponse
  - `count` integer
  - `buckets` Bucket[]
    - `timestamp` string, date-time, required
    - `interval` integer, required
    - `total` Analytics, required
      - `count` integer, nullable
      - `duration` number, nullable
      - `costs` number, nullable
      - `tokens` number, nullable
    - `errors` Analytics, required
      - `count` integer, nullable
      - `duration` number, nullable
      - `costs` number, nullable
      - `tokens` number, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-01-14** `53da4c9de2b7` — 3 info
  - api operation id `fetch_analytics` removed and replaced with `fetch_legacy_analytics`
  - api tag `Deprecated` added
  - api tag `Tracing` removed
- **2025-11-05** `e62506c24377` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/preview/tracing/spans/analytics/post.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agenta-ai/apis/agenta-api/revisions/53da4c9de2b7?raw)
