# YouTube Sponsor & Affiliate Link Extractor (`fanndev/youtube-sponsor-affiliate-extractor`) Actor

Find which YouTube creators are paid, and by whom. Reads full video descriptions and extracts affiliate links (Amazon Associates, Impact, ShareASale, Awin, Rakuten, Genius Link), promo codes, discount percentages, sponsor mentions and #ad disclosures. By video or by channel. No login.

- **URL**: https://apify.com/fanndev/youtube-sponsor-affiliate-extractor.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/fanndev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 results

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 Sponsor & Affiliate Link Extractor

Find out which YouTube creators are being paid, by whom, and with what offer.

Give it videos or channel handles. It reads each video's **full description** and
returns the affiliate links, promo codes, discount percentages, sponsor mentions
and `#ad`-style disclosures inside it — as structured fields, not as a wall of text.

No login, no cookies, no API key.

### What you get

```json
{
  "recordType": "VIDEO",
  "title": "I Tried All The Best (and Worst) Doorbell Cameras",
  "channelName": "Linus Tech Tips",
  "isMonetisedDescription": true,
  "monetisationSignals": ["affiliate-link", "promo-code", "disclosure-marker"],
  "affiliateNetworks": ["genius-link"],
  "affiliateLinkCount": 6,
  "promoCodes": ["LTT"],
  "discountPercents": [20],
  "disclosureMarkers": ["affiliate link", "affiliate links"],
  "sponsorMentions": [],
  "viewCount": 1284993,
  "captionLanguages": ["en", "es"]
}
```

`isMonetisedDescription` is never a bare verdict. Every record carries
`monetisationSignals` listing exactly which rules fired, so you can filter on the
signal *you* trust — say, only videos with a promo code — instead of on ours.

### Modes

| Mode | Input | What it does |
| --- | --- | --- |
| `video` | `videos` — IDs, `watch?v=`, `youtu.be/`, `/shorts/`, `/live/`, `/embed/` | One record per video |
| `channel` | `channels` — `@handle` or channel URL | Takes each channel's newest `videosPerChannel` uploads, then as above |
| `reference` | — | Probes the surface and reports what it actually yielded. Run this first if a result looks wrong |

### How links are classified

This is where most description scrapers get it wrong, so the buckets are narrow
and separate:

| Kind | Meaning | Counts as sponsorship? |
| --- | --- | --- |
| `affiliate` | A real commission network: Amazon Associates, Impact, ShareASale, Awin, CJ, Rakuten, ClickBank, Genius Link, Partnerize, Skimlinks, MagicLinks, ShopMy, LTK | **Yes** |
| `sponsor-landing` | Hosts that routinely run creator campaigns (Squarespace, NordVPN, Brilliant, HelloFresh, AG1…) | **Yes** |
| `smart-link` | The creator's *own* release routing: Linkfire `lnk.to`, `smarturl.it`, Linktree, Beacons | No |
| `shortened` | `bit.ly`, `tinyurl`, `cutt.ly` — destination unknown until resolved | No, flagged for follow-up |
| `creator-platform` | Patreon, Ko-fi, merch stores | No |
| `social`, `tracked`, `other` | Everything else | No |

An Amazon link is only `affiliate` when it actually carries an associate tag
(`tag=`, `ascsubtag`, `linkcode`) — the tag is returned in `amazonTag`.

**Why this matters:** an earlier build of this Actor treated `lnk.to` and
`smarturl.it` as affiliate networks. It then reported Rick Astley, PSY and Luis
Fonsi as running sponsored content. An agency filtering on "monetised" would have
received three music videos and zero brand deals.

### The one thing to know before you run it

YouTube sometimes serves a **reduced watch page**: a real 1.1–1.3 MB page,
HTTP 200, with the player response simply missing. Measured over three attempts
per video on 2026-09-20, hit rates ranged from 3/3 down to 0/3 on the *same*
video. Neither consent cookies, `bpctr`/`has_verified`, nor `m.youtube.com`
improved it.

So this Actor **retries each video up to six times, rotating TLS profile**, and
only then emits a `REDUCED` record. That distinction is the point:

- `recordType: "VIDEO"` — parsed; `_attempts` tells you how hard it was.
- `recordType: "REDUCED"` — YouTube would not serve us the payload. **This is not
  proof the video has no description.** Retry later or use a proxy.
- `recordType: "ERROR"` — a genuine failure (no such video, challenge page).

If many records come back `REDUCED`, that is an IP-shaped symptom — switch on
`proxyConfiguration`.

### What this Actor does not do

**It does not read transcripts.** The description is the surface; the caption
track is not. `captionLanguages` tells you which subtitle tracks exist, because
the language list *is* public — but every signed caption URL answers HTTP 200
with a **zero-byte body**, and the InnerTube player endpoint answers 400
(ANDROID/IOS) or `UNPLAYABLE` (WEB). Rather than ship a transcript field that is
empty most of the time, this Actor reports what it can actually get. Details and
the full list of variants tested are in [`CRAWLING_METHOD.md`](CRAWLING_METHOD.md).

### Cost

One request per video, plus one per channel in `channel` mode — times however
many retries the reduced page forces. A channel sweep of 15 videos is typically
16–25 requests.

### Input example

```json
{
  "mode": "channel",
  "channels": ["@mkbhd", "@LinusTechTips"],
  "videosPerChannel": 20,
  "concurrency": 4
}
```

# Actor input Schema

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

video = the URLs/IDs you list. channel = the newest uploads of each handle. reference = probe the surface and report what it yielded (run this first if a result looks wrong).

## `videos` (type: `array`):

Video IDs or any YouTube link: watch?v=, youtu.be/, /shorts/, /live/, /embed/.

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

Channel handles such as @mkbhd, or full channel URLs.

## `videosPerChannel` (type: `integer`):

How many of each channel's newest uploads to inspect. One request per video.

## `concurrency` (type: `integer`):

Parallel watch-page fetches. Keep this modest: the page is 1.1-1.3 MB and is often served without its payload, so the Actor already retries each video several times.

## `tlsProfile` (type: `string`):

Optional. Tried first, then the rest of the ladder. All four answered 200 during recon; this is a tuning knob, not a requirement.

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

Optional. Useful when many videos come back as REDUCED - that is an IP-shaped symptom, so a different exit IP often fixes it.

## Actor input object example

```json
{
  "mode": "video",
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "channels": [
    "@mkbhd"
  ],
  "videosPerChannel": 15,
  "concurrency": 4,
  "tlsProfile": "chrome124"
}
```

# Actor output Schema

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

Every video, reduced-page and error record produced by this run.

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "channels": [
        "@mkbhd"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fanndev/youtube-sponsor-affiliate-extractor").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 = {
    "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "channels": ["@mkbhd"],
}

# Run the Actor and wait for it to finish
run = client.actor("fanndev/youtube-sponsor-affiliate-extractor").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "channels": [
    "@mkbhd"
  ]
}' |
apify call fanndev/youtube-sponsor-affiliate-extractor --silent --output-dataset

```

## MCP server setup

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

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/T9cAK1lbB4xGdtHFA/builds/rqyjfhzp6IHSl9BFf/openapi.json
