---
title: "Get Search History"
method: GET
path: "/search/search-history"
tags: ["public"]
---

# Get Search History

`GET /search/search-history`

## Request

- Base URL: `https://cloud.onyx.app/api`
- URL: `https://cloud.onyx.app/api/search/search-history`
- Auth: HTTP bearer

Fetch past search queries for the authenticated user.

Args:
    limit: Maximum number of queries to return (default 100)
    filter_days: Only return queries from the last N days (optional)

Returns:
    SearchHistoryResponse with list of search queries, ordered by most recent first.

## Query parameters

- `limit` integer
- `filter_days` integer, nullable

## Response `200`

Successful Response

- SearchHistoryResponse
  - `search_queries` SearchQueryResponse[], required
    - `query` string, required: The query as the user typed it.
    - `query_expansions` string[], nullable, required: Extra keyword queries generated for this search, or `null` when expansion was not run.
    - `created_at` string, date-time, required: When the query was run.

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-02** `fcb09658bc37`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/onyx-dot-app/apis/onyx-api/changes/search/search-history/get.md)

---

[API](https://skmtc.dev/onyx-dot-app/apis/onyx-api.md) - [All operations](https://skmtc.dev/onyx-dot-app/apis/onyx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/onyx-dot-app/apis/onyx-api/revisions/fcb09658bc37?raw)
