Trending Queries API
GETOverview
Section titled “Overview”The Trending Queries API returns a list of search terms that are currently popular among your users. It is typically used to render a “Trending Searches” list before the user starts typing.
Request parameters
Section titled “Request parameters”Required parameters
Section titled “Required parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
tracker_id | string | ✓ | Your unique site identifier within Luigi’s Box. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Description |
|---|---|---|
ctx[] | string | Model-selection context in key:value format, for example ctx[]=warehouse:berlin. Keys must match contexts reported in Analytics. |
Request headers
Section titled “Request headers”| Header | Value | Required | Description |
|---|---|---|---|
Accept-Encoding | gzip, deflate | Recommended | Enables compressed responses to reduce payload size. |
How to Make a Request
Section titled “How to Make a Request”To make a valid request:
- Send a
GETrequest tohttps://live.luigisbox.com/v2/trending_queries. - Provide
tracker_id. - Add
ctx[]only when you need model segmentation.
For implementation guidance, see Quickstart: Trending Queries.
Response structure
Section titled “Response structure”The response is a JSON array where each object represents one trending query.
Response attributes
Section titled “Response attributes”| Field | Type | Description |
|---|---|---|
[root] | array | List of trending query objects. |
title | string | Text of the trending query. |
Error handling
Section titled “Error handling”The API uses standard HTTP status codes to indicate success or failure.
| HTTP Status | Description |
|---|---|
200 OK | The request succeeded and results are returned. |
400 Bad Request | The request was malformed — missing or invalid tracker_id. |
500 Server Error | Internal error. If persistent, contact support. |
504 Gateway Timeout | The request took too long to process. Retrying may succeed. |
Was this page helpful?
Thanks.