logo
Search

search.content

post
https://api.groundx.ai/api/v1/search/{id}

Search documents on GroundX for the most relevant information to a given query.

The result of this query is typically used in one of two ways; result['search']['text'] can be used to provide context to a language model, facilitating RAG, or result['search']['results'] can be used to observe chunks of text which are relevant to the query, facilitating citation.

Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.

Execute an API Request

Path
idintegerrequired

The bucketId or projectId of the bucket or project being searched. The documents within the specified container will be compared to the query, and relevant information will be extracted.

Query
ninteger

The maximum number of returned documents. Accepts 1-100 with a default of 20.

nextTokenstring

A token for pagination. If the number of search results for a given query is larger than n, the response will include a "nextToken" value. That token can be included in this field to retrieve the next batch of n search results.

verbosityinteger

The amount of data returned with each search result. 0 == no search results, only the recommended context. 1 == search results but no searchData. 2 == search results and searchData.

Request Body
querystringrequired

The search query to be used to find relevant documentation.

Authorization
Request
Installation
$
npm install groundx-typescript-sdk
1
Loading...

Response fields

object
searchobject
1
{
2
"search": {
3
"count": 0,
4
"results": [
5
{
6
"boundingBoxes": [
7
{
8
"bottomRightX": 0,
9
"bottomRightY": 0,
10
"pageNumber": 0,
11
"topLeftX": 0,
12
"topLeftY": 0
13
}
14
],
15
"bucketId": 0,
16
"chunkId": "string",
17
"documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",
18
"fileName": "string",
19
"multimodalUrl": "http://example.com",
20
"pageImages": [
21
"http://example.com"
22
],
23
"score": 0,
24
"searchData": {},
25
"sourceUrl": "http://example.com",
26
"suggestedText": "string",
27
"text": "string"
28
}
29
],
30
"query": "string",
31
"score": 0,
32
"searchQuery": "string",
33
"text": "string",
34
"nextToken": "string"
35
}
36
}