# YouTube Channel Data API: Export Videos With Your API Key (`atesen-software/youtube-channel-data-api`) Actor

Export a YouTube channel's videos, likely Shorts and channel stats to JSON, CSV or Excel through the official YouTube Data API v3. You bring your own free API key and your own quota. Sort by latest or popular, filter by date.

- **URL**: https://apify.com/atesen-software/youtube-channel-data-api.md
- **Developed by:** [Atesen Software](https://apify.com/atesen-software) (community)
- **Categories:** Videos, Social media, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 result rows

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 Channel Data API: Export Videos With Your API Key

> **Before you start:** this Actor needs your own YouTube Data API v3 key. It has not yet been tested end to end with a real key (the keyless and invalid-key paths and the data parsing are covered by tests). If you hit an error, tell us and we fix it the same day.

This Actor exports the videos, likely Shorts and public stats of any YouTube channel to JSON, CSV or Excel through the **official YouTube Data API v3**, with exact dates, view counts, likes, comment counts, tags and durations. It needs **your own free YouTube Data API key**: paste the key and a channel @handle into the input and click **Start**. Google counts the requests against your own quota, and no pages are scraped.

Use it when you want to export YouTube channel videos for an influencer shortlist, a competitor study, a content calendar, a spreadsheet or a database, and you prefer a documented API over scraping.

### Data source and permission

- **Source:** the official YouTube Data API v3 (`channels.list`, `playlistItems.list`, `videos.list`). No page scraping, no browser, no proxy, no login.
- **Your key, your quota:** every request is made with the API key you enter, so Google counts it against your own Google Cloud project. The free quota is 10,000 units per day.
- **Your responsibility:** by using your key you accept the YouTube API Services Terms of Service and the YouTube Developer Policies. They also cover how long you may keep API data, so read them before you store data for the long term.
- **Key safety:** Apify stores the key encrypted. The Actor sends it only to `googleapis.com` in a request header. It is never written to the log, the dataset or the run summary. Create a key just for this use, restrict it to YouTube Data API v3 (no application restriction, Apify has no fixed IP) and delete it in Google Cloud Console when you no longer need it.
- **No personal data:** rows hold public channel and video data only. No commenter names, no emails.
- **Not affiliated:** built by Atesen Software. Not affiliated with, endorsed by or connected to Google or YouTube. YouTube is a trademark of Google LLC.

### How to get an API key (5 minutes, free)

1. Open Google Cloud Console and create or pick a project.
2. Go to **APIs and Services > Library**, find **YouTube Data API v3** and click **Enable**.
3. Go to **APIs and Services > Credentials > Create credentials > API key**.
4. Open the key, under **API restrictions** choose **Restrict key** and tick only **YouTube Data API v3**. Leave application restrictions off.
5. Paste the key into the **YouTube Data API key** field of this Actor.

Without a key the run does not fail: it ends with one free `status` row that says `youtubeApiKey is required` and repeats these steps.

### Quick start

1. Paste your key, list your channels (one per line) and click **Start**. The prefilled input reads the 10 latest videos of one channel.
2. Open the **Output** tab. Rows with `"type": "channel"` are channel stats, `"type": "video"` are videos, `"type": "status"` are free notes (for example a channel that was not found).
3. Download the dataset as JSON, CSV or Excel.

### Input

| Field | What it does |
| --- | --- |
| `youtubeApiKey` | Your YouTube Data API v3 key (secret). |
| `channels` | `@handle`, `https://www.youtube.com/@name`, `/channel/UC...` or a channel ID that starts with `UC`. Older `/c/name` and `/user/name` links work when the name matches a handle or a legacy user name. |
| `contentTypes` | `videos` (uploads longer than 60 seconds, default) and/or `shorts` (60 seconds or less). |
| `maxVideosPerChannel` | Rows per channel across the selected types. Default 50. `0` means as many as one run allows (10,000). |
| `sortBy` | `latest` (default) or `popular` (most views among up to 5,000 recent uploads). |
| `onlyVideosNewerThan` | Optional date, for example `2026-01-31`. Reading stops when uploads get older. |
| `videoDetails` | Duration, view, like and comment counts, tags and the Shorts estimate. On by default. |
| `includeChannelInfo` | One channel row per channel. On by default. |
| `maxConcurrency` | Channels read at the same time, 1 to 3. All requests together stay under 5 per second. |

Example input:

```json
{
  "youtubeApiKey": "YOUR_API_KEY",
  "channels": ["@Apify", "@MrBeast"],
  "contentTypes": ["videos"],
  "maxVideosPerChannel": 20,
  "sortBy": "latest",
  "videoDetails": true,
  "includeChannelInfo": true
}
```

### Output

Shape of a channel row (values are illustrative; YouTube rounds public subscriber counts to three significant digits and some channels hide them, then `subscriberCount` is `null`):

```json
{
  "type": "channel",
  "channelId": "UCTgwcoeGGKmZ3zzCXN2qo_A",
  "title": "Apify",
  "handle": "@apify",
  "description": "About text of the channel",
  "subscriberCount": 40600,
  "videoCount": 307,
  "viewCount": 2662614,
  "country": "CZ",
  "publishedAt": "2017-01-04T10:00:00Z",
  "joinedDate": "2017-01-04",
  "keywords": "web scraping",
  "thumbnails": { "default": "https://...", "medium": "https://...", "high": "https://..." },
  "url": "https://www.youtube.com/@apify",
  "input": "@Apify"
}
```

Shape of a video row:

```json
{
  "type": "video",
  "videoId": "e6My6S_QFJk",
  "title": "Video title",
  "description": "First 500 characters of the description",
  "publishedAt": "2026-10-22T15:59:46Z",
  "duration": "5:02",
  "durationSec": 302,
  "viewCount": 2100,
  "likeCount": 50,
  "commentCount": 7,
  "tags": ["web scraping"],
  "url": "https://www.youtube.com/watch?v=e6My6S_QFJk",
  "thumbnail": "https://i.ytimg.com/vi/e6My6S_QFJk/maxresdefault.jpg",
  "isShortLikely": false,
  "contentType": "videos",
  "channelId": "UCTgwcoeGGKmZ3zzCXN2qo_A",
  "channelName": "Apify",
  "channelUrl": "https://www.youtube.com/@apify"
}
```

`likeCount` or `commentCount` is `null` when the creator hides likes or turns comments off.

### What it costs: Apify and your Google quota

**Apify side:** pay per event. One `result` event is charged for each saved channel row and each saved video row. Status rows are free. A run without a key, with a wrong key or with an exhausted quota charges nothing. Current prices are on the **Pricing** tab. Set **Maximum cost per run** in the run options and the Actor stops at that limit.

**Google side:** your own quota, free up to 10,000 units per day (resets at midnight Pacific Time). This Actor only uses calls that cost 1 unit each. It never uses `search.list`, which costs 100 units per call.

| Call | Units |
| --- | --- |
| Look up one channel (`channels.list`) | 1 |
| Read 50 uploads (`playlistItems.list`, one page) | 1 |
| Details for 50 videos (`videos.list`) | 1 |

Examples:

- 1 channel, 50 latest videos with details: 1 + 1 + 1 = **3 units**.
- 1 channel, 500 latest videos: 1 + 10 + 10 = **21 units**.
- 100 channels with 50 latest videos each: **300 units**, so a free key covers about 3,000 such channels per day.
- `popular` on one channel: it reads up to ten times the rows you ask for (at least 500, at most 5,000 uploads), so **21 to 201 units** per channel.
- Shorts only on a channel with 3,000 uploads: every upload is checked for its duration, 1 + 60 + 60 = **121 units**.

The run summary (`RUN_SUMMARY` in the key-value store) shows how many units the run used.

### What it does and what it does not

- Reads the uploads playlist of each channel with 50 videos per request. The Actor keeps at most 5 requests per second, so even a channel with hundreds of videos takes seconds of API time.
- **Shorts are an estimate.** The Data API has no Shorts flag. A video of 60 seconds or less is marked `isShortLikely: true`. YouTube now allows Shorts of up to 3 minutes, so a longer Short shows up as a video, and a normal clip under 60 seconds shows up as a Short.
- **Live streams are not a content type.** Live and upcoming broadcasts are skipped. A finished live stream is a normal video.
- Private and deleted videos are not returned by the API and are skipped.
- Does not collect comments, transcripts, search results, playlists other than uploads, or analytics that need the channel owner's login.
- Descriptions are cut to 500 characters (channel descriptions to 1,000).
- A quota error, a wrong key or a blocked key stops the run at once with a clear status row. Rows saved before that stay in the dataset. Network errors and 5xx answers are retried a few times. Quota and key errors are never retried.

### Differences from the older YouTube Channel Scraper Actor

The older Actor (`youtube-channel-scraper`) reads YouTube pages without a key. This one uses the official API and needs your key.

| | Older Actor | This Actor |
| --- | --- | --- |
| Source | YouTube pages | Official Data API v3 |
| Key | none | your own key |
| Dates and counts | relative text unless details are on | exact ISO dates and numbers |
| Shorts | tab based flag `isShort` | `isShortLikely`, estimated from duration |
| Live streams tab, sort `oldest` | yes | no (a free `input_notice` row tells you) |
| Channel links, verified flag, business email flag | yes | not in the API, removed |
| Row types and main field names | `type`, `videoId`, `title`, `viewCount`, `publishedAt`, `duration`, `channelId`... | kept; `description` replaces `descriptionSnippet`, `tags` replaces `keywords` and `hashtags` on videos |
| Limit | none, but breaks when YouTube changes pages | your Google quota (10,000 units per day free) |

### Use via API, n8n, Make and Zapier

Put the Apify token in the `Authorization` header, never in a URL:

```bash
curl -X POST "https://api.apify.com/v2/acts/atesen-software~youtube-channel-data-api/run-sync-get-dataset-items?timeout=120" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "youtubeApiKey": "YOUR_YOUTUBE_API_KEY", "channels": ["@Apify"], "maxVideosPerChannel": 50 }'
```

**JavaScript** (`npm install apify-client`):

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('atesen-software/youtube-channel-data-api').call({ channels: ["@Apify"], contentTypes: ["videos"], maxVideosPerChannel: 10, sortBy: "latest" });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

In n8n use the Apify node or an HTTP Request node, in Make the Apify modules, in Zapier the Apify app. Pass the YouTube key as the `youtubeApiKey` input field.

### Use with AI agents (MCP)

Claude Desktop, Cursor, VS Code and other MCP clients can call this Actor as a tool through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Load only this Actor with:

```text
https://mcp.apify.com?tools=atesen-software/youtube-channel-data-api
```

Client config (sign in with Apify OAuth when the browser opens, or add an `Authorization: Bearer <APIFY_TOKEN>` header instead):

```json
{
  "mcpServers": {
    "apify": { "url": "https://mcp.apify.com?tools=atesen-software/youtube-channel-data-api" }
  }
}
```

Then ask in plain words, for example: "List the 10 latest videos of @Apify with views, likes and duration." The agent fills the same input fields you see on the Input tab, and runs are billed to your Apify account at the prices on the Pricing tab.

### FAQ

**Why do I need my own API key?** The Actor calls the official API. Google counts each request against the project that owns the key, so you stay in control of the quota and can revoke the key at any time.

**Is there a free way to get a key?** Yes. Creating a key in Google Cloud Console is free and includes 10,000 units per day.

**I get `quota_exceeded`.** Your project used its daily units. Wait for the reset at midnight Pacific Time or ask Google for more quota in Google Cloud Console. Rows saved before the stop are in the dataset.

**I get `api_key_restricted`.** The key is limited to an IP address, a website or other APIs. Set API restrictions to YouTube Data API v3 only and remove application restrictions.

**I get `api_not_enabled`.** Enable YouTube Data API v3 for the project of the key in APIs and Services > Library.

**Why fewer rows than `maxVideosPerChannel`?** The channel has fewer matching uploads, or the date filter or the videos/shorts filter removed some. A free `no_videos` status row says so.

**Can I get only new uploads?** Save the input as a task with `onlyVideosNewerThan` set to a recent date and add a schedule in Apify Console.

### Related actors

- [YouTube Channel Scraper: Export Videos, Shorts & Subscribers](https://apify.com/atesen-software/youtube-channel-scraper)
- [YouTube Search Scraper: Videos, Views & Rank Tracker](https://apify.com/atesen-software/youtube-search-scraper)
- [YouTube Comments Scraper: Comments & Replies, No API Key](https://apify.com/atesen-software/youtube-comments-scraper)

# Actor input Schema

## `youtubeApiKey` (type: `string`):

Your own YouTube Data API v3 key from Google Cloud Console (APIs and Services > Credentials). Under API restrictions tick only YouTube Data API v3 and leave application restrictions off. Apify stores it encrypted. It is never written to the log, the dataset or the run summary. Not marked as a required field on purpose: without a key the run ends with one free status row that explains how to get one, so an empty start never fails.

## `channels` (type: `array`):

"@handle", channel URLs (https://www.youtube.com/@Apify, /channel/UC...) or channel IDs that start with UC. One channel lookup costs 1 unit of your API quota.

## `contentTypes` (type: `array`):

Videos are uploads longer than 60 seconds. Shorts are uploads of 60 seconds or less. The Data API has no Shorts flag, so this split is an estimate (see the README).

## `maxVideosPerChannel` (type: `integer`):

Rows per channel across the selected content types. 0 = as many as one run allows (10,000). Every 50 uploads read cost about 2 units of your quota.

## `sortBy` (type: `string`):

Latest reads the newest uploads first. Popular reads up to 5,000 recent uploads of the channel and returns the ones with the most views (up to 201 units of your quota per channel).

## `onlyVideosNewerThan` (type: `string`):

Optional date such as 2026-01-31. Reading stops when the channel's uploads get older than this date.

## `videoDetails` (type: `boolean`):

Adds duration, view, like and comment counts, tags and the Shorts estimate with one extra request per 50 videos (1 unit). Videos and Shorts are told apart by duration, so this lookup runs anyway when you pick only one of them or sort by popular.

## `includeChannelInfo` (type: `boolean`):

Adds one row per channel: subscribers, total views, video count, country, start date, keywords and thumbnails.

## `maxConcurrency` (type: `integer`):

How many channels are read at the same time. All requests together stay under 5 per second.

## Actor input object example

```json
{
  "channels": [
    "@Apify"
  ],
  "contentTypes": [
    "videos"
  ],
  "maxVideosPerChannel": 10,
  "sortBy": "latest",
  "videoDetails": true,
  "includeChannelInfo": true,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

One row per video

## `channels` (type: `string`):

One row per channel

## `allFields` (type: `string`):

Every row with every field

## `summary` (type: `string`):

Rows saved, quota units used and the reason the run stopped

# 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 = {
    "channels": [
        "@Apify"
    ],
    "contentTypes": [
        "videos"
    ],
    "maxVideosPerChannel": 10,
    "sortBy": "latest",
    "videoDetails": true,
    "includeChannelInfo": true,
    "maxConcurrency": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("atesen-software/youtube-channel-data-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 = {
    "channels": ["@Apify"],
    "contentTypes": ["videos"],
    "maxVideosPerChannel": 10,
    "sortBy": "latest",
    "videoDetails": True,
    "includeChannelInfo": True,
    "maxConcurrency": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("atesen-software/youtube-channel-data-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 '{
  "channels": [
    "@Apify"
  ],
  "contentTypes": [
    "videos"
  ],
  "maxVideosPerChannel": 10,
  "sortBy": "latest",
  "videoDetails": true,
  "includeChannelInfo": true,
  "maxConcurrency": 2
}' |
apify call atesen-software/youtube-channel-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,atesen-software/youtube-channel-data-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/UjAO4RgHg5dCdPxSc/builds/fwMXqCE7NyWdw4VBo/openapi.json
