# YouTube Video Metadata Scraper (`flashdata/youtube-metadata`) Actor

Extract YouTube video details from a video ID: title, channel, duration, views and available chapters and format metadata. Export structured JSON. Requires a FlashData API key and Credits; Apify usage is billed separately.

- **URL**: https://apify.com/flashdata/youtube-metadata.md
- **Developed by:** [FlashData](https://apify.com/flashdata) (community)
- **Categories:** Videos, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Metadata Scraper

Look up a YouTube video and collect its details in structured JSON. Review the title, channel, duration and viewing statistics, with options to include available chapters and media format information.

### What you get

- **Video details:** available title, channel, duration, view count and live-status metadata.
- **Chapter information:** include available chapter titles and timestamps.
- **Format information:** include available audio/video format metadata without downloading the media.

Use it to inspect a video before further processing, organize a video catalog or locate sections using available chapter timestamps.

### Example output

The **YouTube Metadata results** dataset contains the returned video record. The table highlights basic fields; nested details are available in JSON. This example is illustrative, not a live result:

```json
{
  "videoId": "abcdefghijk",
  "title": "Example battery recycling walkthrough",
  "channel": "Example Science",
  "duration": 300,
  "viewCount": 1234,
  "isLive": false,
  "chapters": [
    {
      "title": "Introduction",
      "start_time": 0,
      "end_time": 60
    }
  ],
  "request_id": "req_example"
}
```

**Complete response and status** contains the full response, including returned chapter and format arrays and usage information. Field availability varies by video.

### Quick start

1. Get a [FlashData API key](https://flashdata.dev/app/api-keys) with `youtube_metadata` access and available Credits.
2. Enter the video's 11-character `video_id` and your key. Select whether to include chapters and format metadata.
3. Click **Start**, then open **YouTube Metadata results** for the record or **Complete response and status** for nested details.

```json
{
  "flashdataApiKey": "YOUR_FLASHDATA_API_KEY",
  "video_id": "abcdefghijk",
  "include_chapters": true,
  "include_formats": false
}
```

### Input parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `video_id` | Yes | 11-character YouTube video ID (the v= value in a watch URL).  |
| `flashdataApiKey` | Yes | Your FlashData API key, stored as encrypted input.  |
| `include_formats` | No | Include available video/audio format metadata, without downloading files. Default: `true`. |
| `include_chapters` | No | Include chapters when available. Default: `true`. |

Replace the illustrative video_id with a real video ID, such as the value after `v=` in a YouTube watch URL. This Actor accepts one ID per run, not a full URL or a list. Both include_chapters and include_formats default to true; set either to false to omit that optional request.

### Pricing

Requests use your FlashData Credits at your applicable [account rate](https://flashdata.dev/pricing). This Actor adds no service fee. Apify compute, storage and other platform usage are billed separately under your Apify plan.

### FAQ

**Does include_formats download video or audio?**

No. It requests format information only. Downloading media is a separate operation.

**Why are there no chapters?**

Not every video has chapters, and availability depends on the returned metadata. Enabling include_chapters does not generate chapters.

**Does this include the transcript?**

No. Use the dedicated transcript or captions Actor to retrieve an existing caption track.

**Can it read private or unavailable videos?**

Metadata depends on what the service can access. Private, removed, restricted or otherwise unavailable videos may fail or return limited information.

**What if a run fails?**

Check key permissions and Credits for authentication errors. After a timeout or interruption, inspect **Complete response and status** and FlashData Jobs/usage before starting again: the request may already have been charged. A new run can create another charge.

### Support

Open an issue on this Actor or email <support@flashdata.dev> with the run URL or request ID. Do not include API keys.

[API documentation](https://flashdata.dev/docs/sources/youtube_metadata) · [Terms](https://flashdata.dev/legal/terms) · [Privacy](https://flashdata.dev/legal/privacy)

This is an independent FlashData integration, not an official YouTube product.

# Actor input Schema

## `video_id` (type: `string`):

11-character YouTube video ID (the v= value in a watch URL).

## `flashdataApiKey` (type: `string`):

Requires youtube_metadata access. Get your key: https://flashdata.dev/app/api-keys

## `include_formats` (type: `boolean`):

Include available video/audio format metadata, without downloading files.

## `include_chapters` (type: `boolean`):

Include chapters when available.

## Actor input object example

```json
{
  "include_formats": true,
  "include_chapters": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `response` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("flashdata/youtube-metadata").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("flashdata/youtube-metadata").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 '{}' |
apify call flashdata/youtube-metadata --silent --output-dataset

```

## MCP server setup

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

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/BI8evC48x5OgxQkHx/builds/rtFmKPjhi98hRpNXK/openapi.json
