> ## Documentation Index
> Fetch the complete documentation index at: https://the-early-spring18.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Search API: Full-Text Query, Filters, and Pagination

> Use GET /v1/search to run full-text queries with field filters, ISO 8601 date ranges, sort options, and pagination across all your data objects.

The Search API gives you a powerful, flexible way to find exactly what you need across all of the data objects in your account. Whether you are building an in-app search experience, running automated audits, or surfacing relevant records for your users, the `/v1/search` endpoint accepts full-text queries alongside a rich set of filters — including field-level expressions, ISO 8601 date ranges, and configurable sorting — so you can narrow results precisely and paginate through large datasets with ease.

## GET /v1/search

Retrieve a paginated list of data objects that match your query and filter criteria.

### Query Parameters

<ParamField query="q" type="string" required>
  The full-text search query string. Matches against titles, content, and indexed metadata fields across all data objects in your account.
</ParamField>

<ParamField query="filter" type="string">
  A field-level filter expression in `field:value` format. Use this to restrict results to a specific type or attribute — for example, `type:document` returns only document objects. Multiple filters are not yet supported in a single request.
</ParamField>

<ParamField query="from" type="string">
  An ISO 8601 timestamp. When provided, only results created **on or after** this date and time are returned. Example: `2024-01-01T00:00:00Z`.
</ParamField>

<ParamField query="to" type="string">
  An ISO 8601 timestamp. When provided, only results created **on or before** this date and time are returned. Example: `2024-12-31T23:59:59Z`.
</ParamField>

<ParamField query="sort" type="string" default="relevance">
  The field by which results are ordered. Accepted values:

  * `relevance` — orders by computed relevance score (default)
  * `date` — orders by creation date, newest first
  * `title` — orders alphabetically by title
</ParamField>

<ParamField query="page" type="integer" default="1">
  The page number to retrieve. Starts at `1`. Use in combination with `limit` to paginate through result sets.
</ParamField>

<ParamField query="limit" type="integer" default="20">
  The number of results to return per page. Minimum is `1`, maximum is `100`. Defaults to `20`.
</ParamField>

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl 'https://api.google.com/v1/search?q=annual+report&filter=type:document&sort=date&limit=10' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "data": {
    "results": [
      {
        "id": "dat_1a2b3c",
        "title": "Annual Report 2024",
        "type": "document",
        "score": 0.94,
        "created_at": "2024-01-15T09:00:00Z"
      }
    ],
    "total": 1,
    "page": 1,
    "pages": 1
  },
  "meta": { "request_id": "req_xyz789" }
}
```

### Response Fields

<ResponseField name="results" type="array">
  An array of data objects that match your query and filter criteria, ordered according to the `sort` parameter.

  <Expandable title="results[]">
    <ResponseField name="id" type="string">
      The unique identifier for the data object, prefixed with `dat_`.
    </ResponseField>

    <ResponseField name="title" type="string">
      The human-readable title of the data object as set when it was created or last updated.
    </ResponseField>

    <ResponseField name="type" type="string">
      The object type. Possible values are `document`, `note`, and `record`.
    </ResponseField>

    <ResponseField name="score" type="number">
      A relevance score between `0` and `1` indicating how closely the item matches your query. Higher values indicate stronger matches. Only meaningful when `sort=relevance`.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      The ISO 8601 timestamp at which the data object was created, in UTC.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  The total number of data objects that match your query and filter criteria across all pages.
</ResponseField>

<ResponseField name="page" type="integer">
  The current page number returned in this response, corresponding to the `page` query parameter you supplied.
</ResponseField>

<ResponseField name="pages" type="integer">
  The total number of pages available given the current `limit` and `total` result count.
</ResponseField>

<Note>
  Newly created or updated data objects may take up to **30 seconds** to appear in search results. If you do not see a recently created item, wait a moment and retry your query before assuming it is missing.
</Note>
