YouTube Search API
Search YouTube and get matching videos: title, channel, view count, length and publish time.
Provider network
Providers ranked by traffic
Try it
Make your first request
{
"found": true,
"data": {
"videos": [
{
"id": "BzSzwqb-OEE",
"url": "https://www.youtube.com/watch?v=BzSzwqb-OEE",
"title": "Apollo 11 Moon Landing: Restored Footage",
"channel": "NASA",
"views": 14860541,
"lengthText": "4:14",
"publishedTime": "2 years ago"
}
]
}
}interface YoutubeSearchResponse {
data: {
nextCursor?: string | null;
videos: {
channel: string;
id: string;
lengthText: string;
publishedTime: string;
title: string;
url: string;
views: number;
}[];
} | null;
found: boolean;
}Full parameter and response reference - every field, type, and example for this endpoint.
Reference
Request, response, and price
Last verified 2026-09-16 · uptime and latency measured over 30dcurl -X POST https://api.getanyapi.com/v1/run/youtube.search \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"apollo 11 landing"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| query | string | "apollo 11 landing"The YouTube search query. |
| cursor | string | Continuation token from a previous response for pagination. |
| requireCursor | boolean | Deprecated; send `requireFields: ["nextCursor"]` instead, which does exactly the same thing. Set true if you intend to page through results, so the request is only served by a source that can return a nextCursor. Omit it and routing is unchanged, with the cheapest source serving. This can raise your price: when the cheapest source cannot page, a source that can serves, and you are quoted and charged its price. It stays accepted so callers that already send it keep working. |
| requireFields | array | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `nextCursor`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a result that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted. |
| sortBy | enum | Sort order: "relevance" (default) or "popular" (most-viewed). |
| uploadDate | enum | Filter by upload recency. Omit for any time. |
| Response | ||
| found | boolean | true |
| data | object | |
| data.videos | array | |
| data.videos[].id | string | "BzSzwqb-OEE" |
| data.videos[].url | string | "https://www.youtube.com/watch?v=BzSzwqb-OEE" |
| data.videos[].title | string | "Apollo 11 Moon Landing: Restored Footage" |
| data.videos[].channel | string | "NASA" |
| data.videos[].viewscan require | number | 14860541 |
| data.videos[].lengthTextcan require | string | "4:14" |
| data.videos[].publishedTime | string | "2 years ago" |
| Price | ||
| Price per request | USD | $0.0005 |
| Price /1k req | USD | $0.50 |
FAQ
About the YouTube Search API
The AnyAPI YouTube Search API returns YouTube search data as normalized JSON from one POST call to /v1/run/youtube.search. Search YouTube and get matching videos: title, channel, view count, length and publish time. AnyAPI routes each request across 3 sources and falls back automatically when one fails. It costs from $0.50 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 100.0% of YouTube search calls through AnyAPI succeeded, with a median response time of 2.9 seconds across 2,764 measured calls.