# YouTube Hashtag Extractor -Free To Use (`dz_omar/youtube-hashtag-extractor`) Actor

Extract videos or Shorts from any YouTube hashtag, with full metadata and transcripts. Get title, channel, views, runtime, description, thumbnail, and timestamped transcript text. Pick a country to control region. Multiple hashtags per run. Pay only per video extracted.

- **URL**: https://apify.com/dz\_omar/youtube-hashtag-extractor.md
- **Developed by:** [FlowExtract API](https://apify.com/dz_omar) (community)
- **Categories:** Videos, Social media, SEO tools
- **Stats:** 2 total users, 2 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🎬 YouTube Hashtag Extractor  Scrape Videos & Shorts from Any Hashtag with Transcripts

**YouTube Hashtag Extractor** pulls videos (or Shorts) from any YouTube hashtag and enriches each one with full metadata and a clean transcript  title, channel, views, runtime, description, thumbnail, and the spoken text with timestamps. Just give it a hashtag and a country, and get structured, ready-to-use data.

Perfect for **content researchers**, **social media marketers**, and **data analysts** who need hashtag-level video data and transcripts without manually opening hundreds of videos.

https://www.youtube.com/watch?v=DUMMY\_VIDEO\_ID

***

### Why scrape YouTube hashtags?

YouTube hashtags group millions of videos by topic, making them one of the fastest ways to discover what's being published around a subject  trends, competitors, creators, and talking points. Extracting that feed in bulk turns scattered videos into a structured dataset you can search, filter, and analyze.

Here are some of the most common use cases:

- **Trend research**: See which videos and creators dominate a hashtag right now.
- **Content analysis**: Pull transcripts in bulk to analyze topics, keywords, and messaging.
- **Competitor monitoring**: Track who is publishing under hashtags in your niche.
- **Shorts discovery**: Target the dedicated Shorts feed of a hashtag for short-form research.
- **Localized insights**: Compare hashtag results across countries to see regional differences.

***

### What data can YouTube Hashtag Extractor extract?

#### 🎬 Video Identity

- `videoId`  YouTube video ID
- `VideoURL`  canonical watch URL
- `Video_title`  video title
- `category` / `hashtag`  the hashtag the video was found under

#### 📺 Channel

- `Channel_Name`  uploading channel's display name
- `Channel_Id`  YouTube channel ID

#### 📊 Stats & Metadata

- `Views`  view count
- `Runtime`  duration (M:SS or H:MM:SS)
- `published_Date`  publication date (ISO 8601)
- `Description`  full video description
- `thumbnail`  highest-resolution thumbnail URL

#### 📝 Transcript

- `hasTranscript`  whether a transcript was found
- `transcriptText`  full cleaned transcript as plain text
- `transcriptLanguage`  transcript language code
- `isAutoGenerated`  whether the transcript is auto-generated (ASR)
- `timestamps`  transcript segments with start time and text

***

### ⚙️ How to use YouTube Hashtag Extractor

The actor takes four simple inputs.

##### `hashtag` (Array of strings)  required

One or more hashtags to extract from. Include the `#` symbol or just the word.

| Input value | What it extracts |
|---|---|
| `#hashtags` | Videos under the `#hashtags` hashtag |
| `cooking` | Videos under the `#cooking` hashtag (the `#` is optional) |

```json
{
    "hashtag": ["#hashtags", "#marketing"]
}
```

##### `shortsOnly` (Boolean)

- **Default**: `false`
- When `true`, extracts from the hashtag's **Shorts feed** (`youtube.com/hashtag/<tag>/shorts`). When `false`, extracts regular videos from the hashtag page.

##### `maxVideos` (Integer)

- **Default**: `5`
- Maximum number of videos/shorts to extract per hashtag. Use a small value to test, then increase for a full run.

##### `country` (Select)

- **Default**: `US`
- Controls **both** the proxy exit region and YouTube's geo locale together, so results stay consistent. A hashtag returns different videos in different countries  this single setting keeps the IP and the locale aligned.

```json
{
    "hashtag": ["#cooking"],
    "shortsOnly": true,
    "maxVideos": 25,
    "country": "FR"
}
```

***

### 💰 Pricing

> 🎉 **This Actor is currently FREE to use.** You only pay Apify's standard platform usage for the run. There are no per-result charges at this time.

Pricing may change in the future. Any change will be shown transparently here and in the Apify Store before you run.

***

### 📊 Sample Output

```json
{
    "videoId": "n4Q-Y8O5_Hk",
    "VideoURL": "https://www.youtube.com/watch?v=n4Q-Y8O5_Hk",
    "category": "#hashtags",
    "Video_title": "What is a Hashtag (#) and Why Do We Need It?",
    "Channel_Id": "UCCvjioedUfclrYgLSawypfQ",
    "Channel_Name": "Popupsmart",
    "Views": "2559 views",
    "Runtime": "0:51",
    "published_Date": "2022-09-28T06:00:26-07:00",
    "Description": "A hashtag is a word or phrase preceded by the \"#\" symbol...",
    "thumbnail": "https://i.ytimg.com/vi_webp/n4Q-Y8O5_Hk/maxresdefault.webp",
    "hasTranscript": true,
    "transcriptText": "Let's talk about hashtags. A hashtag is a word phrase preceded by the hash symbol...",
    "transcriptLanguage": "en",
    "isAutoGenerated": false,
    "timestamps": [
        { "time": "0:00", "text": "Let's talk about hashtags." },
        { "time": "0:02", "text": "A hashtag is a word phrase\npreceded by the hash symbol." }
    ],
    "hashtag": "#hashtags"
}
```

***

### ❓ Frequently Asked Questions

**Do I need a YouTube account to use this actor?**
No. The actor extracts publicly visible hashtag data  no login or account is required.

**Can I scrape multiple hashtags in one run?**
Yes. Pass an array of hashtags in the `hashtag` field and the actor processes each in turn.

**What's the difference between videos and Shorts?**
By default the actor returns regular videos from the hashtag page. Set `shortsOnly: true` to target the hashtag's dedicated Shorts feed instead.

**Why do results change when I change the country?**
YouTube personalizes hashtag results by region. The `country` setting aligns both the proxy IP and YouTube's locale, so a run for `FR` reflects what a viewer in France would see.

**What happens if a video has no transcript?**
The video is still extracted and returned with `hasTranscript: false`. Metadata is always attempted regardless of transcript availability.

***

### ⚖️ Legal & Ethical Use

This actor extracts **publicly visible data** from YouTube  the same information any visitor can see in their browser.

**Please use this tool responsibly:**

- Only extract data you are authorized to access
- Comply with [YouTube's Terms of Service](https://www.youtube.com/t/terms) and applicable data protection regulations (GDPR, CCPA, etc.)
- Do not use extracted data for spam, harassment, or unsolicited outreach
- Respect creators' rights when reusing transcript content

***

### 🌐 Proxy Support

Proxy is handled automatically based on the `country` you select  the actor uses Apify Residential proxy in that region so the IP and YouTube locale always match.

| User tier | Proxy used |
|---|---|
| 💎 Paying | Premium Residential in the selected country |
| 🆓 Free | Apify RESIDENTIAL  built-in, automatic |

***

### 🚫 Error Handling

| Situation | What you see | What to do |
|---|---|---|
| Hashtag has no videos | `No videos found for this hashtag` | Try a more popular hashtag or a different country |
| YouTube blocks the request | `Blocked` warning, run stops | Re-run; the actor rotates IPs automatically |
| Video unavailable / no metadata | Video skipped, not charged | Normal  some videos are region-locked or removed |
| Budget too small | `Budget too small` | Raise the run's max cost, or lower `maxVideos` |

***

### 🔌 Standby Mode (Actor-to-Actor Streaming)

This actor supports **Standby mode**  it runs as a persistent HTTP server that another actor can call to stream results in real-time via NDJSON.

The public URL:

```
https://YOUR_USERNAME--youtube-hashtag-extractor.apify.actor?token=***
```

#### Endpoints

| Endpoint | Method | Purpose |
|----------|--------|---------|
| `/heartbeat` | GET | Keep-alive ping |
| `/health` | GET | Readiness probe |
| `/` | POST | Main endpoint  accepts a hashtag, streams results back |

#### POST Request Body

```json
{
    "hashtag": "#hashtags",
    "maxVideos": 5,
    "shortsOnly": false,
    "country": "US"
}
```

#### NDJSON Event Types

| Type | When | Key fields |
|------|------|------------|
| `started` | Request accepted | `hashtag` |
| `hashtag_extracted` | Video IDs found | `videoCount` |
| `video_processed` | A video succeeded | `videoId`, `data` |
| `video_failed` | A video failed | `videoId`, `error` |
| `completed` | All done | `processedCount`, `successCount`, `failureCount` |
| `error` | Fatal failure | `error` |

***

### Get Started Now

#### Free Trial Available

No credit card required. Test with 5$ to see the quality yourself.

[**💬 Get Support**](mailto:flowextractapi@outlook.com)

#### Need Help?

**📧 Email:** <flowextractapi@outlook.com>\
**🌐 Website:** [flowextractapi.com](https://flowextractapi.com)\
**🐦 Twitter:** [@FlowExtractAPI](https://x.com/@FlowExtractAPI)\
**💼 LinkedIn:** [flowextract-api](https://www.linkedin.com/in/flowextract-api/)

**Response time:** Within 24 hours (usually much faster)

# Actor input Schema

## `hashtag` (type: `array`):

YouTube hashtag(s) to extract from. Include the # symbol or just the word.

## `shortsOnly` (type: `boolean`):

If enabled, scrapes the hashtag's Shorts feed (youtube.com/hashtag/<tag>/shorts). If disabled, scrapes regular videos from the hashtag page.

## `maxVideos` (type: `integer`):

Maximum number of videos/shorts to extract per hashtag.

## `country` (type: `string`):

Geographic region for results. Controls both the proxy IP country and YouTube's geo locale together, so results are consistent. Results differ by region.

## Actor input object example

```json
{
  "hashtag": [
    "#example"
  ],
  "shortsOnly": false,
  "maxVideos": 5,
  "country": "US"
}
```

# Actor output Schema

## `videos` (type: `string`):

In Normal Mode, the extracted videos with metadata and transcripts are stored in the default dataset. In Standby Mode, results are streamed as NDJSON from the container URL.

## `standbyApi` (type: `string`):

The URL of the Standby API endpoint where results are streamed as NDJSON.

# 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 = {
    "hashtag": [
        "#example"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dz_omar/youtube-hashtag-extractor").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 = { "hashtag": ["#example"] }

# Run the Actor and wait for it to finish
run = client.actor("dz_omar/youtube-hashtag-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "hashtag": [
    "#example"
  ]
}' |
apify call dz_omar/youtube-hashtag-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dz_omar/youtube-hashtag-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AwDQa15E6fvJg99kT/builds/H2djp5cFUjVHDF4q7/openapi.json
