# YouTube Sponsorship & Brand-Safety Monitor (`fetchfinch/youtube-sponsorship-brand-safety-monitor`) Actor

Monitor YouTube videos, channels, and searches for sponsorship disclosures, brand and competitor mentions, and evidence-backed brand-safety risks.

- **URL**: https://apify.com/fetchfinch/youtube-sponsorship-brand-safety-monitor.md
- **Developed by:** [FetchFinch](https://apify.com/fetchfinch) (community)
- **Categories:** Social media, Lead generation, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 video analyzeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Sponsorship & Brand-Safety Monitor

Monitor YouTube videos, channels, and searches for sponsorship disclosures,
brand and competitor mentions, and configurable brand-safety risks. Every
finding includes the text that triggered it. Transcript findings also include a
clickable YouTube timestamp.

No YouTube API key, channel login, cookies, or external AI key is required.

### What it does

- Analyzes direct YouTube video URLs or IDs.
- Discovers recent uploads from channel URLs, channel IDs, and `@handles`.
- Discovers recent videos from YouTube search queries.
- Detects explicit sponsorship, advertising, affiliate, and promo-code signals.
- Finds configured brand, product, campaign, and competitor terms.
- Flags evidence for adult content, violence, drugs, gambling, profanity, and
  harassment, plus custom risk terms.
- Uses public caption tracks when available and falls back to title and
  description analysis when they are not.
- Persists seen video IDs under a `monitorId` for efficient scheduled runs.
- Sends alert records to an optional HTTP webhook.

The Actor does not estimate audience demographics or produce opaque AI claims.
It reports deterministic signals with inspectable evidence. These signals are
intended to prioritize human review, not make automatic compliance decisions.

### Quick start

Analyze one video:

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "brandTerms": ["Acme"],
  "competitorTerms": ["Example competitor"]
}
```

Monitor channels and a search:

```json
{
  "monitorId": "weekly-ai-sponsorships",
  "channelUrls": ["@OpenAI", "https://www.youtube.com/@GoogleDeepMind"],
  "searchQueries": ["AI productivity tools review"],
  "maxVideosPerSource": 10,
  "lookbackDays": 14,
  "brandTerms": ["OpenAI", "ChatGPT"],
  "competitorTerms": ["Claude", "Gemini"],
  "customRiskTerms": ["security breach", "data leak"],
  "minimumAlertRiskLevel": "medium"
}
```

### Monitoring behavior

Set a stable `monitorId` and run the Actor on an Apify Schedule. The Actor keeps
a list of seen video IDs in its named key-value store. Later runs skip those IDs
unless `forceReprocess` is enabled.

First-run options:

- `analyze_all`: analyze the current discovery window and save the video IDs.
- `establish_baseline`: save current video IDs without analysis. Future runs
  process only videos that were not present in the baseline.

Leave `monitorId` empty for stateless one-off runs.

Use a distinct monitor ID for each independent source and rules configuration.
Running the same monitor ID concurrently is not recommended because the last
state write wins.

### Evidence and risk scoring

The Actor searches title, description, and the selected caption track. Matching
is case-insensitive and bounded so a short term does not normally match inside a
larger word.

Each evidence object includes:

```json
{
  "source": "transcript",
  "matchedTerm": "sponsored by",
  "text": "...today's video is sponsored by Example...",
  "timestampSeconds": 42,
  "timestampUrl": "https://www.youtube.com/watch?v=VIDEO_ID&t=42s"
}
```

Risk levels are deterministic:

- `clear`: no configured risk signal was found.
- `low`: a low-severity or custom low-weight signal was found.
- `medium`: a medium-severity category was found.
- `high`: a high-severity category was found or multiple signals crossed the
  high-risk score threshold.

Context matters. A news report, documentary, or educational video may contain a
risk term without endorsing the subject. Always review the returned evidence.

### Transcript handling

The Actor selects caption tracks in the order given by
`preferredTranscriptLanguages`. If none match, it uses the first public track.
Both creator-provided and auto-generated captions are supported.

Full transcript text is not stored by default. Set `includeTranscript` to
`true` when the downstream workflow needs it. Evidence snippets and timestamps
are returned either way. Videos without public captions are analyzed using
their title and description.

### Output

Each successful dataset row has flat summary fields for filtering and full
nested detail:

```json
{
  "recordType": "videoAnalysis",
  "videoId": "VIDEO_ID",
  "title": "Example video",
  "videoUrl": "https://www.youtube.com/watch?v=VIDEO_ID",
  "channelName": "Example channel",
  "sponsorshipDetected": true,
  "sponsorshipConfidence": "high",
  "brandTermsFound": ["Acme"],
  "competitorTermsFound": ["Competitor"],
  "riskLevel": "medium",
  "riskScore": 25,
  "riskCategories": ["gambling"],
  "alertTriggered": true,
  "alertReasons": ["brand_safety_medium", "sponsorship_detected"],
  "video": {},
  "analysis": {}
}
```

Failures for individual sources or videos are written as uncharged `error`
records. A failure does not discard successful results from the same run.

The `OUTPUT` record in the default key-value store contains the run summary.

### Webhook alerts

Set `webhookUrl` to receive one JSON POST per alerting video. If
`webhookSecret` is provided, the Actor sends it as:

```text
Authorization: Bearer YOUR_SECRET
```

The secret input is encrypted by Apify. Webhook failures are retried and logged
but do not fail an otherwise successful Actor run.

### API

Run synchronously and return dataset rows:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/fetchfinch~youtube-sponsorship-brand-safety-monitor/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQueries": ["fintech app review"],
    "competitorTerms": ["Competitor One", "Competitor Two"],
    "maxVideosPerSource": 10
  }'
```

For scheduled monitoring, save the input as an Actor task, set a `monitorId`,
and attach an Apify Schedule to the task.

### Pricing event

The Actor emits one `video-analyzed` pay-per-event charge for each successful
video analysis row written to the dataset. Discovery errors and video errors are
not charged. When `outputMode` suppresses a successful result, that result is
not charged.

The launch price is $0.005 per successfully analyzed video. Platform usage is
billed separately under the pay-per-event-plus-usage pricing model.

### Operational notes

- YouTube requests use the open-source `youtubei.js` client and public YouTube
  responses. This is an unofficial integration and is not endorsed by YouTube.
- YouTube can change its internal API, response shapes, caption availability,
  or throttling behavior without notice.
- Keep concurrency modest. The default of three is intended to reduce bursts.
- Only analyze content you are permitted to process, and follow applicable
  laws, platform terms, and organizational policies.
- Risk findings are keyword-based review signals. They are not legal advice,
  content moderation decisions, or guarantees of brand suitability.

# Actor input Schema

## `videoUrls` (type: `array`):

Analyze specific YouTube videos. Direct videos are analyzed regardless of the lookback window.

## `channelUrls` (type: `array`):

Discover recent uploads from channel URLs, channel IDs, @handles, or plain handles.

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

Discover recent videos matching each query.

## `maxVideosPerSource` (type: `integer`):

Maximum videos discovered from each channel or search query.

## `maxTotalVideos` (type: `integer`):

Global safety limit after duplicate video IDs are merged.

## `lookbackDays` (type: `integer`):

Ignore older channel and search results. Direct video URLs bypass this filter.

## `regionCode` (type: `string`):

Two-letter country code used for search localization.

## `monitorId` (type: `string`):

Persistent state key. Leave empty for a stateless run that analyzes every discovered video.

## `firstRunMode` (type: `string`):

Analyze existing videos immediately, or store them as a baseline and wait for future uploads.

## `forceReprocess` (type: `boolean`):

Analyze video IDs already recorded under this monitor ID. Useful after changing risk rules.

## `analyzeTranscripts` (type: `boolean`):

Use the preferred caption track when one is publicly available. Metadata is still analyzed without captions.

## `preferredTranscriptLanguages` (type: `array`):

Language codes in priority order. The first available track is used as fallback.

## `includeTranscript` (type: `boolean`):

Store full transcript text in each dataset row. Disabled by default to keep results compact.

## `maxTranscriptCharacters` (type: `integer`):

Maximum caption text analyzed per video.

## `brandTerms` (type: `array`):

Brand, product, campaign, or spokesperson names to find. Matching is case-insensitive and term-bounded.

## `competitorTerms` (type: `array`):

Competitor brands or products that should trigger evidence and optional alerts.

## `enabledRiskCategories` (type: `array`):

Evidence-based term categories to evaluate. Findings are signals for review, not automated compliance decisions.

## `customRiskTerms` (type: `array`):

Organization-specific terms that should create a medium-risk finding.

## `minimumAlertRiskLevel` (type: `string`):

Lowest brand-safety level that triggers an alert.

## `alertOnSponsorship` (type: `boolean`):

Trigger an alert when sponsorship, paid-promotion, affiliate, or promo-code evidence is found.

## `alertOnBrandMentions` (type: `boolean`):

Trigger an alert when any configured brand term is found.

## `alertOnCompetitorMentions` (type: `boolean`):

Trigger an alert when any configured competitor term is found.

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

Store all analyzed videos, only videos with findings, or only alerting videos.

## `webhookUrl` (type: `string`):

Optional HTTP(S) endpoint. Each alerting video is sent as one JSON POST request.

## `webhookSecret` (type: `string`):

Optional encrypted token sent in the Authorization: Bearer header.

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

Concurrent video metadata requests. Lower this if YouTube starts throttling requests.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "channelUrls": [],
  "searchQueries": [],
  "maxVideosPerSource": 10,
  "maxTotalVideos": 50,
  "lookbackDays": 30,
  "regionCode": "US",
  "monitorId": "my-youtube-monitor",
  "firstRunMode": "analyze_all",
  "forceReprocess": false,
  "analyzeTranscripts": true,
  "preferredTranscriptLanguages": [
    "en"
  ],
  "includeTranscript": false,
  "maxTranscriptCharacters": 100000,
  "brandTerms": [],
  "competitorTerms": [],
  "enabledRiskCategories": [
    "adult",
    "violence",
    "drugs",
    "gambling",
    "profanity",
    "harassment"
  ],
  "customRiskTerms": [],
  "minimumAlertRiskLevel": "medium",
  "alertOnSponsorship": true,
  "alertOnBrandMentions": false,
  "alertOnCompetitorMentions": true,
  "outputMode": "all",
  "maxConcurrency": 3
}
```

# Actor output Schema

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

Evidence-backed sponsorship, mention, and brand-safety results.

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

Counts for discovery, analysis, alerts, skipped videos, and errors.

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "monitorId": "my-youtube-monitor",
    "preferredTranscriptLanguages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetchfinch/youtube-sponsorship-brand-safety-monitor").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 = {
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "monitorId": "my-youtube-monitor",
    "preferredTranscriptLanguages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("fetchfinch/youtube-sponsorship-brand-safety-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "monitorId": "my-youtube-monitor",
  "preferredTranscriptLanguages": [
    "en"
  ]
}' |
apify call fetchfinch/youtube-sponsorship-brand-safety-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fetchfinch/youtube-sponsorship-brand-safety-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EInlxY2F7az47hE8S/builds/cWHpenoTouNKJJhbe/openapi.json
