# YouTube Hashtag Video Scraper (`coregent/youtube-hashtag-video-scraper`) Actor

Scrape public YouTube videos and Shorts by hashtag: ranked rows with title, views, channel, duration, publish context, thumbnails and hashtag lineage. Cross-hashtag dedupe, hard result caps, filters, incremental skip lists and optional video/channel enrichment. No login or API key.

- **URL**: https://apify.com/coregent/youtube-hashtag-video-scraper.md
- **Developed by:** [Delowar Munna](https://apify.com/coregent) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 hashtag video 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 Hashtag Video Scraper

Discover the public videos and Shorts YouTube currently surfaces for any hashtag. Enter one or many hashtags and get clean ranked rows with video IDs, URLs, titles, views, channel context, thumbnails, publication labels and hashtag provenance. Deduplicate across hashtags, set hard result limits, run incremental monitoring, and optionally enrich exact video and channel metadata — no YouTube login or API key required.

### What this Actor does

- **Hashtags in → ranked videos and Shorts out.** One normalized row per unique video, with the hashtag, rank and route that surfaced it.
- **Videos and Shorts** from each hashtag page, interleaved — or only one of the two.
- **Cross-hashtag dedupe.** A video under `#ai`, `#chatgpt` and `#machinelearning` is **one row and one charge**, with all three hashtags and ranks kept.
- **One global result cap** plus a per-hashtag fairness cap, processed round-robin so one popular hashtag can't take the whole run.
- **Filters**: content type, publish date, views, duration, include/exclude keywords, include/exclude channels.
- **Incremental runs**: skip video IDs/URLs you already have — skipped videos are free.
- **Optional enrichment**: exact video details (exact date, likes, comments, description, tags, category…) and channel details (subscribers, views, country, joined date…).
- **No login, cookies or API key needed from you, and no browser.** Hashtag discovery reads public YouTube pages over plain HTTP.

### Quick start

Run it with the defaults and you get **10 rows for `#travel`** — regular videos and Shorts mixed:

```json
{
  "hashtags": ["travel"],
  "maxResults": 10
}
```

A multi-hashtag run with dedupe and video details:

```json
{
  "hashtags": ["ai", "#chatgpt", "https://www.youtube.com/hashtag/machinelearning"],
  "maxResults": 100,
  "maxResultsPerHashtag": 50,
  "contentType": "all",
  "countryCode": "US",
  "languageCode": "en",
  "deduplicateAcrossHashtags": true,
  "includeVideoDetails": true
}
```

A scheduled monitoring run (regular videos only, recent, popular, skipping what you already have):

```json
{
  "hashtags": ["saas", "startup", "entrepreneur"],
  "maxResults": 200,
  "contentType": "videos",
  "countryCode": "AU",
  "publishedAfter": "30 days",
  "minViews": 1000,
  "excludeKeywords": ["giveaway"],
  "extendWithSearch": true,
  "skipVideoIds": ["dQw4w9WgXcQ"]
}
```

### What YouTube hashtag results mean

A YouTube hashtag page (`youtube.com/hashtag/<tag>`) lists videos that use the hashtag in their title or description, **ranked by YouTube**. It is a selection YouTube chooses to show, not an archive. In practice each hashtag page shows **roughly 10–30 regular videos and about 36 Shorts**, then stops.

This Actor collects **what YouTube currently surfaces for each hashtag**. It does not claim to return every video ever tagged, and it reports where each hashtag stopped (`RUN_SUMMARY.hashtags[].stopReason`).

Need more regular videos per hashtag? Turn on **Extend with YouTube search**. When the hashtag page runs out, the Actor continues with YouTube search results for `#hashtag`, which go much deeper. These are **search results for the hashtag query**, so they are not guaranteed to carry the hashtag. They are marked `discoveryRoute: "hashtag_search"`, and with video details on, `hashtagVerified` tells you whether the hashtag actually appears in the video's title, description, hashtags or tags.

### Videos vs Shorts

| | Regular videos | Shorts |
|---|---|---|
| Source | Hashtag page, videos tab (+ optional search) | Hashtag page, Shorts tab |
| `videoUrl` | `/watch?v=<id>` | `/shorts/<id>` |
| Title, views, thumbnail | ✅ | ✅ |
| Channel name / ID | ✅ | with **video details** on |
| Duration, publish label | ✅ | with **video details** on |

Shorts are never forced into a fake video schema: anything YouTube doesn't show on a Shorts card is `null` until you enable video details.

### Multiple hashtags and dedupe

- **`deduplicateAcrossHashtags: true` (default)**: one row per unique video. `matchedHashtags` lists every requested hashtag it appeared under, and `hashtagObservations` keeps each `{ hashtag, rank, route, sourceUrl }`. You pay once per video.
- **`deduplicateAcrossHashtags: false`**: one row per **hashtag-video observation**. The same video under two hashtags gives two rows (two charges). Use this for rank analysis per hashtag.

Hashtags themselves are normalized (`#Travel`, `travel` and `https://www.youtube.com/hashtag/travel` are the same tag) and duplicate inputs are merged.

### Rank and source lineage

- `rankWithinHashtag` is the **position observed in this scrape** for that route (videos tab, Shorts tab or search). It is not a universal rank, and it can differ by country, language and time.
- `sourceHashtag`, `inputHashtag`, `sourceUrl`, `discoveryRoute`, `countryCode` and `languageCode` record exactly where a row came from.

### Filters

| Filter | Uses | Notes |
|---|---|---|
| Content type | card | all / videos / shorts |
| Min / max views | card (exact with video details) | compact labels like "1.2M" are rounded |
| Min / max duration | card (exact with video details) | Shorts have no duration on the card |
| Published after / before | relative label (exact with video details) | "2 weeks ago" is approximate; Shorts have no date on the card |
| Include / exclude keywords | title + snippet (full description and tags with video details) | case-insensitive |
| Only / exclude channels | channel ID, @handle or name | Shorts need video details to be matched |

When a filter needs a value the card doesn't show (for example a date filter on a Short) and video details are **off**, the video is dropped and counted in `RUN_SUMMARY.filteredOutByReason`. With video details **on**, the filter is checked again after the details are fetched. Filtered and skipped videos are never charged.

### Optional video and channel enrichment

- **Include video details**: one public page fetch per delivered video. It adds exact `publishedAt` and `viewCount`, `likeCount`, `commentCount`, the full `description`, `tags`, `videoHashtags`, `category`, `isLiveContent`, `isUpcoming`, `hasCaptions` and `hashtagVerified`, and fills the channel for Shorts.
- **Include channel details**: fetched once per unique channel. It adds `channelHandle`, `channelSubscriberCount`, `channelViewCount`, `channelVideoCount`, `channelCountry`, `channelJoinedDate`, `channelVerified` and `channelAvatarUrl`.

Enrichment runs **after** dedupe and filters, only for rows that are actually delivered, and never twice for the same video or channel in a run. If a detail page is unavailable, the row is still delivered with `videoDetailsStatus` / `channelDetailsStatus: "unavailable"` and that enrichment is not charged.

### Incremental scheduled runs

Schedule the Actor (Apify Console → Schedules) and pass the video IDs or URLs you already have in `skipVideoIds` / `skipVideoUrls`. Those videos are skipped and not charged. Combine with `publishedAfter` (e.g. `7 days`) to collect only newly surfaced videos.

### Input reference

| Field | Default | Description |
|---|---|---|
| `hashtags` | `["travel"]` | Hashtags, with or without `#`, or `youtube.com/hashtag/<tag>` URLs |
| `maxResults` | `10` | Exact run-wide row ceiling |
| `maxResultsPerHashtag` | `50` | Per-hashtag fairness cap |
| `contentType` | `all` | `all`, `videos`, `shorts` |
| `countryCode` | `US` | Two-letter regional context (gl) |
| `languageCode` | `en` | Interface language (hl) |
| `extendWithSearch` | `false` | Continue with YouTube search for `#hashtag` (deeper, looser) |
| `publishedAfter` / `publishedBefore` | — | Date, ISO timestamp or relative (`30 days`, `2w`, `6m`) |
| `minViews` / `maxViews` | — | View range |
| `minDurationSeconds` / `maxDurationSeconds` | — | Duration range |
| `includeKeywords` / `excludeKeywords` | `[]` | Keyword filters |
| `includeChannels` / `excludeChannels` | `[]` | Channel IDs, @handles or names |
| `deduplicateAcrossHashtags` | `true` | One row per unique video vs one per observation |
| `skipVideoIds` / `skipVideoUrls` | `[]` | Already-known videos (skipped, free) |
| `includeVideoDetails` | `false` | Exact video metadata (extra event per unique video) |
| `includeChannelDetails` | `false` | Channel metadata (extra event per unique channel) |
| `maxPagesPerHashtag` | `20` | Page safety ceiling per hashtag |
| `maxConcurrency` | `5` | Hashtags in parallel (1–10) |
| `requestDelayMs` | `0` | Optional pause between requests |
| `proxyConfiguration` | no proxy | See the proxy policy below |
| `debugMode` | `false` | Per-page logs and a diagnostics block in `RUN_SUMMARY` |

### Output fields

Every row has `recordType: "hashtag_video"`. Fields that YouTube doesn't expose for a row are `null`, never guessed.

```json
{
  "recordType": "hashtag_video",
  "videoId": "_DvMKgH7KWU",
  "videoUrl": "https://www.youtube.com/watch?v=_DvMKgH7KWU",
  "contentType": "video",
  "title": "Choosing the Perfect Travel Bag Isn't Even About the Bag",
  "descriptionSnippet": "In this video, I share the 8-step decision-making tree to find the best travel bag for you…",
  "thumbnailUrl": "https://i.ytimg.com/vi/_DvMKgH7KWU/hqdefault.jpg",
  "channelId": "UCn0vuDgN_Z7IPeTiXwjsxzA",
  "channelName": "Maurice Moves",
  "channelHandle": "@MauriceMoves",
  "channelUrl": "https://www.youtube.com/@MauriceMoves",
  "channelVerified": true,
  "viewCount": 82619,
  "viewCountText": "82,619 views",
  "durationSeconds": 550,
  "durationText": "9:10",
  "publishedAt": "2026-11-01T16:24:52.000Z",
  "publishedText": "1 day ago",
  "sourceHashtag": "travel",
  "inputHashtag": "travel",
  "normalizedHashtag": "travel",
  "sourceUrl": "https://www.youtube.com/hashtag/travel",
  "discoveryRoute": "hashtag_videos",
  "rankWithinHashtag": 1,
  "matchedHashtags": ["travel"],
  "matchedHashtagCount": 1,
  "hashtagObservations": [{ "hashtag": "travel", "rank": 1, "route": "hashtag_videos", "sourceUrl": "https://www.youtube.com/hashtag/travel" }],
  "countryCode": "US",
  "languageCode": "en",
  "videoDetailsStatus": "ok",
  "likeCount": 1878,
  "likeCountApproximate": false,
  "commentCount": 46,
  "commentCountText": "46",
  "description": "In this video, I share the 8-step decision-making tree…",
  "tags": ["Travel Bag", "One Bag Travel"],
  "videoHashtags": ["travel", "travelbag", "onebagtravel"],
  "category": "Education",
  "isLiveContent": false,
  "isUpcoming": false,
  "hasCaptions": true,
  "hashtagVerified": true,
  "channelDetailsStatus": "ok",
  "channelSubscriberCount": 470000,
  "channelSubscriberCountText": "470K subscribers",
  "channelViewCount": 56625870,
  "channelVideoCount": 211,
  "channelCountry": "Canada",
  "channelJoinedDate": "2016-10-13",
  "channelAvatarUrl": "https://yt3.googleusercontent.com/…",
  "scrapedAt": "2026-11-03T01:00:12.431Z"
}
```

The video-detail fields (`videoDetailsStatus` to `hashtagVerified`) are filled only with **Include video details**, and the `channel*Count` / country / joined / avatar fields only with **Include channel details**. Otherwise they are `null`.

**Dataset views** (all are column sets over the same rows, never extra billed rows): *All results*, *Views & engagement*, *Newest / publication*, *Hashtag lineage (multi-hashtag matches)* — sort by `matchedHashtagCount` — and *By channel*. Use the `contentType` column to split videos from Shorts.

**Run summary.** The key-value store record `RUN_SUMMARY` holds hashtags requested, processed, failed and with no results, pages requested, candidates seen, unique videos seen, results emitted, cross-hashtag duplicates, skip-list matches, filtered counts by reason, detail fetches, rate limits, retries, proxy fallbacks, duration, the stop reason, a per-hashtag breakdown (status, pages, routes, stop reason, errors) and request counts per endpoint.

### Cost controls

- `maxResults` is exact: the run never delivers or charges more rows.
- `maxResultsPerHashtag` and `maxPagesPerHashtag` bound each hashtag.
- Duplicates, skipped, filtered, invalid and zero-result inputs cost nothing.
- Enrichment is off by default and charged once per unique video or channel actually delivered.
- The run respects the maximum charge you set for it on Apify and stops cleanly when that limit is reached (`stopReason: "spend_limit"`).

### Pricing

Pay per event:

- **Hashtag video result**: each delivered row.
- **Video details enrichment** (opt-in): once per unique video, only when its details are returned.
- **Channel details enrichment** (opt-in): once per unique channel, only when its details are returned.

There is no start fee and no charge for duplicates, skipped or filtered videos, failed hashtags, diagnostics or the run summary. Current prices are on the Actor's **Pricing** tab. This README deliberately doesn't quote figures, so it never goes stale.

### Regional and language behavior

`countryCode` (gl) and `languageCode` (hl) are sent with every request, and ranking can differ between countries. Text fields (titles, labels) are returned as YouTube shows them. View counts and relative dates are parsed from YouTube's labels, which is most reliable with `languageCode: "en"`. In other languages a number YouTube writes differently may stay `null` rather than be guessed.

### Source depth and completeness

- Hashtag pages are shallow (see above). Use `extendWithSearch` for depth on regular videos.
- Ranks and results change over time and between regions.
- Videos that are private, members-only or removed are not returned.
- The Actor stops a route at a terminal or repeated cursor, after three pages with nothing new, at the page cap, or after three consecutive failures. One failing hashtag never stops the others.

### No-login and proxy posture

No YouTube account, cookies or API key of yours are used or accepted. Hashtag discovery and channel details read public YouTube endpoints over HTTP, with no browser. Optional video details come from YouTube's official Data API, using the Actor's own key.

#### 🚦 Proxy policy

Use **no proxy** (default) or **Apify Datacenter** proxy for normal runs. Both work for YouTube hashtag pages at this Actor's conservative concurrency.

**Apify Residential proxy is not supported.** If `apifyProxyGroups` includes `RESIDENTIAL`, the run uses Apify Datacenter proxy instead and logs a warning; it doesn't fail. Reason: in pay-per-event Actors, residential bandwidth is billed to the developer, not the run user, so a single bandwidth-heavy run could exceed the per-result event revenue.

If you genuinely need residential routing, supply your own residential provider via the proxy editor's **Custom proxy URLs** field. That traffic goes through your provider, not Apify, and is unaffected:

```
http://user:pass@proxy.iproyal.com:12321
http://user:pass@proxy.brightdata.com:22225
http://user:pass@proxy.oxylabs.io:7777
```

### API and integrations

Call it from the Apify API, the JavaScript/Python clients, Make, Zapier or n8n like any Actor. Rows are written as they are finalized, so partial results survive a later failure. Typical hand-offs:

- video IDs → a YouTube comment, transcript or highlights Actor;
- channel IDs → a channel contacts or channel videos Actor.

### Troubleshooting

| Symptom | What to do |
|---|---|
| Fewer rows than `maxResults` | The hashtag page ran out. Add hashtags, or turn on `extendWithSearch`. Check `RUN_SUMMARY.hashtags[].stopReason`. |
| A hashtag shows `no_results` | YouTube has no public hashtag page for it — check the spelling. |
| Shorts disappear when I set a date or duration filter | Shorts cards carry no date or duration. Turn on video details. |
| Rate limiting / blocked | Lower `maxConcurrency`, add `requestDelayMs`, or use Apify Datacenter proxy. |
| `Invalid input: …` | The message names the field. Hashtags can contain only letters, numbers and underscores. |

### Responsible use

This Actor collects public YouTube content only. You are responsible for lawful use, privacy and data-protection obligations, YouTube's terms, and how you store and use the data. Don't use it for harassment, deanonymization or engagement manipulation.

### Changelog

- **1.0** — Initial release: hashtag Videos and Shorts discovery, optional search extension, cross-hashtag dedupe and observation mode, global and per-hashtag caps, filters, skip lists, video and channel enrichment, `RUN_SUMMARY`.

# Actor input Schema

## `hashtags` (type: `array`):

One or more hashtags. Use <code>travel</code>, <code>#travel</code> or <code>https://www.youtube.com/hashtag/travel</code>. Hashtags are matched case-insensitively and duplicates are merged. Letters, numbers and underscores only — no spaces.

## `maxResults` (type: `integer`):

Hard ceiling on rows for the whole run, across all hashtags. The run stops exactly at this number. Each row is one result you pay for.

## `maxResultsPerHashtag` (type: `integer`):

Fairness cap so one popular hashtag cannot take the whole run. YouTube's hashtag page itself surfaces roughly 10–30 regular videos and about 36 Shorts per hashtag; turn on <b>Extend with YouTube search</b> to go deeper for regular videos.

## `contentType` (type: `string`):

<b>All</b> returns regular videos and Shorts interleaved. <b>Videos</b> returns regular videos only, <b>Shorts</b> only Shorts.

## `countryCode` (type: `string`):

Two-letter country code for YouTube's regional context (gl), e.g. US, GB, IN, DE. Ranking can differ by country.

## `languageCode` (type: `string`):

YouTube interface language (hl), e.g. en, de, es, pt-BR. View counts and dates are parsed most reliably with <code>en</code>; other languages keep the raw text fields.

## `extendWithSearch` (type: `boolean`):

After the hashtag page runs out, keep collecting from YouTube search results for <code>#hashtag</code>. This goes much deeper, but these are search results for the hashtag query — not guaranteed to carry the hashtag. Rows from this route have <code>discoveryRoute: hashtag_search</code>; turn on video details to get <code>hashtagVerified</code>.

## `publishedAfter` (type: `string`):

Keep only videos published after this date — an absolute date or a relative period such as <code>30 days</code>. Uses the exact publish date when video details are on, otherwise YouTube's approximate label ("2 weeks ago"). Shorts cards carry no date: with video details off, Shorts are dropped when a date filter is set.

## `minViews` (type: `integer`):

Keep only videos with at least this many views (from the result card; exact when video details are on).

## `includeKeywords` (type: `array`):

Keep only videos whose title or description snippet contains at least one of these words (case-insensitive). With video details on, the full description and tags are searched too.

## `excludeKeywords` (type: `array`):

Drop videos whose title or description contains any of these words (case-insensitive).

## `includeVideoDetails` (type: `boolean`):

Fetch each delivered video's page for exact publish date, exact views, likes, comment count, full description, tags, hashtags, category, live/upcoming flags and caption availability. Also fills channel name and ID for Shorts. Billed as an extra event per unique video.

## `includeChannelDetails` (type: `boolean`):

Add the channel's handle, subscriber count, total views, video count, country, joined date, verified flag and avatar. Fetched once per unique channel and billed once per unique channel. Shorts need video details on to know their channel.

## `deduplicateAcrossHashtags` (type: `boolean`):

On: one row per unique video, with every hashtag and rank it appeared under kept in <code>matchedHashtags</code> / <code>hashtagObservations</code> — a video under five hashtags is one row and one charge. Off: one row per hashtag-video observation (useful for rank analysis), each billed as a row.

## `skipVideoIds` (type: `array`):

Video IDs you already have (e.g. from a previous scheduled run). They are skipped and not charged.

## `skipVideoUrls` (type: `array`):

Video or Shorts URLs you already have. They are skipped and not charged.

## `publishedBefore` (type: `string`):

Keep only videos published before this date. Same rules as <b>Published after</b>.

## `maxViews` (type: `integer`):

Keep only videos with at most this many views.

## `minDurationSeconds` (type: `integer`):

Keep only videos at least this long. Shorts cards carry no duration — with video details off, Shorts are dropped when a duration filter is set.

## `maxDurationSeconds` (type: `integer`):

Keep only videos at most this long.

## `includeChannels` (type: `array`):

Keep only videos from these channels — channel IDs (UC…), @handles or channel names. Shorts need video details on to be matched.

## `excludeChannels` (type: `array`):

Drop videos from these channels — channel IDs (UC…), @handles or channel names.

## `maxPagesPerHashtag` (type: `integer`):

Safety ceiling on result pages requested per hashtag (all routes together).

## `maxConcurrency` (type: `integer`):

Hashtags processed in parallel (detail requests use up to twice this, max 10). Keep it low if you see rate limiting.

## `requestDelayMs` (type: `integer`):

Optional pause between requests. The actor also slows down on its own after rate limiting.

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

No proxy is needed for normal runs. If YouTube blocks requests, use Apify Datacenter proxy or your own proxy URLs. Apify Residential proxy is not supported — a run that selects it uses Apify Datacenter instead, with a warning — bring your own residential provider via Custom proxy URLs instead.

## `debugMode` (type: `boolean`):

Log every page and add a diagnostics block to RUN_SUMMARY. Never logs cookies, tokens or proxy credentials.

## Actor input object example

```json
{
  "hashtags": [
    "travel"
  ],
  "maxResults": 10,
  "maxResultsPerHashtag": 50,
  "contentType": "all",
  "countryCode": "US",
  "languageCode": "en",
  "extendWithSearch": false,
  "includeVideoDetails": false,
  "includeChannelDetails": false,
  "deduplicateAcrossHashtags": true,
  "maxPagesPerHashtag": 20,
  "maxConcurrency": 5,
  "requestDelayMs": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "debugMode": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `runSummary` (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 = {
    "hashtags": [
        "travel"
    ],
    "maxResults": 10,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("coregent/youtube-hashtag-video-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 = {
    "hashtags": ["travel"],
    "maxResults": 10,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("coregent/youtube-hashtag-video-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 '{
  "hashtags": [
    "travel"
  ],
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call coregent/youtube-hashtag-video-scraper --silent --output-dataset

```

## MCP server setup

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