# YouTube Video Details (Official API) — Views & Likes by URL (`actor-forge/youtube-video-details-api`) Actor

Bring your own free YouTube API key. Paste video URLs or IDs and get each video's views, likes, comment count, duration, tags, category, language, captions flag and publish date from the official YouTube Data API v3. 50 videos per quota unit. $0.40 per 1,000 videos.

- **URL**: https://apify.com/actor-forge/youtube-video-details-api.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** Videos, Social media
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 video results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Video Details (Official API) — Views & Likes by URL

Bring your own free YouTube API key. Paste video URLs or IDs and get each video's views, likes, comment count, duration, tags, category, language, captions flag and publish date from the official YouTube Data API v3. 50 videos per quota unit. $0.40 per 1,000 videos.

**Bring your own free YouTube API key** and turn a list of YouTube links into a spreadsheet of video stats, from the **official YouTube Data API v3**: no scraping, no proxies, no blocks. Paste watch URLs, youtu.be links, Shorts, embed or live links, or bare video IDs, and get one row per video with **views, likes, comment count**, duration (ISO and seconds), title, description, tags, category, default and audio language, captions flag, HD/SD, made-for-kids flag, live status, thumbnails, topic categories and the publish date.

Built for bulk lookups: campaign and influencer reporting, refreshing the view counts of a content library, checking which videos in a sheet are private or deleted (they come back as free error rows), or enriching a list of links for analysis in Sheets, Make, n8n or Zapier.

**$0.40 per 1,000 videos.** IDs are batched 50 per API call, so 10,000 videos use only 200 of your 10,000 free daily quota units.

#### Get your free API key (about 60 seconds, no billing account)

1. Open the [Google Cloud Console](https://console.cloud.google.com/) and sign in with any Google account. Create a project (top bar → **New project**).
2. Go to **APIs & Services → Library**, search for **YouTube Data API v3** and click **Enable**.
3. Go to **APIs & Services → Credentials → Create credentials → API key** and copy the key (it starts with `AIza`).
4. Paste it into the **YouTube API key** field of this actor and run. The field is a secret input: Apify stores it encrypted, and the actor never logs it or writes it to the output.

You do not need to add a billing account. Each Google Cloud project gets **10,000 free quota units per day**, which reset at midnight Pacific Time. If you restrict the key, allow **YouTube Data API v3** and leave out HTTP-referrer or IP restrictions, because Apify runs on changing server IPs.

#### Official API only, and your data stays yours

- All data comes from the official **YouTube Data API v3** (`https://www.googleapis.com/youtube/v3/`) using **your own key and quota**. Nothing is scraped from youtube.com, and there are no proxies, cookies or logins.
- We never hold, share or pool API keys, and no default key is built in. ActorForge sells the API client; the data is fetched under your key.
- ActorForge keeps no copy of API data after the run. Rows go only to your run's dataset, which belongs to you. YouTube's Developer Policies require stored API data to be **refreshed or deleted at least every 30 days**, so set a retention period on your datasets or re-run to refresh them. Statistics such as view counts change constantly anyway.
- By using this actor you also agree to the [YouTube Terms of Service](https://www.youtube.com/t/terms). Google's handling of API requests is covered by the [Google Privacy Policy](https://policies.google.com/privacy). You can review or revoke your key at any time in the Google Cloud Console, and revoke API access for your Google account at [Google security settings](https://myaccount.google.com/permissions).

*This actor uses YouTube API Services. It is not affiliated with or endorsed by YouTube or Google.*

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| title | channelTitle | publishedAt | durationSec | viewCount | likeCount | commentCount | categoryId |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) | Rick Astley | 2009-10-25T06:57:33Z | 214 | 1828596530 | 19490833 | 2460128 | 10 |
| Me at the zoo | jawed | 2005-04-24T03:31:52Z | 19 | 445426986 | 20095698 | 10642771 | 1 |
| PSY - GANGNAM STYLE(강남스타일) M/V | officialpsy | 2012-07-15T07:46:32Z | 253 | 6098344051 | 32321298 | 5465487 | 10 |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `video-result` | $0.0004 | per video row delivered (full details and stats) | 1,000 videos = $0.40 (leading video-details actor: $0.95 per 1,000) |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 256 MB = $0.0000125 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `apiKey` | string | no | — | Required. Your own free YouTube Data API v3 key (starts with AIza). Get one in about a minute: console.cloud.google.com → create a project → APIs & Services → Library → enable "YouTube Data API v3" → Credentials → Create credentials → API key. No billing account is needed, and the free quota is 10,000 units per day. The key is stored encrypted by Apify, used only for this run's calls to googleapis.com, and never logged or written to the output. |
| `mode` | string | no | `"videos"` | Always videos on this listing (video details by URL or ID). |
| `videoUrls` | array | no | — | Videos to look up, one per line: watch URLs, youtu.be links, Shorts, embed or live URLs, or bare 11-character IDs. Duplicates are removed. Up to 50,000 per run; every 50 videos cost 1 of your 10,000 free daily quota units. |

### Limits & honest notes

- Lookups by video URL or ID only. To find videos by keyword, channel or playlist, use the related YouTube listings below with the same key.
- Private, deleted and invalid videos are free rows of type error and are never charged.
- **You need your own free YouTube Data API v3 key** (see the 4-step guide above). Without one the run finishes at once with a free row of instructions, and nothing is charged.
- Only public data the API returns for an API key: no dislike counts (removed by YouTube), no revenue and no watch time. Like counts hidden by the creator come back as null.
- You must refresh or delete stored API data within 30 days (YouTube Developer Policies III.E.4). We keep nothing after the run.
- The run's spend limit is respected: each page of videos is charged before it is delivered, and the run stops cleanly at the cap. If your key's quota runs out, the run stops cleanly and keeps what was delivered.

### Related ActorForge actors

- [YouTube Scraper (Official API) — Videos, Search & Stats](https://apify.com/actor-forge/youtube-api-scraper) — search, channels and comments with the same key
- [YouTube Channel Scraper (Official API) — All Videos & Stats](https://apify.com/actor-forge/youtube-channel-api) — channel stats plus every upload
- [YouTube Playlist Scraper (Official API)](https://apify.com/actor-forge/youtube-playlist-api) — every video in a playlist

### Changelog

- **2026-10-23** — Initial release: video-details-only listing of the YouTube Scraper (official API), $0.40 per 1,000 videos.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

## `apiKey` (type: `string`):

Required. Your own free YouTube Data API v3 key (starts with AIza). Get one in about a minute: console.cloud.google.com → create a project → APIs & Services → Library → enable "YouTube Data API v3" → Credentials → Create credentials → API key. No billing account is needed, and the free quota is 10,000 units per day. The key is stored encrypted by Apify, used only for this run's calls to googleapis.com, and never logged or written to the output.

## `mode` (type: `string`):

Always videos on this listing (video details by URL or ID).

## `videoUrls` (type: `array`):

Videos to look up, one per line: watch URLs, youtu.be links, Shorts, embed or live URLs, or bare 11-character IDs. Duplicates are removed. Up to 50,000 per run; every 50 videos cost 1 of your 10,000 free daily quota units.

## Actor input object example

```json
{
  "mode": "videos",
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}
```

# Actor output Schema

## `videos` (type: `string`):

One row per video (charged) with stats and metadata; free rows of type error for invalid, private or deleted videos.

## `errors` (type: `string`):

Free rows (type error) for invalid, not-found or private inputs and videos with comments disabled.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/youtube-video-details-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/youtube-video-details-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call actor-forge/youtube-video-details-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actor-forge/youtube-video-details-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/E2gzeTIm4TmyRfMk5/builds/Q4djc239tiO1oyxzw/openapi.json
