# YouTube API by APISH (`apish/youtube-api`) Actor

YouTube data as clean JSON via APISH: YouTube channel, YouTube channel about, YouTube channel live streams and 22 more endpoints. Pay per credit; failed calls are free.

- **URL**: https://apify.com/apish/youtube-api.md
- **Developed by:** [APISH](https://apify.com/apish) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 credits

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 API by APISH

Get public YouTube data as clean, consistent JSON: youTube channel, youTube channel about, youTube channel live streams, youTube channel playlists, youTube channel podcasts, youTube channel community posts and more. 25 endpoints, one response shape, numbers parsed, absolute URLs.

### How to use

1. Pick an **Endpoint**. Each option shows what it returns and its price in credits.
2. Enter its **Parameters** as JSON, for example `{"channel":"Google"}`. All parameters are listed below.
3. Run. Each call becomes one row in the dataset. Use **Batch** to run the same endpoint for many inputs and **Pages per input** to follow pagination.

### Pricing

Pay per event: you pay per APISH credit the call used. The price of each endpoint is in the table below. Calls that fail on our side (server errors, timeouts, blocks) are free.

### Endpoints

| Endpoint | Returns | Required parameters | Credits |
|---|---|---|---|
| `/youtube/v1/channel` | YouTube channel | `channel` | 1 |
| `/youtube/v1/channel/about` | YouTube channel about | `channel` | 1 |
| `/youtube/v1/channel/lives` | YouTube channel live streams | `channel` | 1 |
| `/youtube/v1/channel/playlists` | YouTube channel playlists | `channel` | 1 |
| `/youtube/v1/channel/podcasts` | YouTube channel podcasts | `channel` | 1 |
| `/youtube/v1/channel/posts` | YouTube channel community posts | `channel` | 1 |
| `/youtube/v1/channel/search` | YouTube search within a channel | `channel`, `q` | 1 |
| `/youtube/v1/channel/shorts` | YouTube channel Shorts | `channel` | 1 |
| `/youtube/v1/channel/videos` | YouTube channel videos | `channel` | 1 |
| `/youtube/v1/charts` | YouTube Charts | — | 1 |
| `/youtube/v1/comment/replies` | Replies to a YouTube comment | `cursor` | 1 |
| `/youtube/v1/comments` | YouTube video comments | `video_id` | 1 |
| `/youtube/v1/hashtag` | YouTube videos for a hashtag | `hashtag` | 1 |
| `/youtube/v1/playlist` | YouTube playlist | `url` | 1 |
| `/youtube/v1/post` | YouTube community post | `url` | 1 |
| `/youtube/v1/post/comments` | YouTube community post comments | `url` | 1 |
| `/youtube/v1/search` | YouTube search | `q` | 1 |
| `/youtube/v1/search/typeahead` | YouTube search suggestions | `q` | 1 |
| `/youtube/v1/shorts` | One YouTube short | `id` | 1 |
| `/youtube/v1/shorts/trending` | Trending YouTube Shorts | — | 1 |
| `/youtube/v1/transcript` | YouTube video transcript | `video_id` | 1 |
| `/youtube/v1/video` | One YouTube video | `id` | 1 |
| `/youtube/v1/video/chat` | YouTube live chat replay | `id` | 1 |
| `/youtube/v1/video/related` | YouTube related videos | `id` | 1 |
| `/youtube/v1/video/sponsors` | Sponsors in a YouTube video (segments, promo codes, links) | `url` | 1 |

### Output

Each dataset row has `endpoint`, `params`, `status`, `credits_used` and the endpoint's data. Add `"raw": 1` to the parameters to also get the site's original record, or `"fields": "a,b.c"` to return only the fields you need.

### Endpoint details

#### YouTube channel

Endpoint `/youtube/v1/channel` · 1 credit per successful call.

Parameters:

- `channel` (required): Channel handle, with or without `@`.

Example parameters: `{"channel":"Google"}`

#### YouTube channel about

Endpoint `/youtube/v1/channel/about` · 1 credit per successful call.

The channel's About panel: description, country, join date, subscriber/view/video totals and every external link (with its real target). Every response includes `credits_used`: the credits this call cost.

Parameters:

- `channel` (required): Handle (@mkbhd), channel id (UC…) or channel URL.

Example parameters: `{"channel":"@mkbhd"}`

#### YouTube channel live streams

Endpoint `/youtube/v1/channel/lives` · 1 credit per successful call.

Parameters:

- `channel` (required)
- `sort` — one of `latest`, `popular`, `oldest`: latest (default), popular or oldest: the tab's own sort chips; next_cursor keeps the order.
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"channel":"@NASA"}`

#### YouTube channel playlists

Endpoint `/youtube/v1/channel/playlists` · 1 credit per successful call.

Parameters:

- `channel` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"channel":"@NASA"}`

#### YouTube channel podcasts

Endpoint `/youtube/v1/channel/podcasts` · 1 credit per successful call.

The channel's Podcasts tab: its podcast playlists (episode count, thumbnail). Empty when the channel has none. Pass `next_cursor` back as `cursor`. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `channel` (required): Handle, channel id or channel URL.
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"channel":"@TheDiaryOfACEO"}`

#### YouTube channel community posts

Endpoint `/youtube/v1/channel/posts` · 1 credit per successful call.

Parameters:

- `channel` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"channel":"@MrBeast"}`

#### YouTube search within a channel

Endpoint `/youtube/v1/channel/search` · 1 credit per successful call.

The channel's own Search tab: its videos (and playlists) matching the query. Pass `next_cursor` back as `cursor`. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `channel` (required): Handle, channel id or channel URL.
- `q` (required): Search text.
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"channel":"@mkbhd","q":"iphone"}`

#### YouTube channel Shorts

Endpoint `/youtube/v1/channel/shorts` · 1 credit per successful call.

Parameters:

- `channel` (required)
- `sort` — one of `latest`, `popular`, `oldest`: latest (default), popular or oldest: the tab's own sort chips; next_cursor keeps the order.
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"channel":"@MrBeast"}`

#### YouTube channel videos

Endpoint `/youtube/v1/channel/videos` · 1 credit per successful call.

Pass `next_cursor` back as `cursor` for the next videos. `next_cursor` is null on the last page.

Parameters:

- `channel` (required): Channel handle, with or without `@`.
- `sort` — one of `latest`, `popular`, `oldest`: latest (default), popular or oldest: the tab's own sort chips; next_cursor keeps the order.
- `cursor`: Cursor from `next_cursor` on the previous response; `next_cursor` is null on the last page.

Example parameters: `{"channel":"Google"}`

#### YouTube Charts

Endpoint `/youtube/v1/charts` · 1 credit per successful call.

YouTube's music charts (charts.youtube.com) for a country or worldwide: weekly top songs, artists and music videos (100 each), weekly top songs on Shorts (50) and daily trending music videos (30), with rank, previous rank, periods on chart, views and their change, artists, release date, songwriters and producers. `available_charts` lists the charts and date ranges the country has. One page per chart. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `chart` — one of `songs`, `artists`, `videos`, `shorts_songs`, `trending`: songs (default), artists, videos, shorts_songs or trending.
- `country`: global (default) or a two-letter country code (us, in, gb, br, ...).

#### Replies to a YouTube comment

Endpoint `/youtube/v1/comment/replies` · 1 credit per successful call.

Parameters:

- `cursor` (required): `replies_cursor` of a comment from /youtube/v1/comments.

Example parameters: `{"cursor":"Eg0SC2RRdzR3OVdnWGNRGAYygwEaUBIaVWd6S1lrc3FlUTVnQTN0MGcwRjRBYUFCQWciAggAKhhVQ3VBWEZrZ3N3MUw3eGFDZm5kNUpKT3cyC2RRdzR3OVdnWGNRQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3pLWWtzcWVRNWdBM3QwZzBGNEFhQUJBZw%3D%3D"}`

#### YouTube video comments

Endpoint `/youtube/v1/comments` · 1 credit per successful call.

Pass `next_cursor` back as `cursor` for the next comments. `next_cursor` is null on the last page.

Parameters:

- `video_id` (required)
- `sort` — one of `top`, `newest`: top (default) or newest, as in the comments header; next_cursor keeps the order.
- `cursor`: Cursor from `next_cursor` on the previous response; `next_cursor` is null on the last page.

Example parameters: `{"video_id":"dQw4w9WgXcQ"}`

#### YouTube videos for a hashtag

Endpoint `/youtube/v1/hashtag` · 1 credit per successful call.

Parameters:

- `hashtag` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"hashtag":"cooking"}`

#### YouTube playlist

Endpoint `/youtube/v1/playlist` · 1 credit per successful call.

Parameters:

- `url` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"url":"https://www.youtube.com/playlist?list=PLBsP89CPrMeMV1oP42Zn2DrWpnFoSaufA"}`

#### YouTube community post

Endpoint `/youtube/v1/post` · 1 credit per successful call.

Parameters:

- `url` (required)

Example parameters: `{"url":"https://www.youtube.com/post/UgkxHIfkQ3K2my65-kPq4VkRv9KrBRyN7alx"}`

#### YouTube community post comments

Endpoint `/youtube/v1/post/comments` · 1 credit per successful call.

Comments on a community post. Each comment carries `replies_cursor` for /youtube/v1/comment/replies. Pass `next_cursor` back as `cursor`. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `url` (required): Post URL (https://www.youtube.com/post/<id>) or post id.
- `sort` — one of `top`, `newest`: top (default) or newest.
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"url":"https://www.youtube.com/post/UgkxHIfkQ3K2my65-kPq4VkRv9KrBRyN7alx"}`

#### YouTube search

Endpoint `/youtube/v1/search` · 1 credit per successful call.

Pass `next_cursor` back as `cursor` for the next results. `next_cursor` is null on the last page.

Parameters:

- `q` (required)
- `sort` — one of `relevance`, `rating`, `date`, `views`: relevance (default), rating, date or views.
- `type` — one of `video`, `channel`, `playlist`, `movie`: video, channel, playlist or movie. Channels come back under `channels`, playlists under `playlists`.
- `duration` — one of `short`, `medium`, `long`: short (under 4 min), medium (4-20 min) or long (over 20 min).
- `upload_date` — one of `hour`, `today`, `week`, `month`, `year`: hour, today, week, month or year.
- `features`: Comma-separated: hd, subtitles, creative_commons, 3d, live, purchased, 4k, 360, location, hdr, vr180.
- `hl`: Interface language of the results (ISO 639-1), default en.
- `gl`: Country of the results (ISO 3166-1 alpha-2), default US.
- `cursor`: Cursor from `next_cursor` on the previous response; `next_cursor` is null on the last page.

Example parameters: `{"q":"lofi"}`

#### YouTube search suggestions

Endpoint `/youtube/v1/search/typeahead` · 1 credit per successful call.

Parameters:

- `q` (required)

Example parameters: `{"q":"how to"}`

#### One YouTube short

Endpoint `/youtube/v1/shorts` · 1 credit per successful call.

Parameters:

- `id` (required)

Example parameters: `{"id":"dQw4w9WgXcQ"}`

#### Trending YouTube Shorts

Endpoint `/youtube/v1/shorts/trending` · 1 credit per successful call.

Parameters:

- `period`: today, week or month.

#### YouTube video transcript

Endpoint `/youtube/v1/transcript` · 1 credit per successful call.

Parameters:

- `video_id` (required)
- `url`: Video URL (instead of video_id).

Example parameters: `{"video_id":"aircAruvnKk"}`

#### One YouTube video

Endpoint `/youtube/v1/video` · 1 credit per successful call.

Everything the watch page has for a video: details, formats, captions, chapters, heatmap ("Most replayed"), related videos and more. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `id` (required)

Example parameters: `{"id":"dQw4w9WgXcQ"}`

#### YouTube live chat replay

Endpoint `/youtube/v1/video/chat` · 1 credit per successful call.

The chat replay of a past live stream (when the stream kept its chat): messages, Super Chats and memberships with author, badges, amount and the video offset. Pass `next_cursor` back as `cursor` to read on. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `id` (required): Video id or URL of a past stream.
- `mode` — one of `top`, `all`: top (default, Top chat replay) or all (Live chat replay).
- `start_s`: Start reading at this many seconds into the stream (first page only).
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"id":"rbbkNlvx7PM"}`

#### YouTube related videos

Endpoint `/youtube/v1/video/related` · 1 credit per successful call.

The watch page's "Up next" list for a video, without the player data (cheaper than /youtube/v1/video). Every response includes `credits_used`: the credits this call cost.

Parameters:

- `id` (required): Video id or URL.
- `cursor`: Value of `next_cursor` from the previous page (YouTube returns one page to logged-out visitors for most videos).

Example parameters: `{"id":"dQw4w9WgXcQ"}`

#### Sponsors in a YouTube video (segments, promo codes, links)

Endpoint `/youtube/v1/video/sponsors` · 1 credit per successful call.

Parameters:

- `url` (required)

Example parameters: `{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}`

### Support

Questions, bugs or a missing field? Open an issue in this Actor's Issues tab and we will reply there.

Public data only: nothing behind a login. You are responsible for how you use the data you collect.

# Actor input Schema

## `endpoint` (type: `string`):

Which YouTube endpoint to call. Each option shows what it returns and its price in credits.

## `params` (type: `object`):

Query parameters for the endpoint, as JSON. See the README for every endpoint's parameters. Example: {"channel":"Google"}

## `batch` (type: `array`):

Run the same endpoint for many inputs: a list of parameter objects. Each item is one call. Leave empty to use Parameters.

## `maxPages` (type: `integer`):

For paginated endpoints: follow next_cursor up to this many pages per input. 1 = first page only.

## Actor input object example

```json
{
  "endpoint": "/youtube/v1/channel",
  "params": {
    "channel": "Google"
  },
  "batch": [],
  "maxPages": 1
}
```

# Actor output Schema

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

One row per call: endpoint, params, status, credits_used and the data.

# 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 = {
    "endpoint": "/youtube/v1/channel",
    "params": {
        "channel": "Google"
    },
    "batch": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("apish/youtube-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 = {
    "endpoint": "/youtube/v1/channel",
    "params": { "channel": "Google" },
    "batch": [],
}

# Run the Actor and wait for it to finish
run = client.actor("apish/youtube-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 '{
  "endpoint": "/youtube/v1/channel",
  "params": {
    "channel": "Google"
  },
  "batch": []
}' |
apify call apish/youtube-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apish/youtube-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/A1PGpfIvNJBdKtspb/builds/ECcXigtc9MdLmSI4Q/openapi.json
