GroundsocialDocs

API · YouTube

GET /youtube/search

Search YouTube: videos, Shorts, channels or playlists, with sort, date, duration and feature filters.

RequestGET /v1/youtube/search
Operation idyoutube.search.videos
Cost1 credit, refunded if the call fails
AuthAPI key: Authorization: Bearer <key> or x-api-key.

Search YouTube: videos, Shorts, channels or playlists, with sort, date, duration and feature filters.

Query parameters

NameTypeRequiredDescription
qstringyesWhat to search for. Example: sourdough starter.
type"all" | "video" | "short" | "channel" | "playlist" | "movie"noOne of all, video, short, channel, playlist, movie.
sort"relevance" | "popular" | "date" | "rating"noOne of relevance, popular, date, rating.
upload_date"hour" | "today" | "week" | "month" | "year"noOne of hour, today, week, month, year.
duration"short" | "medium" | "long"noOne of short, medium, long.
featuresstringnoComma list of: live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr, location, purchased.
regionstringnoISO 3166-1 alpha-2 country: the results a visitor there sees. Example: US.
languagestringnoISO 639-1 language code (en, es, pt-BR). Example: en.
details"0" | "1" | "true" | "false"noOne of 0, 1, true, false.
afterstringnoThe previous page’s nextPageToken. Tokens last 6 hours.

Responses

StatusMeaningSchema
200A page of results.YouTubeSearchList
400Invalid input. Nothing was charged.Error
401Missing or invalid API key.Error
402Not enough credits, a spend cap was reached, or payment is required.Error
403The target is private, or the account is suspended.Error
404The video, channel, playlist or post does not exist, was removed, or has nothing there.Error
429Too many requests. Wait for Retry-After seconds.Error
503YouTube is temporarily unavailable. Retryable; nothing was charged.Error

YouTubeSearchList fields

FieldTypeDescription
kind"youtube#searchListResponse"
itemsYouTubeSearchResult[]
nextPageTokenstringPass as after for the next page. Absent on the last page. Lasts 6 hours.
pageInfoobject
regionCodestring
estimatedResultsinteger

Errors use one shape everywhere; see Errors for every code and what to do.