# YouTube Transcript Scraper: Find Every Moment a Word Is Said (`h1018y/anvil-youtube-transcript-scraper`) Actor

Scrapes YouTube transcripts for single videos or whole channels and finds every moment a word or phrase is said, with a link to that exact second and the lines around it. Full transcripts when no keyword is given; no API key.

- **URL**: https://apify.com/h1018y/anvil-youtube-transcript-scraper.md
- **Developed by:** [ANVIL Tools](https://apify.com/h1018y) (community)
- **Categories:** Videos, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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 Transcript Scraper: Find Every Moment a Word Is Said

**YouTube Transcript Scraper** - Paste videos or a whole channel, type a word, and get a link to every second it's spoken.

### What does YouTube Transcript Scraper do?

One row per mention with a youtu.be jump link to that exact second plus the lines around it, across whole channels - the popular transcript scrapers just dump the full text and leave the searching to you.

- A clickable link to the exact second each word or phrase is said
- Search the latest videos of a whole channel in one run
- The caption lines before and after each mention, so you see what was meant
- Full transcripts when you leave the keywords empty
- Creator captions first, auto-generated ones as a fallback, in the language you pick

### Why this YouTube Transcript Scraper?

Many break when YouTube changes its caption format and stop being fixed. This YouTube Transcript Scraper checks every run and tells you plainly when a page could not be read, instead of returning empty or wrong rows.

### How to use YouTube Transcript Scraper

1. Press **Start** - the form already holds an example that works.
2. Put in your own input (see the fields on the Input tab).
3. Run it once, or put it on an **Apify Schedule** to get fresh rows every day.
4. Download the results as JSON, CSV or Excel, or send them to Google Sheets, Zapier, Make, the Apify API or an AI agent (Apify MCP server).

#### Input example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "keywords": [
    "give you up"
  ],
  "language": "en",
  "contextLines": 1,
  "maxVideosPerChannel": 10,
  "maxItems": 3,
  "useApifyProxy": true
}
```

#### Output example (a real run)

```json
[
  {
    "videoId": "dQw4w9WgXcQ",
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "channel": "Rick Astley",
    "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "language": "en",
    "captions": "creator",
    "keyword": "give you up",
    "start": 43,
    "timestamp": "0:43",
    "jumpUrl": "https://youtu.be/dQw4w9WgXcQ?t=43",
    "text": "♪ Never gonna give you up ♪",
    "context": "♪ Gotta make you understand ♪ ♪ Never gonna give you up ♪ ♪ Never gonna let you down ♪"
  },
  {
    "videoId": "dQw4w9WgXcQ",
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "channel": "Rick Astley",
    "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "language": "en",
    "captions": "creator",
    "keyword": "give you up",
    "start": 85,
    "timestamp": "1:25",
    "jumpUrl": "https://youtu.be/dQw4w9WgXcQ?t=85",
    "text": "♪ Never gonna give you up ♪",
    "context": "♪ Don't tell me you're too blind to see ♪ ♪ Never gonna give you up ♪ ♪ Never gonna let you down ♪"
  }
]
```

One flat row per result.

### How much does YouTube Transcript Scraper cost?

You pay only per result (pay per event) - no monthly fee, no minimum, and the price per result is lower on Apify's Bronze, Silver and Gold plans. The exact price is on the **Pricing** tab. Apify's free plan credit is enough to try it on real input.

### Also searched as

- youtube transcript search
- find word in youtube video
- youtube captions scraper
- youtube transcript api
- youtube timestamps

### FAQ

**Does YouTube Transcript Scraper need a login, cookies or an API key?** No. It reads public pages only.

**Can I run YouTube Transcript Scraper on a schedule?** Yes - with Apify Schedules; each run returns fresh rows.

**Can I call it from Python, JavaScript or an AI agent?** Yes - through the Apify API, the Apify client libraries or the Apify MCP server.

**Is it legal?** It collects only data anyone can see without logging in. You are responsible for using it within the source site's terms and data protection law (GDPR, CCPA).

**What if the site blocks a request?** The run retries from a fresh connection and, if it still cannot read the page, stops with a clear message - never with made-up rows.

Data source: [www.youtube.com](https://www.youtube.com)

### More tools from this developer

- [Tweet Scraper: Tweet Details by URL, No Login or Cookies](https://apify.com/h1018y/anvil-tweet-scraper)
- [YouTube Thumbnail Downloader: Bulk, Every Size & Titles](https://apify.com/h1018y/anvil-youtube-thumbnail-downloader)
- [ML Conference Finder: NeurIPS, ICLR & ICML Alternatives](https://apify.com/h1018y/anvil-ml-conference-finder)
- [Facebook Ads Library Scraper: Only New Ads & Days Running](https://apify.com/h1018y/anvil-facebook-ads-library-scraper)
- [Reddit Scraper: Keyword Alerts for New Posts & Comments](https://apify.com/h1018y/anvil-reddit-scraper)
- [Twitter Scraper: New Tweets From Any X Account, No Login](https://apify.com/h1018y/anvil-twitter-scraper)

# Actor input Schema

## `urls` (type: `array`):

YouTube video links, video IDs, or channel links (@handle or /channel/UC...). For a channel the latest videos are searched.

## `keywords` (type: `array`):

Every moment one of these is said becomes a row with a clickable timestamp. Leave empty to get the full transcript of each video instead.

## `language` (type: `string`):

Two-letter code like en, es, ko. Creator captions are preferred, auto-generated ones are used when that's all there is.

## `contextLines` (type: `integer`):

How many caption lines before and after each mention to include.

## `maxVideosPerChannel` (type: `integer`):

How many of a channel's newest videos to search.

## `maxItems` (type: `integer`):

Stop after this many rows.

## `useApifyProxy` (type: `boolean`):

Recommended: YouTube limits plain data-center traffic.

## `proxyGroups` (type: `array`):

Optional, e.g. RESIDENTIAL.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "keywords": [
    "give you up"
  ],
  "language": "en",
  "contextLines": 1,
  "maxVideosPerChannel": 10,
  "maxItems": 3,
  "useApifyProxy": true
}
```

# Actor output Schema

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

All result rows (open as table, JSON, CSV or Excel).

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "keywords": [
        "give you up"
    ],
    "language": "en",
    "maxItems": 3,
    "useApifyProxy": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("h1018y/anvil-youtube-transcript-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 = {
    "urls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "keywords": ["give you up"],
    "language": "en",
    "maxItems": 3,
    "useApifyProxy": True,
}

# Run the Actor and wait for it to finish
run = client.actor("h1018y/anvil-youtube-transcript-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 '{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "keywords": [
    "give you up"
  ],
  "language": "en",
  "maxItems": 3,
  "useApifyProxy": true
}' |
apify call h1018y/anvil-youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,h1018y/anvil-youtube-transcript-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/dsRiiRF7eFIBA5JRX/builds/BxH7TSCC1gSGtiqZZ/openapi.json
