YouTube API

YouTube Video API

Full video or Short metadata by URL or id: title, description, channel, view/like counts and publish date.

$0.80/1k req, pay per request, no subscription.

What the API returned
{
"id": "dQw4w9WgXcQ",
"title": "Official Video",
"channel": "Rick Astley",
"durationMs": 213000,
"views": 1540000000,
"likes": 17200000,
"createdUtc": 1256453853,
"description": "The official video.",
... 7 more fields
}
Uptime
99.39%
30d · 52,940 calls
Requests
53,112
30d · weekly, last 12 wks
Response
4.4s
median · 30d

Pricing and providers

YouTube Video API pricing: one API, 3 interchangeable providers

The cheapest provider serves first. If it fails, the next one takes over in the same call.

You pay
$8.00
$0.80/1k req, only for what you use. No monthly plan.
Your first 125 requests are free with the $0.10 starting balance.

Try it

Get YouTube video in one 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 `authorAvatarUrl`, 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 video that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. A source that returns only a rounded or shortened value for a field does not count as returning it.
Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.

This sample shows 10 of 18 fields. See every field

{
  "found": true,
  "data": {
    "id": "dQw4w9WgXcQ",
    "title": "Official Video",
    "channel": "Rick Astley",
    "durationMs": 213000,
    "views": 1540000000,
    "likes": 17200000,
    "createdUtc": 1256453853,
    "description": "The official video."
  }
}

Full parameter and response reference - every field, type, and example for this endpoint.

Reference

One request, one response shape.

Every field you send and every field you get back, each with a real example.

Last verified 2026-10-31 · uptime and latency measured over 30d

Request body

JSON, posted to this endpoint.

  • idstring

    YouTube video ID. A Short uses the same ID as any other video.

  • 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 `authorAvatarUrl`, 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 video that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. A source that returns only a rounded or shortened value for a field does not count as returning it.

  • urlstring

    https://www.youtube.com/watch?v=dQw4w9WgXcQ

    Full YouTube video URL. Shorts (youtube.com/shorts/...), youtu.be, live, and embed URLs all work.

You send. A small JSON body. The values shown are examples to replace with your own.

Response

JSON, one example value per field.

datadata

The video result, or null when not found.

  • authorAvatarUrlstringcan require

    URL of the publishing channel's avatar image.

  • authorIdstring

    YouTube channel ID of the publishing channel.

  • authorUrlstring

    Canonical URL of the publishing channel, tracking query parameters stripped.

  • categorystring

    YouTube category the video is filed under, for example "Music".

  • channelstring

    Rick Astley

    Name of the channel that published the video. Populated whenever the provider has data for the entity.

  • commentsintegercan require

    Number of comments. Some sources round large counts (2.4M instead of 2,457,538); name `comments` in requireFields to be served only by a source that returns the exact count.

  • createdUtcnumber

    1256453853

    UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. Populated whenever the provider has data for the entity.

  • descriptionstringcan require

    The official video.

    Video description text. Some sources return it as YouTube displays it, with long links shortened (https://colab.research.google.com/dri...) and YouTube or social links replaced by their titles; name `description` in requireFields to be served only by a source that returns every link intact.

  • durationMsinteger

    213000

    Duration of the video in milliseconds.

  • idstring

    dQw4w9WgXcQ

    Unique identifier of the video. Populated whenever the provider has data for the entity.

  • imagestring

    URL of the video thumbnail image.

  • keywordsstring[]

    Keywords the uploader tagged the video with.

  • likesinteger

    17200000

    Number of likes.

  • titlestring

    Official Video

    Title of the video. Populated whenever the provider has data for the entity.

  • viewsinteger

    1540000000

    Number of views.

top level
  • foundboolean

    true

    Whether the video was found.

  • reason"not_found"

    Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.

You get back. Named, typed fields in the same shape whichever source answers.

Selling this API? See the full schema your endpoint must return.

FAQ

About the YouTube Video API

The AnyAPI YouTube Video API returns YouTube video data as normalized JSON from one POST call to /v1/run/youtube.video. Full video or Short metadata by URL or id: title, description, channel, view/like counts and publish date. AnyAPI routes each request across 3 sources and falls back automatically when one fails. It costs from $0.80 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 99.4% of YouTube video calls through AnyAPI succeeded, with a median response time of 4.4 seconds across 52,940 measured calls.

It costs from $0.80 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet and each call draws it down. Some failed wallet-funded requests incur processing charges that we pass through at cost, with no markup; the error response shows the amount charged.

Full video or Short metadata by URL or id: title, description, channel, view/like counts and publish date. 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, 99.4% of YouTube video calls through AnyAPI succeeded, with a median response time of 4.4 seconds across 52,940 measured calls. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.

Yes. A new AnyAPI account starts with $0.10 of free balance and no card required, which covers 125 YouTube Video calls at $0.0008 each.

AnyAPI asks the next of its 3 sources in the same request, cheapest first, so one source going down does not fail your call.

Send a POST request to https://api.getanyapi.com/v1/run/youtube.video with your AnyAPI key in an "Authorization: Bearer" header and the input as a JSON body. The same key and the same wallet work on every AnyAPI endpoint.

No. You add US dollars to one prepaid AnyAPI balance and each request draws it down. There is no monthly plan and no minimum, and the same balance pays for every AnyAPI endpoint.

Yes. Install @getanyapi/sdk from npm for TypeScript or getanyapi from pip for Python. Both call every AnyAPI endpoint with the same key, and any HTTP client works too.

Yes. An agent can connect to the AnyAPI MCP server at https://api.getanyapi.com/mcp, or create its own free-trial key with one unauthenticated POST to https://api.getanyapi.com/agent/signup and call this endpoint over HTTP.