# YouTube Most Replayed Clip Finder (Heatmap to Clips) (`cryptoretirement/youtube-most-replayed-clip-finder`) Actor

Turns YouTube's 'most replayed' heatmap into ranked clip segments (start, end, score, suggested title) for Shorts, Reels and highlight reels. Also returns the raw 100-point heatmap. No API key.

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

## Pricing

from $20.00 / 1,000 video with clips

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 Most Replayed Clip Finder

Give it YouTube video URLs and it returns the **moments viewers replay most, already cut into clip segments**: start and end times, a replay score, a suggested title and a timestamped link, ranked best first. It also returns the **raw 100-point "most replayed" heatmap** so you can draw your own curve. No API key, no login.

Built for people who turn long videos into Shorts, Reels and TikToks, for highlight reels, for chaptering, and for AI agents that need to know *where* the good part of a video is before transcribing or cutting it.

### Output

One row per video:

```json
{
  "videoId": "Y8efWZ2M1y8",
  "title": "How To Trade TRENDLINES (Full Guide)",
  "channel": "Tori Trades",
  "lengthSeconds": 2725,
  "viewCount": 561411,
  "hasHeatmap": true,
  "peakSeconds": 2180,
  "clipCount": 5,
  "clips": [
    { "rank": 1, "start": 2137.3, "end": 2199.7, "durationSeconds": 62.4, "startLabel": "35:39", "endLabel": "36:41",
      "peakIntensity": 1.0, "meanIntensity": 0.828, "score": 0.828,
      "suggestedTitle": "How To Trade TRENDLINES (Full Guide) — most replayed #1 (35:39–36:41)",
      "clipUrl": "https://www.youtube.com/watch?v=Y8efWZ2M1y8&t=2137s" }
  ],
  "heatmap": [ { "start": 0, "duration": 27.3, "intensity": 0.31 }, "… 100 points" ]
}
```

`intensity` is YouTube's own normalised replay intensity (1.0 = the single most replayed moment of the video).

### Input

| Field | Default | What it does |
|---|---|---|
| `videos` | – | URLs (`watch?v=`, `youtu.be/`, Shorts, embeds) or bare 11-character IDs |
| `maxClipsPerVideo` | `8` | Clips returned per video, best first |
| `minIntensity` | `0.5` | A heatmap point joins a clip when its intensity is at least this. Lower it (0.3) for flat videos, raise it (0.7) for just the spikes |
| `minClipSeconds` / `maxClipSeconds` | `8` / `60` | Short peaks are stretched to the minimum; long peaks are split into chunks of the maximum (so clips fit a Short) |
| `padSeconds` | `2` | Padding before and after each clip so cuts don't land mid-word |
| `includeHeatmap` | `true` | Include the raw curve |
| `proxy` | off | Apify Proxy, if YouTube blocks direct requests from the platform |

### When there is no heatmap

YouTube only shows a "most replayed" graph for videos with enough views (roughly 50k+ and not every video even then). Those rows come back with `hasHeatmap: false`, `clips: []` and a note, so a batch never fails because of one quiet video.

### How clips are scored

Consecutive heatmap points above `minIntensity` form a peak. Each peak (or chunk of a long peak) is scored by `peakIntensity × meanIntensity`, so a tall, sustained peak outranks a brief spike. `suggestedTitle` is the video title plus the clip's rank and time range, a placeholder for your own.

### Limits

- Reads the public watch page. If YouTube changes its page structure the Actor is updated; if it rate-limits the platform, switch `proxy` on.
- Heatmap data is YouTube's aggregate of viewer behaviour; it says where people rewatch, not why.

### Cost

Pay per event, no subscription. You pay only for the videos a run checks.

| Event | Price |
|---|---|
| Run start, once per run | $0.001 |
| Video with a heatmap, clips returned | $0.02 |
| Video without a heatmap | $0.002 |

Ten videos that have heatmaps cost about 20 cents. A video with no heatmap costs a fifth of a cent.

### Run it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/cryptoretirement~youtube-most-replayed-clip-finder/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videos":["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],"maxClipsPerVideo":5}'
```

The response is the dataset as a JSON array. The API menu on this page has ready-made snippets for JavaScript, Python and MCP clients.

### More Actors from this developer

- [Crypto Perp Funding Rate Scanner](https://apify.com/cryptoretirement/crypto-perp-funding-rate-scanner): funding rates, annualised yield and cross-exchange spreads on 5 exchanges.
- [Crypto Exchange New Listing Announcements](https://apify.com/cryptoretirement/crypto-exchange-new-listings): new coin and perpetual listings from 6 exchanges, with an alert flag.
- [Crypto Signal Scanner](https://apify.com/cryptoretirement/crypto-perp-technical-signal-scanner): Donchian breakouts, golden and death crosses and Supertrend flips on the top Bybit perpetuals.
- [Crypto Session Box Levels & Liquidity Sweep Detector](https://apify.com/cryptoretirement/crypto-session-box-liquidity-sweep-detector): prior-day and session boxes, wick setups and liquidity sweeps.
- [Forex News Filter & Economic Calendar](https://apify.com/cryptoretirement/forex-news-filter-economic-calendar): this week's economic events and a high-impact news window check for bots.
- [Solana Token Rug Check + Coin Score](https://apify.com/cryptoretirement/solana-token-rug-check-and-score): rug gates, a honeypot sell test and a 0-100 score for any Solana token.
- [DEX Pool Health Score](https://apify.com/cryptoretirement/dex-pool-health-score): health and rug-risk score for any liquidity pool on 100+ networks.

# Actor input Schema

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

YouTube video URLs or 11-character video IDs. The video needs enough views for YouTube to show a 'most replayed' graph (roughly 50k+ views); videos without one are returned with hasHeatmap=false and no charge for clips.

## `maxClipsPerVideo` (type: `integer`):

Ranked by replay intensity.

## `minIntensity` (type: `string`):

A heatmap point joins a clip when its normalised replay intensity is at least this. 0.5 = the busier half of the video; lower it for flatter videos.

## `minClipSeconds` (type: `integer`):

Shorter peaks are dropped.

## `maxClipSeconds` (type: `integer`):

Longer peaks are split into chunks of this length.

## `padSeconds` (type: `integer`):

Seconds added before and after each clip so cuts don't start mid-word.

## `includeHeatmap` (type: `boolean`):

Adds the full 100-point most-replayed curve to each video row.

## `proxy` (type: `object`):

Use Apify Proxy if YouTube blocks direct requests from the platform.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxClipsPerVideo": 8,
  "minIntensity": "0.5",
  "minClipSeconds": 8,
  "maxClipSeconds": 60,
  "padSeconds": 2,
  "includeHeatmap": true,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One item per video: videoId, title, channel, lengthSeconds, hasHeatmap, clipCount, peakSeconds, ranked clips (start, end, score, suggested title, timestamped link) and the raw heatmap when requested.

# 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"
    ],
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cryptoretirement/youtube-most-replayed-clip-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 = {
    "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("cryptoretirement/youtube-most-replayed-clip-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 '{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call cryptoretirement/youtube-most-replayed-clip-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cryptoretirement/youtube-most-replayed-clip-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/lEmUOMDQcSBhZkkAY/builds/1XBTAw7JZP9Y9GBnr/openapi.json
