---
updatedAt: 2026-09-28T14:50:09.000Z
agentTools:
  projectIndex: https://developer.searchblox.com/llms.txt
---

# Search Query API

The Search Query API in SearchBlox allows you to perform search operations and retrieve related queries and top queries using REST requests with JSON payloads. It supports secure search and returns results in JSON format.

# **New Search API**

Search API in SearchBlox is used for secure search operations. Users can also use this API to retrieve search results in JSON format.

## URL

`https://localhost:8443/rest/v2/api/search?query=*&public=true`

## Method

`GET`

## params

Below given are the basic mandatory parameters. There are a wide variety of parameters that are supported, please refer [Search Parameters](https://developer.searchblox.com/docs/search-parameters)

| param | description  |
| :---- | :----------- |
| query | search query |

## Header

[block:parameters]
{
  "data": {
    "h-0": "Header",
    "h-1": "Description",
    "0-0": "X-Correlation-ID",
    "0-1": "A unique identifier that can be sent through the search API request.  \nThe X-Correlation-IDs will be logged in ../webapps/ROOT/logs/query.log and can also be viewed in exported query logs from SearchBlox Analytics."
  },
  "cols": 2,
  "rows": 1,
  "align": [
    "left",
    "left"
  ]
}
[/block]

## Returns

The JSON results from SearchBlox by default

# **Related Queries API**

## Index URL

https\://localhost:8443/rest/v2/api/related/query

## Method

POST

## Media Type

application/json

## Headers

content-type : application/json\
accept: application/json

## Headers

SB-PKEY\
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

## Document Syntax

```json
{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"field":"content",
"col":"1,2,3",
"type":"phrase",
"operator":"or",
"limit":20,
"terms":5,
"query":"test"
}
```

<br />

| Field      | Description                                      | Type    | Example Value                      |
| ---------- | ------------------------------------------------ | ------- | ---------------------------------- |
| `apikey`   | The API key used for authentication              | String  | `ADB9E38C363A5AB7B17E34956D21543B` |
| `field`    | The field to search within                       | String  | `content`                          |
| `col`      | The collection IDs to search within              | String  | `1,2,3`                            |
| `type`     | The type of search (e.g., phrase, keyword)       | String  | `phrase`                           |
| `operator` | The logical operator for multiple terms (AND/OR) | String  | `or`                               |
| `limit`    | The maximum number of results to return          | Integer | `20`                               |
| `terms`    | The number of terms to consider in the search    | Integer | `5`                                |
| `query`    | The search query term                            | String  | `test`                             |

<br />

# **Top Queries API**

## Index URL

https\://localhost:8443/rest/v2/api/query/top

## Method

POST

## Media Type

application/json

## Headers

content-type : application/json\
accept: application/json

## Headers

SB-PKEY\
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

## Document Syntax

```json JSON
{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"col":1,
"limit":12
}
```

## Document Description

| Field    | Description                             | Type    | Example Value                      |
| -------- | --------------------------------------- | ------- | ---------------------------------- |
| `apikey` | The API key used for authentication     | String  | `ADB9E38C363A5AB7B17E34956D21543B` |
| `col`    | The collection ID to search within      | Integer | `1`                                |
| `limit`  | The maximum number of results to return | Integer | `12`                               |