---
title: "Get Top Datasets"
method: POST
path: "/api/analytics/top"
tags: ["Analytics"]
---

# Get Top Datasets

`POST /api/analytics/top`

This route allows you to view the top datasets for a given type.

## Headers

- `TR-Organization` string, uuid, required

## Request body

- GetTopDatasetsRequestBody
  - `date_range` DateRange — DateRange is a JSON object which can be used to filter chunks by a range of dates. This leverages the time_stamp field on chunks in your dataset. You can specify this if you want values in a certain range. You must provide ISO 8601 combined date and time without timezone.
    - `gt` string, nullable
    - `gte` string, nullable
    - `lt` string, nullable
    - `lte` string, nullable
  - `type` 'search' | 'rag' | 'recommendation', required

## Response `200`

The top datasets for the request

- TopDatasetsResponse[]
  - `dataset_id` string, uuid, required
  - `dataset_tracking_id` string, nullable
  - `total_queries` integer, required

## Other responses

- `400` — Service error relating to getting top datasets

---

[API](https://skmtc.net/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.net/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/revisions/84583e7c9fc1/schema)
