Skip to main content
GET
/
search
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
response = client.search.search(
    query="x",
)
print(response.credits)
{
  "object": "list",
  "data": [
    {
      "object": "search_result_item",
      "score": 123,
      "updated_at": "2023-11-07T05:31:56Z",
      "content": [
        "<string>"
      ],
      "resource": {
        "object": "knowledge_metadata",
        "id": "<string>",
        "name": "<string>",
        "navigation_item": {
          "object": "navigation_item_metadata",
          "id": "<string>",
          "name": "<string>",
          "item_type": "<string>",
          "url": "<string>",
          "emoticon": "<string>",
          "source_media_type": "<string>"
        },
        "url": "<string>"
      },
      "title": "<string>",
      "summary": "<string>"
    }
  ],
  "credits": {
    "consumed": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

query
string
required

The search query to run against knowledge. Must contain at least one non-whitespace character after trimming.

Minimum string length: 1
knowledge_ids
string[]

Optional list of knowledge IDs to scope the search to.

record_types
enum<string>[]

Filter results by record type in the vector database.

The record type in the vector database.

Available options:
rows,
tables,
files,
pages,
cells
next
string

A cursor to use in pagination to continue a query from the previous request. This is automatically added when the request has more results to fetch.

limit
integer
default:50

The limit on the number of objects to return, ranging between 1 and 100.

Required range: 1 <= x <= 100

Response

Search results

object
enum<string>
required
Available options:
list
data
object[]
required

An array containing the found search items.

credits
object
required

Credit consumption for this search. When present, consumed reflects the actual variable cost of the retrieval work performed for this request. null when the billing write fails or the request is aborted before billing completes.