Skip to main content
GET
/
v1
/
analytics
/
{projectId}
/
searches
Get search queries
curl --request GET \
  --url https://api.mintlify.com/v1/analytics/{projectId}/searches \
  --header 'Authorization: Bearer <token>'
{
  "searches": [
    {
      "searchQuery": "<string>",
      "hits": 123,
      "ctr": 123,
      "topClickedPage": "<string>",
      "lastSearchedAt": "<string>"
    }
  ],
  "totalSearches": 1,
  "nextCursor": "<string>"
}

Usage

Use this endpoint to export search query data from your documentation. Each result includes the search term, how many times it was searched, the click-through rate, and the most-clicked result page. Results are ordered by hit count descending, so the most popular search terms appear first. Paginate through results using the cursor parameter returned in the response. Continue fetching while nextCursor is not null.

Filtering

Filter search data by date range using dateFrom and dateTo parameters.

Search data

Each search term includes:
  • searchQuery: The term users searched for
  • hits: Total number of times this term was searched in the date range
  • ctr: Click-through rate, the ratio of searches that led to a result click (0–1)
  • topClickedPage: Path of the most-clicked search result for this query
  • lastSearchedAt: When the term was last searched
The totalSearches field in the response is the sum of all search events in the date range, not the number of distinct queries.

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. Use an admin API key (prefixed with mint_). This is a server-side secret key. Generate one on the API keys page in your dashboard.

Path Parameters

projectId
string
required

Your project ID. Can be copied from the API keys page in your dashboard.

Query Parameters

dateFrom
string

Date in ISO 8601 or YYYY-MM-DD format

Example:

"2024-01-01"

dateTo
string

Date in ISO 8601 or YYYY-MM-DD format. dateTo is an exclusive upper limit. Results include dates before, but not on, the specified date.

Example:

"2024-01-01"

limit
number
default:50

Max search terms per page (ordered by hit count descending)

Required range: 1 <= x <= 100
cursor
string

Opaque pagination cursor from the previous response

Response

Search term aggregates with pagination

searches
object[]
required

List of search term aggregates, ordered by hit count descending.

totalSearches
integer
required

Total count of search events in the requested date range (sum of all hits, not distinct queries).

Required range: x >= 0
nextCursor
string | null
required

Opaque pagination cursor for the next page. Null if no more results.