> ## Documentation Index
> Fetch the complete documentation index at: https://docs.konbiniapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search videos

> Searches public YouTube videos for a query. YouTube has no public trending chart, so sorting by view count within an upload window (`order`, `published`) is the closest equivalent — results for a query, not a platform-wide ranking. `viewCount` is exact here.

## What it does

Searches public YouTube videos for a query. YouTube has no public trending chart, so sorting by view count within an upload window (`order`, `published`) is the closest equivalent — results for a query, not a platform-wide ranking. `viewCount` is exact here.

## Tool details

| Field | Value |
| - | - |
| Tool name | `youtube_search` |
| Platform | YouTube |
| REST endpoint | `GET /v1/youtube/search` |
| Result type | Collection tool |

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | Yes | Search query |
| `order` | `string` | No | Sort order: relevance (default), rating, newest, or views Allowed values: `relevance`, `rating`, `newest`, `views`. |
| `published` | `string` | No | Restrict results to videos uploaded within this window Allowed values: `hour`, `today`, `week`, `month`, `year`. |
| `cursor` | `string` | No | Pagination cursor |
| `projection_preset` | `string` | No | Defaults to `minimal`. Allowed values: `full`, `minimal`, `identity`, `engagement`, `content`. |
| `data_fields` | `string[]` | No | Adds top-level keys from `data` on top of the selected `projection_preset`. |
| `item_fields` | `string[]` | No | Adds keys from `data.orderedItems[]` on top of the selected `projection_preset`. |

## Example

```json theme={null}
{
  "name": "youtube_search",
  "arguments": {
    "query": "mrbeast",
    "projection_preset": "minimal",
    "data_fields": [
      "orderedItems",
      "nextCursor",
      "cursor",
      "itemCount"
    ],
    "item_fields": [
      "entityId",
      "name",
      "content",
      "summary",
      "url"
    ]
  }
}
```

## Available data fields

* `@context`
* `type`
* `partOf`
* `totalItems`
* `cursor`
* `nextCursor`
* `next`
* `itemCount`
* `orderedItems`

## Available item fields

* `type`
* `id`
* `url`
* `entityId`
* `name`
* `content`
* `summary`
* `duration`
* `viewCount`
* `tag`
* `attributedTo`
* `image`

## Response notes

Successful calls return a JSON object with a top-level `data` field and, when
available, `metadata.creditsUsed` and `metadata.creditsRemaining`. See
[response format](/getting-started/response-format),
[pagination](/getting-started/pagination), and [credits](/getting-started/credits).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.