---
title: "Get CTR Analytics"
method: POST
path: "/api/analytics/events/ctr"
tags: ["Analytics"]
---

# Get CTR Analytics

`POST /api/analytics/events/ctr`

This route allows you to view the CTR analytics for a dataset.

## Headers

- `TR-Dataset` string, uuid, required

## Request body

- union
  - object
    - `filter` SearchAnalyticsFilter
      - `component_name` string, nullable
      - `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
      - `query` string, nullable
      - `query_rating` QueryRatingRange
        - `gt` integer, nullable
        - `gte` integer, nullable
        - `lt` integer, nullable
        - `lte` integer, nullable
      - `search_method` 'fulltext' | 'semantic' | 'hybrid' | 'bm25'
      - `search_type` 'search' | 'autocomplete' | 'search_over_groups' | 'search_within_groups'
      - `top_score` FloatRange
        - `gt` number, double, nullable
        - `gte` number, double, nullable
        - `lt` number, double, nullable
        - `lte` number, double, nullable
    - `type` 'search_ctr_metrics', required
  - object
    - `filter` SearchAnalyticsFilter
      - `component_name` string, nullable
      - `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
      - `query` string, nullable
      - `query_rating` QueryRatingRange
        - `gt` integer, nullable
        - `gte` integer, nullable
        - `lt` integer, nullable
        - `lte` integer, nullable
      - `search_method` 'fulltext' | 'semantic' | 'hybrid' | 'bm25'
      - `search_type` 'search' | 'autocomplete' | 'search_over_groups' | 'search_within_groups'
      - `top_score` FloatRange
        - `gt` number, double, nullable
        - `gte` number, double, nullable
        - `lt` number, double, nullable
        - `lte` number, double, nullable
    - `page` integer, nullable
    - `type` 'searches_with_clicks', required
  - object
    - `filter` SearchAnalyticsFilter
      - `component_name` string, nullable
      - `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
      - `query` string, nullable
      - `query_rating` QueryRatingRange
        - `gt` integer, nullable
        - `gte` integer, nullable
        - `lt` integer, nullable
        - `lte` integer, nullable
      - `search_method` 'fulltext' | 'semantic' | 'hybrid' | 'bm25'
      - `search_type` 'search' | 'autocomplete' | 'search_over_groups' | 'search_within_groups'
      - `top_score` FloatRange
        - `gt` number, double, nullable
        - `gte` number, double, nullable
        - `lt` number, double, nullable
        - `lte` number, double, nullable
    - `page` integer, nullable
    - `type` 'searches_without_clicks', required
  - object
    - `filter` RecommendationAnalyticsFilter
      - `component_name` string, nullable
      - `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
      - `recommendation_type` 'Chunk' | 'Group'
      - `top_score` FloatRange
        - `gt` number, double, nullable
        - `gte` number, double, nullable
        - `lt` number, double, nullable
        - `lte` number, double, nullable
    - `type` 'recommendation_ctr_metrics', required
  - object
    - `filter` RecommendationAnalyticsFilter
      - `component_name` string, nullable
      - `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
      - `recommendation_type` 'Chunk' | 'Group'
      - `top_score` FloatRange
        - `gt` number, double, nullable
        - `gte` number, double, nullable
        - `lt` number, double, nullable
        - `lte` number, double, nullable
    - `page` integer, nullable
    - `type` 'recommendations_with_clicks', required
  - object
    - `filter` RecommendationAnalyticsFilter
      - `component_name` string, nullable
      - `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
      - `recommendation_type` 'Chunk' | 'Group'
      - `top_score` FloatRange
        - `gt` number, double, nullable
        - `gte` number, double, nullable
        - `lt` number, double, nullable
        - `lte` number, double, nullable
    - `page` integer, nullable
    - `type` 'recommendations_without_clicks', required

## Response `200`

The CTR analytics for the dataset

- union
  - SearchCTRMetrics
    - `avg_position_of_click` number, double, required
    - `percent_searches_with_clicks` number, double, required
    - `percent_searches_without_clicks` number, double, required
    - `searches_with_clicks` integer, required
  - CTRSearchQueryWithoutClicksResponse
    - `queries` SearchQueriesWithoutClicksCTRResponse[], required
      - `created_at` string, required
      - `query` string, required
      - `request_id` string, required
  - CTRSearchQueryWithClicksResponse
    - `queries` SearchQueriesWithClicksCTRResponse[], required
      - `clicked_chunk` ChunkMetadataWithPosition, required
        - `chunk` ChunkMetadata, required
          - `chunk_html` string, nullable — HTML content of the chunk, can also be an arbitrary string which is not HTML
          - `created_at` string, date-time, required — Timestamp of the creation of the chunk
          - `dataset_id` string, uuid, required — ID of the dataset which the chunk belongs to
          - `id` string, uuid, required — Unique identifier of the chunk, auto-generated uuid created by Trieve
          - `image_urls` string[], nullable — Image URLs of the chunk, can be any list of strings. Used for image search and RAG.
          - `link` string, nullable — Link to the chunk, should be a URL
          - `location` GeoInfo — Location that you want to use as the center of the search.
            - `lat` union, required
              - …
            - `lon` union, required
              - …
          - `metadata` unknown
          - `num_value` number, double, nullable — Numeric value of the chunk, can be any float. Can represent the most relevant numeric value of the chunk, such as a price, quantity in stock, rating, etc.
          - `tag_set` string[], nullable — Tag set of the chunk, can be any list of strings. Used for tag-filtered searches.
          - `time_stamp` string, date-time, nullable — Timestamp of the chunk, can be any timestamp. Specified by the user.
          - `tracking_id` string, nullable — Tracking ID of the chunk, can be any string, determined by the user. Tracking ID's are unique identifiers for chunks within a dataset. They are designed to match the unique identifier of the chunk in the user's system.
          - `updated_at` string, date-time, required — Timestamp of the last update of the chunk
          - `weight` number, double, required — Weight of the chunk, can be any float. Used as a multiplier on a chunk's relevance score for ranking purposes.
        - `position` integer, required
      - `created_at` string, required
      - `query` string, required
      - `request_id` string, required
      - `results` unknown[], required
        - unknown
  - RecommendationCTRMetrics
    - `avg_position_of_click` number, double, required
    - `percent_recommendations_with_clicks` number, double, required
    - `percent_recommendations_without_clicks` number, double, required
    - `recommendations_with_clicks` integer, required
  - CTRRecommendationsWithoutClicksResponse
    - `recommendations` RecommendationsWithoutClicksCTRResponse[], required
      - `created_at` string, required
      - `negative_ids` string[], nullable
      - `negative_tracking_ids` string[], nullable
      - `positive_ids` string[], nullable
      - `positive_tracking_ids` string[], nullable
      - `request_id` string, required
  - CTRRecommendationsWithClicksResponse
    - `recommendations` RecommendationsWithClicksCTRResponse[], required
      - `clicked_chunk` ChunkMetadataWithPosition, required
        - `chunk` ChunkMetadata, required
          - `chunk_html` string, nullable — HTML content of the chunk, can also be an arbitrary string which is not HTML
          - `created_at` string, date-time, required — Timestamp of the creation of the chunk
          - `dataset_id` string, uuid, required — ID of the dataset which the chunk belongs to
          - `id` string, uuid, required — Unique identifier of the chunk, auto-generated uuid created by Trieve
          - `image_urls` string[], nullable — Image URLs of the chunk, can be any list of strings. Used for image search and RAG.
          - `link` string, nullable — Link to the chunk, should be a URL
          - `location` GeoInfo — Location that you want to use as the center of the search.
            - `lat` union, required
              - …
            - `lon` union, required
              - …
          - `metadata` unknown
          - `num_value` number, double, nullable — Numeric value of the chunk, can be any float. Can represent the most relevant numeric value of the chunk, such as a price, quantity in stock, rating, etc.
          - `tag_set` string[], nullable — Tag set of the chunk, can be any list of strings. Used for tag-filtered searches.
          - `time_stamp` string, date-time, nullable — Timestamp of the chunk, can be any timestamp. Specified by the user.
          - `tracking_id` string, nullable — Tracking ID of the chunk, can be any string, determined by the user. Tracking ID's are unique identifiers for chunks within a dataset. They are designed to match the unique identifier of the chunk in the user's system.
          - `updated_at` string, date-time, required — Timestamp of the last update of the chunk
          - `weight` number, double, required — Weight of the chunk, can be any float. Used as a multiplier on a chunk's relevance score for ranking purposes.
        - `position` integer, required
      - `created_at` string, required
      - `negative_ids` string[], nullable
      - `negative_tracking_ids` string[], nullable
      - `positive_ids` string[], nullable
      - `positive_tracking_ids` string[], nullable
      - `request_id` string, required
      - `results` unknown[], required
        - unknown

## Other responses

- `400` — Service error relating to getting CTR analytics

---

[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)
