# YouTube Outlier Video Finder (`afkdigital/youtube-outlier-video-finder`) Actor

Find potential YouTube outliers in your own video snapshots. Compare views with age-matched videos from the same channel, see views per subscriber, and export explainable results. Bring a rights-cleared JSON file.

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

## Pricing

$2.00 / 1,000 unique analyzed videos

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 Outlier Video Finder

Compare each video with the same channel's videos observed at similar ages. A 4.0 score means four times the cohort median. Use the separate views-per-subscriber ratio to read this result in channel context. These are snapshot comparisons. Neither metric measures actual daily growth or explains why a title worked.

### Quick start

Run with {} for a labeled synthetic four-video example. For your own data, send the parsed contents of a private JSON file as {"videosFile":{"rows":\[...]},"sourceRightsConfirmed":true}. To ingest from a live private Apify store, fetch GET /v2/key-value-stores/{storeId}/records/{key} with your workflow credential, then pass the parsed array as videosFile.rows. The Actor needs access only to its own run storage. Use only independently obtained data you have permission to analyze. Exclude YouTube API-derived files. channelIds filters rows in the file. Direct channel discovery is unavailable in this release. No YouTube key is needed or accepted.

Example row:

```json
{"channelId":"demo-channel","videoId":"demo-0","title":"Can 3 lights change a portrait?","publishedAt":"2026-01-01T12:00:00Z","observedAt":"2026-01-05T12:00:00Z","viewCount":4000,"subscriberCount":2000,"contentType":"long","likeCount":40}
```

Supply owner-known short, long or live type. Other or absent labels become unknown. Keep subscriber counts contemporaneous with the video observation. Set hiddenSubscriberCount to true when hidden. Optional counters can be null. Times require explicit offsets. Use one consistent source and measurement definition per file.

### Comparison and bounds

Retain the latest observation per video ID. Reject conflicting identities. Target publication dates are inclusive. Select up to maxVideos targets by newest publication, then ID. Peers can fall outside target publication dates. Both target and peers must meet minVideoAgeHours. For target age A hours, accept peer ages within min(24 × comparisonWindowDays, 0.20 × A) hours. Exclude the target, other channels and other formats. Unknown formats have no cohort. channelBaseline is the median peer view count when minComparableVideos is met. outlierScore is views divided by a positive baseline. Views per subscriber, likes per view and comments per view are separate fractions. Missing counters and zero denominators yield null. Title features count Unicode characters and check for a digit or literal question mark. Coverage depends on supplied videos, and small cohorts have uncertainty.

Defaults: age 24 hours, window 7 days, minimum 3 peers, output 100 videos. Caps: 5,000 input records, 8 MB JSON file, 1,000 output rows, storage reads up to 100 result IDs per page, 50 rows per write, 20 s per request, 180 s platform timeout. Each run snapshots one input record. Keep that record immutable during a run and retries. Delete customer inputs and results according to your retention agreement. The Actor creates no independent archives.

### Billing

The intended PPE event is the platform's apify-default-dataset-item: one unique analyzed target written in this run, including ordinary scores and null scores. Peers used only for comparison incur no event. A separate new run processes data again. Default example rows also count under paid pricing.

### Automation examples

Use the Apify token in your workflow credential vault. First read your file using the workflow credential and bind the parsed JSON array to videosFile.rows, then submit that input:

- n8n: HTTP Request POST https://api.apify.com/v2/acts/afkdigital~youtube-outlier-video-finder/runs with bearer authentication. Poll GET /v2/actor-runs/{runId} until SUCCEEDED, then GET /v2/datasets/{defaultDatasetId}/items?limit=100\&offset=0. Stop on a terminal failure. Increment offset by 100 until a short page.
- Make: Run an Actor with the file reference and Wait for finish enabled. Pass the returned defaultDatasetId to Get Dataset Items. Filter bundles on a non-null outlierScore >= 2 and map videoId, comparableVideoCount and viewsPerSubscriber to a sheet.
- Clay: For a small batch use an HTTP API enrichment to POST https://api.apify.com/v2/acts/afkdigital~youtube-outlier-video-finder/run-sync-get-dataset-items with the JSON input above. Map array entries to video rows keyed by videoId. Trigger once per file, and use asynchronous runs for larger batches.

### YouTube API scope

This release spends zero YouTube quota. A future approved adapter using channels.list, playlistItems.list and videos.list would spend one unit per call including additional pages. Ordinary non-authorized API data requires refresh or deletion within 30 days. Additional custom metrics and longer statistical storage depend on YouTube approval and applicable terms. The accepted amendment can allow certain statistics up to 36 calendar months. Titles still require refresh or deletion within 30 days.
https://developers.google.com/youtube/terms/derived-metrics-policy
https://developers.google.com/youtube/terms/developer-policies
https://developers.google.com/youtube/v3/determine_quota_cost

# Actor input Schema

## `videosFile` (type: `object`):

Provide {"rows":\[...]} containing the parsed JSON file. For private storage, fetch the file using your workflow credential first.

## `sourceRightsConfirmed` (type: `boolean`):

I have rights to analyze this non-API-origin file.

## `channelIds` (type: `array`):

Optional channel allowlist within the supplied file.

## `publishedAfter` (type: `string`):

Inclusive publication timestamp with timezone.

## `publishedBefore` (type: `string`):

Inclusive publication timestamp with timezone.

## `minVideoAgeHours` (type: `integer`):

See README for cohort and output limits.

## `comparisonWindowDays` (type: `integer`):

See README for cohort and output limits.

## `minComparableVideos` (type: `integer`):

See README for cohort and output limits.

## `maxVideos` (type: `integer`):

See README for cohort and output limits.

## `contentTypeFilter` (type: `string`):

Use source-supplied content type.

## Actor input object example

```json
{
  "sourceRightsConfirmed": false,
  "minVideoAgeHours": 24,
  "comparisonWindowDays": 7,
  "minComparableVideos": 3,
  "maxVideos": 100,
  "contentTypeFilter": "all"
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/youtube-outlier-video-finder").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/youtube-outlier-video-finder").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 '{}' |
apify call afkdigital/youtube-outlier-video-finder --silent --output-dataset

```

## MCP server setup

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

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/Jobcrodc5Dct4rl2o/builds/axOm3eVWPUQa2L9q8/openapi.json
