v1

latestOpenAPI 3.0.0Apache 2.02026-07-17263751.6 KB
Search

search.documents

Search documents on GroundX for the most relevant information to a given query by documentId(s).

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.

post/v1/search/documents

Query parameters

ninteger

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

nextTokenstring
Example:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9

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

querystring required

The search query to be used to find relevant documentation.

documentIdsstring[] required

An array of unique documentIds to be searched.

relevancenumber float

The minimum search relevance score required to include the result. By default, this is 10.0.

Example request

{
  "query": "my search query",
  "documentIds": [
    "docUUID1",
    "docUUID2"
  ],
  "relevance": 10
}

Response

Search query success