Skip to main content
Mintlify

Search documentation

Type to search this documentation.

On this pageOverview

Get search queries

GET

/

v1

/

analytics

/

/

searches

Get search queries

curl --request GET \
  --url https://api.mintlify.com/v1/analytics/{projectId}/searches \
  --header 'Authorization: Bearer <token>'
title="200"
{
  "searches": [
    {
      "searchQuery": "<string>",
      "hits": 123,
      "ctr": 123,
      "topClickedPage": "<string>",
      "lastSearchedAt": "<string>"
    }
  ],
  "totalSearches": 1,
  "nextCursor": "<string>"
}
title="400"
{
  "error": "<string>",
  "details": [
    {
      "message": "<string>"
    }
  ]
}
title="500"
{
  "error": "<string>",
  "details": [
    {
      "message": "<string>"
    }
  ]
}

Use this endpoint to export documentation search analytics. Results are ordered by hit count descending, showing which terms your users search for most. Paginate through results using the nextCursor parameter returned in the response. Continue fetching while nextCursor is not null.

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

This endpoint allows 100 requests per organization per hour. All analytics endpoints share this limit.

Authorization

string

header

required

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

projectId

string

required

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

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

Search term aggregates with pagination

searches

object[]

required

Search terms ordered by hit count descending.

Show child attributes

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.

⌘I

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu