# 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:** 1 total users, 0 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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.

<!-- ✅ EMBED VIDEO: replace this dummy URL with your real demo video once recorded. Paste the raw YouTube URL on its own line  Apify auto-renders it as a player. -->
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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Hashtag Extractor -Free To Use",
        "description": "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.",
        "version": "0.0",
        "x-build-id": "H2djp5cFUjVHDF4q7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dz_omar~youtube-hashtag-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dz_omar-youtube-hashtag-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dz_omar~youtube-hashtag-extractor/runs": {
            "post": {
                "operationId": "runs-sync-dz_omar-youtube-hashtag-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dz_omar~youtube-hashtag-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-dz_omar-youtube-hashtag-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "hashtag"
                ],
                "properties": {
                    "hashtag": {
                        "title": "Hashtag",
                        "type": "array",
                        "description": "YouTube hashtag(s) to extract from. Include the # symbol or just the word.",
                        "default": [
                            "#hashtags"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "shortsOnly": {
                        "title": "Shorts only",
                        "type": "boolean",
                        "description": "If enabled, scrapes the hashtag's Shorts feed (youtube.com/hashtag/<tag>/shorts). If disabled, scrapes regular videos from the hashtag page.",
                        "default": false
                    },
                    "maxVideos": {
                        "title": "Maximum videos",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of videos/shorts to extract per hashtag.",
                        "default": 5
                    },
                    "country": {
                        "title": "Country",
                        "enum": [
                            "US",
                            "GB",
                            "DZ",
                            "FR",
                            "ES",
                            "PT",
                            "DE",
                            "IT",
                            "CA",
                            "AU",
                            "IN",
                            "BR",
                            "JP"
                        ],
                        "type": "string",
                        "description": "Geographic region for results. Controls both the proxy IP country and YouTube's geo locale together, so results are consistent. Results differ by region.",
                        "default": "US"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
