# YouTube SponsorBlock Segments Scraper (`crawlerbros/youtube-sponsorblock-scraper`) Actor

Get community-reported SponsorBlock segments for any YouTube video: sponsor reads, intros, outros, self-promos, filler, highlights, and more, with start/end times and votes.

- **URL**: https://apify.com/crawlerbros/youtube-sponsorblock-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 SponsorBlock Segments Scraper

Get community-reported [SponsorBlock](https://sponsor.ajay.app/) segments for any public YouTube video: sponsor reads, intros, outros, self-promotions, filler tangents, highlights, and more — with exact start/end times, category, action type, and community votes.

No cookies, no YouTube login, no proxy, and no video download. The actor reads the public SponsorBlock database directly.

### What this actor does

- **Video lookup:** pass any YouTube video URL or ID
- **All segment categories:** sponsor, intro, outro, self-promo, interaction, music, preview, and more
- **Timing data:** start, end, and duration for every segment
- **Bulk input:** multiple videos per run
- **Empty fields are omitted** — records only contain values that are actually populated.

### Output

One dataset row per segment, plus a truthful status row when a video has no segments or the input is invalid.

| Field | Example | Description |
|---|---|---|
| videoId | `"aQp-iM0bCs4"` | YouTube video ID |
| videoUrl | `"https://www.youtube.com/watch?v=aQp-iM0bCs4"` | Canonical watch URL |
| segmentId | `"b772d4b7..."` | SponsorBlock segment UUID |
| category | `"sponsor"` | SponsorBlock category key |
| categoryName | `"Sponsor"` | Human-readable category |
| actionType | `"skip"` | Skip, mute, full video, or highlight/POI |
| startTime | `0` | Segment start in seconds |
| endTime | `31.861` | Segment end in seconds |
| durationSeconds | `31.861` | Segment length in seconds |
| videoDurationSeconds | `361` | Full video length in seconds |
| votes | `0` | Community votes for the segment |
| locked | `false` | Whether the segment is locked from edits |
| description | `"..."` | Optional community note |
| scrapedAt | `"2026-10-02T..."` | Capture timestamp |

Status rows:

| status | Meaning |
|---|---|
| `no_segments` | The video is public and readable but has no SponsorBlock segments. |
| `invalid_video` | The input was not a YouTube video URL or ID. |
| `failed` | SponsorBlock did not return a usable response after retries. |

Every field is omitted when YouTube/SponsorBlock does not provide a value — there are no null placeholders.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array | — (required) | YouTube video URLs or 11-character video IDs. Watch, `youtu.be`, Shorts, live, and embed links are accepted. |
| `categories` | array (dropdown) | all | Filter to specific SponsorBlock categories: Sponsor, Unpaid/Self Promotion, Interaction Reminder, Intro, Outro, Preview/Recap, Non-Music Section, Filler Tangent, Highlight, Exclusive Access, Chapter. |
| `actionTypes` | array (dropdown) | all | Filter to segments whose action is Skip, Mute, Full video, or Highlight/POI. |
| `minVotes` | integer | `0` | Drop segments with fewer community votes than this. `0` keeps every segment; higher values keep only well-confirmed segments. |
| `includeDescriptions` | boolean | `true` | Include the community-written note attached to a segment when one exists. |

#### Example input

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=aQp-iM0bCs4"],
    "categories": ["sponsor", "intro"],
    "minVotes": 0,
    "includeDescriptions": true
}
```

### Examples

#### Example: one video

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

#### Example: multiple videos with all categories

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=9bZkp7q19f0"
  ]
}
```

### Use cases

- **Skip sponsor reads automatically** — build player overlays or cut lists from exact segment times.
- **Transcript cleanup** — remove sponsor/intro/outro text before analysis; pairs with the YouTube Transcript Scraper.
- **Sponsor-load analytics** — measure how much of a channel's runtime is sponsored content.
- **Dataset enrichment** — join segments onto video metadata by `videoId`.

### FAQ

**What is SponsorBlock?**

SponsorBlock is a public crowdsourced database of timestamped segments in YouTube videos (sponsors, intros, outros, and more).

**Do I need an API key?**

No. The actor reads SponsorBlock's public API.

**What happens when a video has no segments?**

The row is returned with an empty segment list omitted; a status message explains that no segments exist for the video.

**How fresh is the data?**

Segments are community-submitted and reflect the SponsorBlock database at run time.

### YouTube Scraper Suite

This actor is part of a complete YouTube data extraction toolkit. Explore the full suite:

| Actor | Description |
|-------|-------------|
| [YouTube Ads Scraper](https://apify.com/crawlerbros/youtube-ads-scraper) | Google Ads Transparency ads by advertiser, keyword, and country |
| [YouTube Channel Profile Scraper](https://apify.com/crawlerbros/youtube-channel-profile-scraper) | Full channel profiles with About data, playlists, and community posts |
| [YouTube Channel Scraper](https://apify.com/crawlerbros/youtube-channel-scraper) | Channel metadata, subscriber counts, and full video catalogs |
| [YouTube Channel Scraper Fast](https://apify.com/crawlerbros/youtube-channel-scraper-fast) | Streamlined channel scraper for high-volume and speed-sensitive workflows |
| [YouTube Comment Scraper](https://apify.com/crawlerbros/youtube-comment-scraper) | Comments, replies, likes, author info, and pinned/hearted status |
| [YouTube Community Posts Scraper](https://apify.com/crawlerbros/youtube-community-posts-scraper) | Community posts with images, polls, video attachments, and comments |
| [YouTube Email Scraper](https://apify.com/crawlerbros/youtube-email-scraper) | Creator contact emails from channel pages, Instagram, TikTok, and Linktree |
| [YouTube Hashtag Scraper](https://apify.com/crawlerbros/youtube-hashtag-scraper) | Videos and Shorts tagged with specific hashtags |
| [YouTube Live Chat Scraper](https://apify.com/crawlerbros/youtube-live-chat-scraper) | Live and replay chat messages with author and timing metadata |
| [YouTube Playlist Scraper](https://apify.com/crawlerbros/youtube-playlist-scraper) | Videos from playlists plus channel playlist discovery |
| [YouTube Search Scraper](https://apify.com/crawlerbros/youtube-search-scraper) | Search results including videos, channels, and playlists |
| [YouTube Search Suggestions Scraper](https://apify.com/crawlerbros/youtube-search-suggestions-scraper) | Autocomplete keyword suggestions with ready search URLs |
| [YouTube Shorts Scraper](https://apify.com/crawlerbros/youtube-shorts-scraper) | Shorts from channels or hashtags with full view and like metadata |
| [YouTube Transcript Scraper](https://apify.com/crawlerbros/youtube-transcript-scraper) | Timed transcripts and captions with optional Whisper AI fallback |
| [YouTube Trending Scraper](https://apify.com/crawlerbros/youtube-trending-scraper) | Ranked trending videos by category — Gaming, Music, News, Movies |
| [YouTube Video Details Scraper](https://apify.com/crawlerbros/youtube-video-details-scraper) | Comprehensive video metadata, chapters, endscreen, captions, and comments |
| [YouTube Video Downloader](https://apify.com/crawlerbros/youtube-video-downloader) | Download videos, playlists, and channels in any quality with metadata |

# Actor input Schema

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

YouTube video URLs or 11-character video IDs. Accepts watch, youtu.be, Shorts, live, and embed links.

## `categories` (type: `array`):

Only return these SponsorBlock categories. Leave empty to include every category.

## `actionTypes` (type: `array`):

Only return segments whose action matches one of these. Leave empty to include every action.

## `minVotes` (type: `integer`):

Skip segments with fewer community votes than this. Use 0 to keep every segment, or a higher value to keep only well-confirmed segments.

## `includeDescriptions` (type: `boolean`):

Include the community-written note attached to a segment when one exists.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aQp-iM0bCs4"
  ],
  "categories": [
    "sponsor",
    "intro"
  ],
  "actionTypes": [],
  "minVotes": 0,
  "includeDescriptions": true
}
```

# Actor output Schema

## `segments` (type: `string`):

Dataset containing all scraped sponsorblock segment rows or per-video status rows.

# 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=aQp-iM0bCs4"
    ],
    "categories": [
        "sponsor",
        "intro"
    ],
    "minVotes": 0,
    "includeDescriptions": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/youtube-sponsorblock-scraper").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=aQp-iM0bCs4"],
    "categories": [
        "sponsor",
        "intro",
    ],
    "minVotes": 0,
    "includeDescriptions": True,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/youtube-sponsorblock-scraper").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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aQp-iM0bCs4"
  ],
  "categories": [
    "sponsor",
    "intro"
  ],
  "minVotes": 0,
  "includeDescriptions": true
}' |
apify call crawlerbros/youtube-sponsorblock-scraper --silent --output-dataset

```

## MCP server setup

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

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/Ntu4Em2saOHzeNYrz/builds/jv2LFaQTgrJtZovwt/openapi.json
