YouTube API

YouTube Search API

Search YouTube and get matching videos: title, channel, view count, length and publish time.

POST/v1/run/youtube.search
Uptime
99.96%
30d · 2,764 calls
Requests
2,764
30d · weekly, last 12 wks
Response
2.9s
median · 30d

Try it

Make your first request

requireFieldsarray
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.
Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.
{
  "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"
      }
    ]
  }
}
Response interface
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 30d
POST /v1/run/youtube.search
curl -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"}'
FieldTypeExample value
Request body
querystring"apollo 11 landing"The YouTube search query.
cursorstringContinuation token from a previous response for pagination.
requireCursorbooleanDeprecated; 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.
requireFieldsarrayOptional; 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.
sortByenumSort order: "relevance" (default) or "popular" (most-viewed).
uploadDateenumFilter by upload recency. Omit for any time.
Response
foundbooleantrue
dataobject
data.videosarray
data.videos[].idstring"BzSzwqb-OEE"
data.videos[].urlstring"https://www.youtube.com/watch?v=BzSzwqb-OEE"
data.videos[].titlestring"Apollo 11 Moon Landing: Restored Footage"
data.videos[].channelstring"NASA"
data.videos[].viewscan requirenumber14860541
data.videos[].lengthTextcan requirestring"4:14"
data.videos[].publishedTimestring"2 years ago"
Price
Price per requestUSD$0.0005
Price /1k reqUSD$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.

It costs from $0.50 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet, each call draws it down, and a failed request costs $0.

Search YouTube and get matching videos: title, channel, view count, length and publish time. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.

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. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.