Skip to main content

Query Parameters

query
string
required
Search keywords.
type
string
default:"all"
Restrict results to a single result type.
ValueDescription
allAll result types (default)
videoVideos only
channelChannels only
playlistPlaylists only
movieMovies only
sort_by
string
default:"relevance"
Sort order for results.
ValueDescription
relevanceBest match (default)
dateMost recently uploaded
viewsMost viewed
ratingHighest rated
upload_date
string
Filter by upload recency: hour, today, week, month, or year.
duration
string
Filter by video length: short (< 4 min), medium (4-20 min), or long (> 20 min).
features
string
Comma-separated feature filters, e.g. hd,4k,subtitles,live,creative_commons.
gl
string
default:"US"
Content region (ISO 3166-1 alpha-2 country code). Examples: US, GB, DE, JP.
hl
string
default:"en"
UI / interface language (BCP-47). Examples: en, de, fr, ja.
continuation
string
Continuation token from a previous response to fetch the next page.

Response

query
string
The search query that was executed.
results
array
Array of matching results (polymorphic, keyed by type).
total_results
integer
Reported total result count (nullable).
estimated_results
integer
Estimated result count (nullable).
chips
array
Filter chips / refinements with title, is_selected, continuation.
did_you_mean
string
Spelling suggestion, if any (nullable).
showing_results_for
string
Corrected query actually searched (nullable).
refinements
array
Suggested query refinements.
Related search objects.
continuation
string
Token to fetch the next page (nullable when no more pages).

Example Response

{
  "query": "lofi hip hop",
  "results": [
    {
      "type": "video",
      "position": 1,
      "video_id": "jfKfPfyJRdk",
      "title": "lofi hip hop radio - beats to relax/study to",
      "url": "https://www.youtube.com/watch?v=jfKfPfyJRdk",
      "thumbnail": "https://i.ytimg.com/vi/jfKfPfyJRdk/hqdefault.jpg",
      "duration": null,
      "view_count_text": "Live · 42K watching",
      "published_time_text": "Streamed 2 years ago",
      "channel_id": "UCSJ4gkVC6NrvII8umztf0Ow",
      "channel_name": "Lofi Girl",
      "channel_is_verified": true,
      "is_live": true,
      "is_short": false
    }
  ],
  "estimated_results": 1240000,
  "chips": [
    { "title": "All", "is_selected": true, "continuation": null },
    { "title": "Videos", "is_selected": false, "continuation": "EgIQAQ..." }
  ],
  "continuation": "EpcDEgxsb2ZpIGhpcCBob3A..."
}
Each search request costs 5 credits. Failed requests are not charged.