---
title: "Top Searches"
method: GET
path: "/api/admin/top-searches"
tags: ["Admin"]
---

# Top Searches

`GET /api/admin/top-searches`

## Request

- Base URL: `https://pegarex.com.br` (the document declares no server; this is the origin it was published from)
- URL: `https://pegarex.com.br/api/admin/top-searches`
- Auth: HTTP bearer

Most-used search filters. Tells you what users actually look for.

The search UI sends brand_id / model_id (catalog ids), not names — only
the free-text API path ever sends `brand` as a string. This used to group
on the string, so every dropdown search fell into "(any) / (any)" and the
table said nothing (on the office mirror: 0 of 60 events had a brand
string, 32 had a brand_id). Resolve the ids through the catalog and keep
the string as a fallback for the API path.

The ids arrive as JSON text; the regex guard keeps a malformed value from
failing the whole query on the cast.

## Query parameters

- `days` integer
- `limit` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pegarex/apis/pegarex-api.md) · [All operations](https://skmtc.dev/pegarex/apis/pegarex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pegarex/apis/pegarex-api/revisions/8c789c9bd72d?raw)
