# YouTube Hashtag Video & Shorts Scraper 🎥 (`easyapi/youtube-hashtag-video-shorts-scraper`) Actor

Scrape YouTube videos and Shorts by hashtag - Extract comprehensive video data including titles, views, channel info, and more. Perfect for content analysis and market research.

- **URL**: https://apify.com/easyapi/youtube-hashtag-video-shorts-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media, Videos, Other
- **Stats:** 154 total users, 6 monthly users, 100.0% runs succeeded, 8 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.99 / 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.

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 Hashtag Video & Shorts Scraper 🎥

### 🎯 Features

- Scrapes both regular videos and Shorts content by hashtag
- Extracts comprehensive video metadata and statistics
- Supports multiple hashtag keywords in a single run
- Built-in proxy rotation support
- Smart pagination handling with auto-scroll
- Duplicate detection to ensure unique results

### 📊 Output Data

For each video/Short, you'll get:

- Video ID and URL
- Title and thumbnail URL
- Channel information (name, URL, verification status, avatar)
- Engagement metrics (view count)
- Publishing time and duration
- Content type (video/shorts)
- Scraping timestamp

### 💡 Use Cases

- Content research and trend analysis
- Competitor monitoring
- Influencer discovery
- Social media marketing insights
- Hashtag performance tracking
- Content strategy development

### 🔧 Input Parameters

- `keywords`: Array of hashtags to scrape (without # symbol)
- `maxItems`: Maximum number of items to scrape per hashtag
- `proxyConfiguration`: Optional proxy settings for better success rates

### 📌 Limitations

- Respects YouTube's terms of service
- Rate limits apply to ensure stable operation
- Some videos might be region-restricted
- Results may vary based on YouTube's algorithm

### 💪 Tips for Best Results

1. Use specific hashtags for more targeted results
2. Configure proxy settings for better success rates
3. Adjust maxItems based on your needs
4. Run at regular intervals for trend monitoring

Need custom features or modifications? Feel free to reach out! 🚀

#### Input Example

A full explanation of an input example in JSON.

```json
{
    "keywords": [
        "ai"
    ],
    "maxItems": 50
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```json
[
    {
        "keyword": "ai",
        "scrapedAt": "2025-02-03T02:59:52.196Z",
        "type": "shorts",
        "content": {
            "videoId": "dRPNp7mcAMI",
            "url": "https://www.youtube.com/shorts/dRPNp7mcAMI",
            "title": "ARE THEY ROBOTS OR REAL PEOPLE!!😳🤖 #shorts #ai #robot #scary #artificialintelligence",
            "thumbnailUrl": "https://i.ytimg.com/vi/dRPNp7mcAMI/hqdefault.jpg?sqp=-oaymwFBCNACELwBSFryq4qpAzMIARUAAIhCGADYAQHiAQoIGBACGAY4AUAB8AEB-AG2CIACgA-KAgwIABABGGUgVyhKMA8=&rs=AOn4CLBbnkC3Xd2AMpKwS396JJMAdGn3kQ",
            "channelInfo": {
                "name": "Katie Feeney",
                "url": "/channel/UC02rAIf5RYrww6AWhoI5S0w",
                "isVerified": true,
                "avatar": "https://yt3.ggpht.com/ct-IQJXuoCqL0PIm8LdWmKoAegezV2QWKoSo1h_aoGZ2VXQTbT7G-MMpsDjJf7GqyDX2D7ma_A=s68-c-k-c0x00ffffff-no-rj"
            },
            "stats": {
                "viewCount": "43,613,166 views",
                "publishedTime": "1 year ago",
                "duration": "9 seconds"
            }
        }
    },
    ...
]
```

### Related Actors

- 🎥 [YouTube Video Data Scraper](https://apify.com/easyapi/youtube-video-data-scraper) - A powerful YouTube video data extractor that fetches comprehensive metadata.
- 📺 [YouTube Trending Videos/Shorts Scraper](https://apify.com/easyapi/youtube-trending-videos-shorts-scraper) - Extract trending videos and shorts from YouTube's trending page.
- 📱 [YouTube Channel Shorts Scraper](https://apify.com/easyapi/youtube-channel-shorts-scraper) - Scrape YouTube Shorts from any channel with comprehensive video details.
- 🎯 [YouTube Hashtag Generator](https://apify.com/easyapi/youtube-hashtag-generator) - Generate relevant, trending hashtags in 65+ languages for YouTube content.
- 🎯 [YouTube Tags Extractor](https://apify.com/easyapi/youtube-tags-extractor) - Extract and analyze tags from any YouTube video URL.
- 🎯 [YouTube Hashtag Extractor](https://apify.com/easyapi/youtube-hashtag-extractor) - Extract hashtags from YouTube videos automatically.
- 📝 [YouTube Description Extractor](https://apify.com/easyapi/youtube-description-extractor) - Extract complete descriptions from YouTube videos.
- 🎥 [YouTube Channel ID Extractor](https://apify.com/easyapi/youtube-channel-id-extractor) - Convert YouTube channel URLs to channel IDs effortlessly.
- 📊 [YouTube Video Statistics Scraper](https://apify.com/easyapi/youtube-video-statistics-scraper) - Extract comprehensive YouTube video statistics and metadata.
- 📊 [YouTube Channel Statistics Scraper](https://apify.com/easyapi/youtube-channel-statistics-scraper) - Extract comprehensive YouTube channel statistics.
- 🌍 [YouTube Region Restriction Checker](https://apify.com/easyapi/youtube-region-restriction-checker) - Check YouTube video regional restrictions across 170+ countries.
- 🎵 [YouTube Music Albums Scraper](https://apify.com/easyapi/youtube-music-albums-scraper) - Scrape YouTube Music albums data with comprehensive details.
- 🎵 [YouTube Music Song Scraper](https://apify.com/easyapi/youtube-music-song-scraper) - Extract song details from YouTube Music search results.
- 🎥 [YouTube Live Stream Scraper](https://apify.com/easyapi/youtube-live-stream-scraper) - Scrape YouTube live streams and upcoming events with detailed information.
- 💬 [YouTube Comments Scraper](https://apify.com/easyapi/youtube-comments-scraper) - Scrape YouTube video comments efficiently with pagination support.

# Actor input Schema

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

List of hashtags to scrape (without # symbol)

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

Maximum number of items to scrape per hashtag

## `proxyConfiguration` (type: `object`):

Proxy settings for the scraper

## Actor input object example

```json
{
  "keywords": [
    "ai"
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "keywords": [
        "ai"
    ],
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("easyapi/youtube-hashtag-video-shorts-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 = {
    "keywords": ["ai"],
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("easyapi/youtube-hashtag-video-shorts-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 '{
  "keywords": [
    "ai"
  ],
  "maxItems": 50
}' |
apify call easyapi/youtube-hashtag-video-shorts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,easyapi/youtube-hashtag-video-shorts-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/FbCxigItnTrushf0w/builds/nSdLOEyUhWpUMXDts/openapi.json
