For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign Up
DocumentationAPI ReferenceSDKs
DocumentationAPI ReferenceSDKs
  • Documents
    • Ingest Documents
    • Ingest Directories
    • POSTcrawl_website
    • GETget_processing_status_by_id
    • GETlist
    • GETget
    • GETlookup
    • DELdelete (singular)
    • DELdelete (multiple)
    • GETget_processes
    • POSTcopy
    • PUTupdate
    • DELcancel_process
    • GETget_extract
    • GETget_xray
  • Search
    • POSTsearch.content
    • POSTsearch.documents
  • Buckets
    • GETlist
    • GETget
    • POSTcreate
    • PUTupdate
    • DELdelete
  • Groups
    • GETlist
    • GETget
    • POSTcreate
    • PUTupdate
    • DELdelete
    • POSTaddBucket
    • DELremoveBucket
  • Workflows
    • GETlist
    • POSTcreate
    • GETget_account
    • POSTadd_to_account
    • DELremove_from_account
    • POSTadd_to_id
    • DELremove_from_id
    • GETget
    • PUTupdate
    • DELdelete
  • Customer
    • GETget
  • API Key
    • GETlist
    • POSTcreate
    • PUTupdate
    • DELdelete
  • Health
    • GETlist
    • GETget
Sign Up
LogoLogo
Search

search.documents

POST
https://api.groundx.ai/api/v1/search/documents
POST
/api/v1/search/documents
1from groundx import GroundX
2
3client = GroundX(
4 api_key="YOUR_API_KEY_HERE",
5)
6
7client.search.documents(
8 query="climate change impact on agriculture",
9 document_ids=[
10 "a3f1c9e2-4b7d-4f8a-9c2e-1d2f3b4a5c6d",
11 "b7e2d3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
12 ],
13)
1{
2 "search": {
3 "count": 1,
4 "results": [
5 {
6 "boundingBoxes": [
7 {
8 "bottomRightX": 450.5,
9 "bottomRightY": 720.3,
10 "pageNumber": 3,
11 "topLeftX": 120,
12 "topLeftY": 680
13 }
14 ],
15 "bucketId": 42,
16 "chunkId": "chunk-9f8b7a6c-1234-5678-9abc-def012345678",
17 "documentId": "a3f1c9e2-4b7d-4f8a-9c2e-1d2f3b4a5c6d",
18 "fileName": "Climate_Change_Report_2023.pdf",
19 "multimodalUrl": "https://cdn.groundx.ai/images/climate_table_3.png",
20 "pageImages": [
21 "https://cdn.groundx.ai/pages/climate_report_page3.jpg"
22 ],
23 "pages": [
24 {
25 "height": 1024,
26 "imageUrl": "https://cdn.groundx.ai/pages/climate_report_page3.jpg",
27 "number": 3,
28 "width": 768
29 }
30 ],
31 "processId": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
32 "score": 95.7,
33 "searchData": {},
34 "sourceUrl": "https://www.environmentalagency.gov/reports/climate_change_2023",
35 "suggestedText": "The report highlights significant impacts of climate change on crop yields, emphasizing adaptive strategies for sustainable agriculture.",
36 "text": "Recent studies indicate that rising temperatures and altered precipitation patterns have led to a 15% decrease in wheat production in affected regions."
37 }
38 ],
39 "query": "climate change impact on agriculture",
40 "score": 95.7,
41 "searchQuery": "climate change impact on agriculture",
42 "text": "Climate change significantly affects agricultural productivity, necessitating adaptive measures to mitigate risks.",
43 "nextToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYWdlIjoxfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
44 }
45}

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.

Was this page helpful?
Previous

list

Next
Built with

Authentication

X-API-Keystring
API Key authentication via header

Query parameters

nintegerOptional1-100Defaults to 20

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

nextTokenstringOptional
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.
verbosityintegerOptional0-2

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

This endpoint expects an object.
querystringRequiredDefaults to my search query
The search query to be used to find relevant documentation.
documentIdslist of stringsRequired
An array of unique documentIds to be searched.
filterobjectOptional

A dictionary of key-value pairs that can be used to pre-filter documents prior to a search.

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

Response

Search query success
searchobject

Errors

400
Bad Request Error
401
Unauthorized Error