Search YouTube
search(query, options?): SearchResponse
GET
https://api.ytapi.dev/v1/search
1 Credit
Search videos, channels, playlists, movies, or Shorts. Does not consume YouTube Data API quota.
Security
API Key
All requests require a valid API key from the developer dashboard.
Headers: Authorization: Bearer YOUR_API_KEYorX-API-Key: YOUR_API_KEY
See Authentication for headers and rate limits.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
qquery | string | Yes | Search keyword or phrase. |
limitquery | number | No | Max results to return, from 1 to 50. Default |
typequery | string | No |
|
upload_datequery | string | No |
|
durationquery | string | No |
|
sort_byquery | string | No |
|
cursorquery | string | No | Opaque pagination token for retrieving the next page. |
Response (HTTP 200)
{
"query": string, // Echoed search string
"type": string, // Search target filter applied
"has_more": boolean, // Whether additional search results are available
"next_cursor": string | null, // Cursor token to fetch the next page of results
"items": [ // Array of search result hits
{
// Fields that do not apply to a result's type are left out.
"id": string, // Video ID, channel ID, or playlist ID
"type": string, // "video", "channel", "playlist", or "shorts"
"title": string, // Result title
"description": string, // Snippet / description
"author": string, // Channel name
"channel_id": string, // Channel ID
"length_seconds": number, // Duration in seconds (for videos)
"length_text": string, // Formatted duration string (e.g. "20:40")
"view_count_text": string, // Formatted view count (e.g. "89K views")
"published_text": string, // Relative upload date (e.g. "2 weeks ago")
"thumbnails": [ // Artwork at one or more sizes
{ "url": string, "width": number, "height": number }
],
"handle": string, // Channel results: handle (e.g. "@TED")
"subscriber_count_text": string, // Channel results: e.g. "27.8M subscribers"
"video_count_text": string, // Playlist results: e.g. "11 videos" or "9 episodes"
"badges": string[] // e.g. ["Verified"]
}
]
}