# YouTube Video Tracker - Views, Likes, Comments, Daily Changes (`magenta_courser/youtube-video-tracker`) Actor

Paste YouTube video, Shorts or channel links and get views, likes, comments and subscribers per video, with the change since your last run. Same column names as streamers/youtube-scraper, no login, one flat row per video.

- **URL**: https://apify.com/magenta_courser/youtube-video-tracker.md
- **Developed by:** [SUNGHWAN CHO](https://apify.com/magenta_courser) (community)
- **Categories:** Social media, Videos, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Tracker: Views, Likes, Comments and Daily Changes

> **Free plan:** Apify's $5 monthly credit covers about 1,600 videos with this Actor.

Paste YouTube video, Shorts or channel links and get one flat row per video with views, exact likes, comments and subscribers, plus the change since your last run. It is a YouTube video scraper without login or browser, built for marketing teams who track the same campaign videos every day and want the daily increase in views, likes and comments in a sheet. The columns use the same names, order and types as [streamers/youtube-scraper](https://apify.com/streamers/youtube-scraper), so it works as a drop-in replacement for that Actor in existing sheets, dashboards and code.

- **Exact numbers.** `viewCount`, `likes` and `commentsCount` are exact integers. Subscribers are published by YouTube only as rounded text ("4.56M"), so `numberOfSubscribers` is 4560000 with `numberOfSubscribersIsApprox: true` and the original text in `numberOfSubscribersRaw`.
- **Change tracking built in.** The previous values are kept in a named key-value store in your account. No spreadsheet formulas, no second tool.
- **Failed links are free.** A removed, private or mistyped link gets a row with `status` and a `statusMessage` that says what to do. Only rows with `status: "ok"` are charged.
- **No login, no browser.** Plain HTTP requests to YouTube's public pages. No account, no cookies from an account.

### What you get

One row per video. The first block of columns is shared with streamers/youtube-scraper (same names, order and types); the second block is what this Actor adds for tracking.

#### Columns shared with streamers/youtube-scraper

| Column | Type | Description |
|---|---|---|
| `title`, `id`, `url`, `type` (`video` | `shorts` | `stream`), `input` | string | Same as the reference |
| `viewCount` | integer | Exact view count |
| `likes` | integer | Exact integer (the reference rounds: 19000000 where this Actor gives 19497563). `null` when the creator hides likes |
| `commentsCount` | integer | Exact. `null` when comments are turned off |
| `numberOfSubscribers` | integer | Rounded by YouTube; see `numberOfSubscribersIsApprox` |
| `date` | ISO string | Publish time. On `detailLevel: "partial"` rows it is the publish day at 00:00 UTC with `dateIsApprox: true` |
| `duration` | `HH:MM:SS` | Can be `null` on `partial` rows |
| `thumbnailUrl` | string | On `partial` rows the standard `hqdefault.jpg` thumbnail |
| `channelName`, `channelUrl`, `channelUsername`, `channelId` | string | Channel of the video |
| `text`, `descriptionLinks`, `hashtags` | string, array, array | Description, links found in it, hashtags |
| `translatedTitle`, `translatedText` | string | Filled when YouTube gives a localized title or description; pages are requested in English |
| `commentsTurnedOff`, `isMembersOnly`, `isPaidContent`, `isAgeRestricted` | boolean | `isPaidContent` and `isAgeRestricted` are `null` on `partial` rows |
| `location` | string | Location tag above the title when the video has one, else `null` |
| `fromYTUrl`, `order` | string, integer | Channel tab or search page the video was listed on, and its position there. `null` for direct links |
| `channelDescription`, `channelTotalVideos`, `channelLocation`, `channelJoinedDate`, `channelTotalViews`, `channelBannerUrl` | mixed | Filled on rows that come from a channel link, `null` on direct video links |
| `isChannelVerified`, `channelAvatarUrl` | boolean, string | Filled on every row |

Columns that exist so sheets keep their shape but are always `null` in this Actor: `subtitles`, `transcriptionUrl` (no subtitles or speech-to-text), `aiVideoDescription`, `aiVideoSummary` (no AI add-ons), `isMonetized` (not published by YouTube without the creator's login; the reference returns `null` too), `collaborators` (not read yet; tell us in Issues if you need it).

Also not supported: playlist and hashtag links, search filters and sorting, search beyond the first results page, comment texts, video downloads, private videos (they need the creator's login).

#### Columns this Actor adds

| Column | Type | Description |
|---|---|---|
| `status` | string | `ok`, `not_found` (removed or wrong link), `private`, `blocked`, `error` |
| `statusMessage` | string | For rows that are not ok: what happened and what to do next. `null` on ok rows |
| `detailLevel` | string | `full`, or `partial` when YouTube withheld the player details for that request (see FAQ) |
| `dateIsApprox`, `likesIsApprox`, `commentsCountIsApprox`, `numberOfSubscribersIsApprox` | boolean | `true` when the number is rounded or the date has no time of day |
| `likesRaw`, `commentsCountRaw`, `numberOfSubscribersRaw` | string | The value as YouTube printed it |
| `scrapedAt`, `previousScrapedAt` | ISO string | Time of this reading and of the reading it is compared with |
| `viewChange`, `likeChange`, `commentChange`, `subscriberChange` | integer | This run minus the previous run. `null` on the first run |
| `isFirstSeen` | boolean | `true` when the history store has no earlier reading of the video |

`columnFormat: "tracker"` gives the same facts under this Actor's own names (`videoId`, `viewCount`, `likeCount`, `commentCount`, `subscriberCount`, `publishedAt`, `durationSeconds`, `isShort`, `category`, ...) with `previousViewCount`, `previousLikeCount`, `previousCommentCount` and `previousSubscriberCount` next to the change fields.

### Sample output

One real row from a run of this Actor (`columnFormat: "streamers"`, first run so the change fields are `null`; `text`, `translatedText` and `descriptionLinks` shortened):

```json
{
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "translatedTitle": null,
  "type": "video",
  "id": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "viewCount": 1835314923,
  "date": "2009-10-25T06:57:33.000Z",
  "likes": 19497604,
  "location": null,
  "channelName": "Rick Astley",
  "channelUrl": "https://www.youtube.com/@RickAstleyYT",
  "channelUsername": "RickAstleyYT",
  "collaborators": null,
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "numberOfSubscribers": 4560000,
  "duration": "00:03:33",
  "commentsCount": 2461599,
  "text": "The official video for “Never Gonna Give You Up” by Rick Astley. ...",
  "translatedText": "The official video for “Never Gonna Give You Up” by Rick Astley. ...",
  "descriptionLinks": [
    { "url": "https://www.youtube.com/hashtag/rickastleynever", "text": "#RickAstleyNever" },
    { "url": "https://linktr.ee/rickastleynever", "text": "https://linktr.ee/rickastleynever" }
  ],
  "subtitles": null,
  "aiVideoDescription": null,
  "aiVideoSummary": null,
  "transcriptionUrl": null,
  "commentsTurnedOff": false,
  "isMonetized": null,
  "hashtags": ["#OfficialMusicVideo", "#NeverGonnaGiveYouUp", "#RickAstleyNever"],
  "isMembersOnly": false,
  "input": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "isPaidContent": false,
  "fromYTUrl": null,
  "order": null,
  "channelTotalVideos": null,
  "channelDescription": null,
  "channelLocation": null,
  "channelJoinedDate": null,
  "channelTotalViews": null,
  "isChannelVerified": true,
  "channelBannerUrl": null,
  "channelAvatarUrl": "https://yt3.ggpht.com/_ShEGOdg-t5YGJse14Ooq6FYBZqX_QSlhaTNjG06miYusm5lWm1UroLyVxnYtahADfRTVLtuVQ=s176-c-k-c0x00ffffff-no-rj",
  "isAgeRestricted": false,
  "status": "ok",
  "statusMessage": null,
  "detailLevel": "full",
  "dateIsApprox": false,
  "likesIsApprox": false,
  "likesRaw": "19497604",
  "commentsCountIsApprox": false,
  "commentsCountRaw": "2,461,599",
  "numberOfSubscribersIsApprox": true,
  "numberOfSubscribersRaw": "4.56M",
  "scrapedAt": "2026-11-09T06:31:07.078Z",
  "previousScrapedAt": null,
  "viewChange": null,
  "likeChange": null,
  "commentChange": null,
  "subscriberChange": null,
  "isFirstSeen": true
}
```

**Second run (changes filled).** The prefilled input run a second time a few minutes after the first, with the same `historyStoreName`: one real row, shortened to the count and change columns (the full row has the same columns as the one above).

```json
{
  "title": "Does your Body Speak your Language? | Cara Hale Alter | TED",
  "url": "https://www.youtube.com/watch?v=on1L_jblaw8",
  "viewCount": 240423,
  "likes": 3014,
  "commentsCount": 59,
  "numberOfSubscribers": 28000000,
  "status": "ok",
  "scrapedAt": "2026-11-12T03:04:00.556Z",
  "previousScrapedAt": "2026-11-12T03:00:07.364Z",
  "viewChange": 55,
  "likeChange": 2,
  "commentChange": 0,
  "subscriberChange": 0,
  "isFirstSeen": false
}
```

### Use cases

1. **Influencer campaign reporting.** A marketing team keeps the list of sponsored videos and Shorts from a campaign in one scheduled task, runs it every morning, and reads `viewChange`, `likeChange` and `commentChange` per video to see which creators are still gaining reach. The same links go in every day; the history store does the subtraction.
2. **Replacing a YouTube scraper in an existing pipeline.** An analyst who already imports streamers/youtube-scraper output into Google Sheets or a database swaps in this Actor and keeps the columns, then gets the change fields on top.
3. **Competitor and channel monitoring.** A content strategist pastes a few channel links with `maxResults: 20` and tracks which of the latest uploads and Shorts take off, without visiting each channel.
4. **Creator and agency dashboards.** An agency that reports to several clients uses one `historyStoreName` per client so each client's campaign is compared only with its own previous run.
5. **Alerts on large lists.** With `outputMode: "changesOnly"` on a list of hundreds of videos, only videos whose numbers moved are saved and charged, which keeps a daily alert run cheap.

### How to use

#### Apify Console

Open the Actor, paste your video, Shorts or channel links into **Start URLs**, and click **Start**. Only `startUrls` is required. To track changes, create a Task from the input, add a Schedule (daily or hourly), and keep the link list in the Task; from the second run on each row has the change fields.

```json
{
  "startUrls": [
    { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    { "url": "https://www.youtube.com/shorts/kPI9Mc35mOg" },
    { "url": "https://www.youtube.com/@Apify" }
  ],
  "maxResults": 10
}
```

| Field | Type | Default | What it does |
|---|---|---|---|
| `startUrls` | array of `{ "url" }` | | Video links (`watch?v=`, `youtu.be/`, `/shorts/`, `/live/`, `/embed/`), bare 11-character video ids, or channel links (`/@handle`, `/channel/UC...`, `/c/name`, `/user/name`, optionally ending in `/videos`, `/shorts` or `/streams`). |
| `searchQueries` | array of strings | | Optional search terms. Each returns the videos of the first results page (about 20 at most), limited by `maxResults`. |
| `maxResults` | integer | 10 | Latest regular videos per channel link, and videos per search term. Direct video links are not affected. |
| `maxResultsShorts` | integer | 0 | Latest Shorts per channel link. |
| `maxResultStreams` | integer | 0 | Latest live streams per channel link. |
| `columnFormat` | `streamers` | `tracker` | `streamers` | `streamers`: column names, order and types of streamers/youtube-scraper, then this Actor's columns. `tracker`: this Actor's own names. |
| `compareWithLastRun` | boolean | true | Adds the change fields, compared with the last run that used the same history store. |
| `outputMode` | `all` | `changesOnly` | `all` | `changesOnly` saves and charges only videos that are new or whose views, likes, comments or subscribers changed. |
| `historyStoreName` | string | `youtube-video-history` | Named key-value store with the previous values. Use one name per campaign or client. |
| `proxyConfiguration` | object | Apify datacenter | Datacenter proxy is the tested default and the only Apify proxy used: a selected RESIDENTIAL group is ignored with a warning. Your own proxy URLs are used as given. |
| `maxRequests` | integer | 0 (unlimited) | Upper limit of HTTP requests per run. |
| `maxRunMinutes` | integer | 60 | The run stops sending requests after this time. |

The same video pasted twice (for example as `youtu.be/` and `watch?v=`) gets one row.

#### API (curl)

```bash
curl -X POST "https://api.apify.com/v2/acts/magenta_courser~youtube-video-tracker/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}]}'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("magenta_courser/youtube-video-tracker").call(run_input={
    "startUrls": [{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],
    "historyStoreName": "campaign-spring",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["title"], row["viewCount"], row["viewChange"])
```

#### JavaScript

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

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('magenta_courser/youtube-video-tracker').call({
    startUrls: [{ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }],
    historyStoreName: 'campaign-spring',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((r) => [r.title, r.viewCount, r.viewChange]));
```

#### AI agents and MCP

Connect your agent (Claude, Cursor, a LangChain or OpenAI Agents SDK app, or any MCP client) to the Apify MCP server at `https://mcp.apify.com` with your Apify token and add this Actor as a tool, for example `https://mcp.apify.com?tools=magenta_courser/youtube-video-tracker`. The agent then calls the tool `magenta_courser/youtube-video-tracker` with a minimal input such as:

```json
{ "startUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }] }
```

Every value is a flat field, numbers are numbers and missing values are `null`, so an agent can read `viewCount`, `likes`, `commentsCount` and the change fields directly from the result without post-processing.

### Pricing

Pay per event. The current prices are:

| Event | Price | When |
|---|---|---|
| Actor start | $0.00005 per run | Once per run at the default 256 MB memory (one event per GB, minimum one) |
| Video | $0.003 per row (FREE plan); $0.00285 BRONZE, $0.0027 SILVER, $0.0024 GOLD and up | One row with `status: "ok"`. Failed, not-found, private, blocked and unsupported links are not charged |

Example: tracking 100 campaign videos once a day costs 100 × $0.003 = $0.30 per run, about $9 per month on the FREE plan (30 runs; the start fee adds about $0.002 per month). With `outputMode: "changesOnly"` you pay only for videos whose numbers moved. Apify platform usage (compute units, proxy) is included in the event price and not billed separately for this Actor.

### FAQ

#### Do I need a YouTube account or cookies?

No. The Actor reads the public watch, Shorts and channel pages as a signed-out visitor. Private videos cannot be read and get a free `private` row.

#### Is this a drop-in replacement for streamers/youtube-scraper?

For the per-video columns, yes: the names, order and types match, so sheets, imports and code written for that Actor keep working. This Actor adds its own columns after them. Differences: `likes` is an exact integer here, and `subtitles`, `transcriptionUrl`, `aiVideoDescription`, `aiVideoSummary` and `collaborators` are always `null`. Playlist and hashtag links, search filters and video downloads are not supported.

#### What happens when YouTube blocks or withholds data?

YouTube sometimes answers a datacenter IP with a "sign in to confirm you're not a bot" player while the same page still shows the public title, counts, channel and description. The Actor does not sign in and does not try to get around that prompt. It retries on another IP, keeps using IPs that answered in full, and if the details are still withheld it builds a `detailLevel: "partial"` row from what the page shows: title, exact views, likes and comments, subscribers, channel, description and hashtags are present; the time of day in `date`, `duration` on direct links, `isPaidContent`, `isAgeRestricted` and category are missing. Once a video has been read in full, its publish time, duration and type are remembered in the history store and filled in on later `partial` rows. If a video cannot be read at all after the retries, it gets a free `blocked` or `error` row with a `statusMessage`. In our test of 30 video links on the datacenter proxy, 28 rows were `full` and 2 `partial`, none blocked.

#### How does the change tracking work and how fresh is the data?

Run 1 saves every video with `isFirstSeen: true`. From run 2 on, every row carries the difference to the previous run that used the same `historyStoreName`. Numbers are what a signed-out visitor sees at the moment of the run; there is no cache on our side. YouTube updates view counts with a delay and may correct them downward, so a small negative `viewChange` or `likeChange` is possible. If the history store cannot be opened or written, the run does not fail: it warns, treats every video as first seen, and reports `historyAvailable: false` in the run summary.

#### When am I not charged?

Rows with `status` `not_found`, `private`, `blocked` or `error` are free, and so are duplicate links (one row per video). With `outputMode: "changesOnly"`, unchanged videos are neither saved nor charged. If you set **Maximum cost per run** on the run, the Actor stops before exceeding it and marks the remaining videos with a free `error` row.

#### Can I track a whole channel instead of single videos?

Yes. Paste a channel link (`/@handle`, `/channel/UC...`) and set `maxResults`, `maxResultsShorts` and `maxResultStreams` for how many of the latest videos, Shorts and streams to read. Rows from a channel also carry `channelDescription`, `channelTotalVideos`, `channelTotalViews` and `channelJoinedDate`.

#### How long does a run take?

A video takes two requests (the page and the exact comment count); about 6 seconds per video at the default settings. The run stops sending requests after `maxRunMinutes` (default 60) or `maxRequests`.

#### Where do I see the run totals?

The key-value store record `RUN_SUMMARY` has the counts per status, charged rows, requests sent, partial rows, blocks, retries and the stop reason. It is not billed.

### 한국어 안내

유튜브 영상·Shorts·채널 링크를 넣으면 영상 1개당 1행으로 조회수, 정확한 좋아요 수, 댓글 수, 구독자 수와 지난 실행 대비 증감(`viewChange`, `likeChange`, `commentChange`, `subscriberChange`)이 나옵니다. 컬럼 이름·순서·타입이 streamers/youtube-scraper와 같아 기존 시트나 코드를 그대로 쓸 수 있고, 이 Actor가 추가한 컬럼은 그 뒤에 붙습니다. 로그인이나 쿠키 없이 공개 페이지만 읽으며, 비공개 영상·삭제된 링크·차단된 요청은 `status`와 안내 문구가 담긴 행으로 나오고 과금되지 않습니다. 가격은 정상 행(`status: "ok"`) 1건당 $0.003(FREE 플랜 기준, 상위 플랜 할인)과 실행당 시작 비용 $0.00005이며, 영상 100개를 매일 추적하면 월 약 $9입니다. 같은 링크 목록을 매일 같은 `historyStoreName`으로 돌려야 증감이 계산되고, 첫 실행에서는 증감 값이 `null`입니다. 자막, AI 요약, 재생목록·해시태그 링크, 검색 필터는 지원하지 않습니다.

### Notes

- Only public data is collected, no personal data beyond what YouTube shows on the public page, and no account is used. Checking that your use complies with YouTube's terms of service and the laws that apply to you is your responsibility.

### Need another field or feature?

Tell us in the **Issues** tab: a missing field, another input mode, a different output format. We aim to ship requested fields and features within a week, and we answer every issue.

# Actor input Schema

## `startUrls` (type: `array`):

YouTube links, one per line: a video (https://www.youtube.com/watch?v=dQw4w9WgXcQ or https://youtu.be/dQw4w9WgXcQ), a Short (https://www.youtube.com/shorts/<id>), or a channel (https://www.youtube.com/@Apify, /channel/UC..., or a channel tab such as /@Apify/shorts). A video link gives one row. A channel link gives its latest videos, limited by the fields below. Same format as streamers/youtube-scraper.

## `searchQueries` (type: `array`):

Optional. Each term returns the videos of the first YouTube results page (about 15 to 20 videos), limited by "maxResults". Search filters and deeper pages are not supported.

## `maxResults` (type: `integer`):

Latest regular videos to take from each channel link, and results to take from each search term. Direct video links are not affected. 0 = none.

## `maxResultsShorts` (type: `integer`):

Latest Shorts to take from each channel link. 0 = none.

## `maxResultStreams` (type: `integer`):

Latest live streams to take from each channel link. 0 = none.

## `columnFormat` (type: `string`):

"streamers" keeps the keys of streamers/youtube-scraper in the same order and types (title, id, url, viewCount, date, likes, commentsCount, numberOfSubscribers, ...) and appends the tracking fields after them, so existing sheets and integrations keep working. "tracker" uses this Actor's own names and adds previous\* values and durationSeconds.

## `compareWithLastRun` (type: `boolean`):

Add viewChange, likeChange, commentChange, subscriberChange, previousScrapedAt and isFirstSeen to each row, compared with the last run that used the same history store. The previous values are kept in a named key-value store in your account, so scheduled daily runs line up automatically.

## `outputMode` (type: `string`):

"changesOnly" saves (and charges) only videos seen for the first time or whose views, likes, comments or subscribers changed. The first run saves everything. Rows with status not_found, private, blocked or error are always saved (free). Needs "Compare with last run".

## `historyStoreName` (type: `string`):

Name of the key-value store that keeps the previous values. Use a different name per campaign or client to keep their histories apart. Lowercase letters, digits and hyphens.

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy by default; every attempt uses a new IP. This Actor works on datacenter proxies only: if the RESIDENTIAL group is selected it is ignored with a warning and the run uses the datacenter proxy (residential is slower and would only raise cost). Your own proxy URLs are used as given.

## `maxRequests` (type: `integer`):

Stops the run after this many HTTP requests (retries included; a video takes 2). Videos not reached get a free error row. 0 = unlimited.

## `maxRunMinutes` (type: `integer`):

Stops the run cleanly after this many minutes; videos not reached get a free error row.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@TED"
    }
  ],
  "maxResults": 10,
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "columnFormat": "streamers",
  "compareWithLastRun": true,
  "outputMode": "all",
  "historyStoreName": "youtube-video-history",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxRequests": 0,
  "maxRunMinutes": 60
}
```

# Actor output Schema

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

One row per video: status, title, channel, views, likes, comments, subscribers, and the change since the last run.

## `runSummary` (type: `string`):

Counts per status (ok, not_found, private, blocked, error), saved and charged rows, request, block and retry counters, stop reason. Not billed.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/@TED"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("magenta_courser/youtube-video-tracker").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 = {
    "startUrls": [{ "url": "https://www.youtube.com/@TED" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("magenta_courser/youtube-video-tracker").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 '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@TED"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call magenta_courser/youtube-video-tracker --silent --output-dataset

```

## MCP server setup

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

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/1JhZVGgwyJUIvTqtA/builds/TskDymreRVaXU0Dpu/openapi.json
