# YouTube Scraper (`lurkapi-com/youtube-scraper`) Actor

Scrape YouTube search results, channel videos or single videos: titles, views, likes, length, publish dates, descriptions and channels. $0.50 per 1,000 videos.

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

## Pricing

$0.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.

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 Scraper

Get YouTube videos from keyword searches or whole channels, or look up single videos by URL. Each result comes with its title, exact view count, length, publish date, description and channel; single videos add likes, comment counts, chapters and tags.

**$0.50 per 1,000 results** · no login or cookies · results in seconds · [monitored every hour](https://lurkapi.com/status?utm_source=apify\&utm_medium=actor\&utm_campaign=youtube-scraper)

### What you can scrape

- **Search keywords**: Keywords, as you'd type them into YouTube. Operators like `intitle:` work.
- **Channels**: Channel handles (`@MrBeast`), channel ids (`UCX6OQ3DkcsbYNE6H8uQQuVA`) or channel URLs.
- **Video URLs**: Single videos or Shorts: watch, youtu.be or /shorts/ links, or 11-character ids. Adds likes, comment counts, chapters and tags.

### Use cases

- Keyword and competitor research on YouTube
- Finding creators to sponsor
- Tracking a channel's uploads and views
- Building video datasets for analysis

### Input

```json
{
  "searchQueries": [
    "running shoes"
  ],
  "maxItems": 20
}
```

**Max results per input** caps how many results each input returns. Every field is explained on the Input tab.

### Output

One item per result, with the input it came from in `input`. Here's one, shortened:

```json
{
  "input": "running shoes",
  "type": "video",
  "id": "z5mWgBMOFJk",
  "url": "https://www.youtube.com/watch?v=z5mWgBMOFJk",
  "title": "My Top 3 Running Shoes | Marathon Prep Training",
  "thumbnail": "https://i.ytimg.com/vi/z5mWgBMOFJk/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBi0dvDEIlx…",
  "viewCountText": "682,786 views",
  "viewCountInt": 682786,
  "publishedTimeText": "6 years ago",
  "publishedTime": "2020-10-01T14:32:05.335Z",
  "lengthText": "17:18",
  "lengthSeconds": 1038,
  "description": "Subscribe: http://bit.ly/subNickBare Follow Nick Bare: Facebook: http://bit.ly/2rTHgHB Instagram: http://bit.ly/NickB…",
  "channel": {
    "id": "UCbVEx9qG_hLrb6FrWQJz_Tg",
    "title": "Nick Bare",
    "handle": "nickbarefitness",
    "url": "https://www.youtube.com/@nickbarefitness",
    "thumbnail": "https://yt3.ggpht.com/ytc/AIdro_mVx6fQ8UNrMx2sjhQ5JwJyQTCfSXAoznqRdRSZLoxmGqQ=s68-c-k-c0x00ffffff-no-rj"
  }
}
```

Download the dataset as JSON, CSV, Excel, XML or HTML, or read it through the Apify API.

### Pricing

**$0.50 per 1,000 results**, and nothing for inputs that return none. Set a maximum charge per run and the Actor stops there. Apify's free plan includes $5 a month, enough for about 10,000 results.

### Need it as an API?

This Actor runs on [LurkAPI](https://lurkapi.com/?utm_source=apify\&utm_medium=actor\&utm_campaign=youtube-scraper), a social media data API. To call it from your own code, or for more volume, the same data is one HTTP request away:

```bash
curl "https://api.lurkapi.com/v1/youtube/search?query=running+shoes" \
  -H "x-api-key: YOUR_KEY"
```

- From $0.45 per 1,000 requests, with 100 free credits when you sign up
- 88 endpoints across 16 platforms: TikTok, Instagram, YouTube, Facebook, Reddit, LinkedIn, Google and more
- An MCP server for Claude, ChatGPT and Cursor

[Docs for this endpoint](https://lurkapi.com/docs/youtube/search?utm_source=apify\&utm_medium=actor\&utm_campaign=youtube-scraper)

### FAQ

**Is it legal?** It reads public data only: what anyone sees without logging in. How you use it is up to you, and personal data falls under laws like the GDPR, so ask a lawyer if you're unsure.

**Do I need a YouTube account or cookies?** No. Add your inputs and run.

**How fresh is the data?** It's fetched when you run the Actor, or comes from a cache at most 1 hour old.

**Something wrong or missing?** Open an issue on the Issues tab or write to support@lurkapi.com.

# Actor input Schema

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

Keywords, as you'd type them into YouTube. Operators like <code>intitle:</code> work.

## `channels` (type: `array`):

Channel handles (<code>@MrBeast</code>), channel ids (<code>UCX6OQ3DkcsbYNE6H8uQQuVA</code>) or channel URLs.

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

Single videos or Shorts: watch, youtu.be or /shorts/ links, or 11-character ids. Adds likes, comment counts, chapters and tags.

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

How many results to get for each profile, search or other input above.

## `uploadDate` (type: `string`):

Only results uploaded in this window.

## `duration` (type: `string`):

Video length. Doesn't apply to Shorts.

## `sortBy` (type: `string`):

<code>relevance</code> (YouTube's default) or <code>popular</code> (most viewed first).

## `channelSort` (type: `string`):

Order: <code>latest</code> (newest first), <code>popular</code> (most viewed) or <code>oldest</code>.

## Actor input object example

```json
{
  "searchQueries": [
    "running shoes"
  ],
  "maxItems": 50,
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "channelSort": "latest"
}
```

# Actor output Schema

## `results` (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 = {
    "searchQueries": [
        "running shoes"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lurkapi-com/youtube-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 = { "searchQueries": ["running shoes"] }

# Run the Actor and wait for it to finish
run = client.actor("lurkapi-com/youtube-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 '{
  "searchQueries": [
    "running shoes"
  ]
}' |
apify call lurkapi-com/youtube-scraper --silent --output-dataset

```

## MCP server setup

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