Skip to content

Docs

GET /v1/search

Search YouTube videos or channels. Returns 20 results per page with next-page pagination tokens. Cost: 1 credit per successful page request.

Parameters

ParameterInTypeDescription
qquerystring (required)Search query string.
typequeryvideo | channelType of entity to search. Default: video.
pagequeryintegerPage number for pagination. Default: 1.
glquerystringISO 3166-1 alpha-2 country code (default US).
hlquerystringLanguage code hint (default en).

Request examples

curl "https://api.ytapi.dev/v1/search?q=cloudflare+workers&type=video&page=1" \
  -H "Authorization: Bearer yta_YOUR_KEY"

Response

200 OK
{
  "query": "cloudflare workers",
  "type": "video",
  "next_page": 2,
  "items": [
    {
      "video_id": "b73BI9eUkjM",
      "title": "Cloudflare Workers Explained",
      "author": "Tech Academy",
      "channel_id": "UCxxxx",
      "length_seconds": 642,
      "view_count": 185000,
      "published_at": "2026-01-15T12:00:00Z",
      "thumbnails": [
        { "url": "https://i.ytimg.com/vi/b73BI9eUkjM/hqdefault.jpg", "width": 480, "height": 360 }
      ]
    }
  ]
}