YouTube Video Scraper by Hashtag (Related Tag Expansion) avatar

YouTube Video Scraper by Hashtag (Related Tag Expansion)

Pricing

Pay per usage

Go to Apify Store
YouTube Video Scraper by Hashtag (Related Tag Expansion)

YouTube Video Scraper by Hashtag (Related Tag Expansion)

Extract YouTube video data by hashtags ๐ŸŽฏ. The YouTube Video Scraper by Hashtag collects titles, channels, views, tags, and URLs from videos using specific hashtags. Perfect for hashtag research, trend analysis, and YouTube SEO optimization. ๐Ÿš€

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Scraper Engine

Scraper Engine

Maintained by Community

Actor stats

1

Bookmarked

9

Total users

0

Monthly active users

16 hours ago

Last modified

Share

Give this scraper one hashtag, keyword or handle and it returns every matching YouTube video as structured JSON โ€” title, viewCount, type (video or Short), matchedTerm and termRank included on every row. Before it crawls anything, it asks YouTube's own public suggestion service which terms sit next to your seed, then crawls those too, so one input becomes a whole tag neighbourhood instead of one search page. No parsing, no HTML, no login. Run it on Apify and check the Dataset tab for your first rows.

What is YouTube Video Scraper by Hashtag?

YouTube Video Scraper by Hashtag (Related Tag Expansion) is an Apify Actor that turns one seed term into its tag neighbourhood: it reads YouTube's public suggestion endpoint for up to 14 ranked related terms, crawls the seed and every related term through YouTube search, and returns one structured row per video with the exact term and suggestion rank that found it. It makes only unauthenticated HTTP requests to YouTube's public pages โ€” no YouTube account, API key, or login is required to run it. It is built for trend researchers, content strategists, marketers scoping a niche, and developers or AI agents that need YouTube search results attributed to the search term that produced them.

What YouTube video data is publicly available to scrape?

YouTube exposes video search results, hashtag pages and its autocomplete/suggestion service to anyone, signed in or not โ€” that public surface is what this scraper reads.

Data CategoryPublicly AvailableRestricted (needs a signed-in session)
Video title, thumbnail, video ID, watch/Shorts URLYesโ€”
Approximate view count as shown on the results pageYes, as YouTube's own rounded text (e.g. "1.2M views")Exact, unrounded view counts are never shown publicly
Video type โ€” regular video vs. ShortYes, detected from badges, duration and layoutโ€”
Related/suggested terms for a hashtag, keyword or handleYes โ€” via YouTube's own public autocomplete/suggest serviceโ€”
Term-level "X videos - Y channels" summary headerYes, when YouTube renders it for that term's pageNot every term renders this header
Private, unlisted, members-only or age-restricted videosโ€”Requires a signed-in, age-verified session
Video description, comments, captions, exact upload dateโ€”Not requested by this scraper โ€” not returned

YouTube Video Scraper by Hashtag only returns publicly visible data โ€” what any visitor sees. Nothing behind a login wall.

What data can I extract with YouTube Video Scraper by Hashtag?

Every row is a single video, carrying both its own metadata and the tag-expansion context that found it โ€” 19 fields in total, matching what the Actor's dataset view shows by default.

Video identity and playback fields

Field NameDescription
thumbnailUrlHighest-resolution thumbnail URL available for the video; falls back to a standard i.ytimg.com thumbnail if YouTube supplies none.
titleVideo title text.
idThe 11-character YouTube video ID.
urlhttps://www.youtube.com/watch?v=<id> for regular videos, https://www.youtube.com/shorts/<id> for Shorts.
viewCountView count parsed to an integer from the displayed text; null (never 0) when YouTube doesn't show a parseable figure.
viewCountTextThe raw view-count text exactly as YouTube displays it, e.g. "1.2M views".
type"video" or "shorts", based on the renderer/layout YouTube served.
hashtagCategoryData.categoryInfoTextLiteral dotted key, reproduced as YouTube writes it. The term page's own "X videos - Y channels" header text, or null if the page didn't render one.

Tag provenance and term metrics fields

Field NameDescription
seedTermThe original seed this row's crawl traces back to.
matchedTermThe exact term that was searched and produced this row โ€” the seed itself, or one of its related terms.
termOrigin"seed" or "expanded" โ€” whether matchedTerm is the seed you supplied or a term discovered via suggestion expansion.
termRankThe 1-based position of matchedTerm in YouTube's own suggestion ranking for its seed; null for seed rows.
termKind"hashtag", "handle" or "keyword" โ€” classification of matchedTerm from its leading character.
searchQueryThe exact string sent to YouTube's search endpoint for this row โ€” identical to matchedTerm, never rewritten.
seedRelatedTermsAll related terms discovered for this row's seed (the same list repeated on every row sharing that seed).
termVideoCountTextRaw "videos" count text from the term's header, e.g. "2.6M videos".
termChannelCountTextRaw "channels" count text from the term's header, e.g. "822K channels".
termVideoCountApproxtermVideoCountText parsed to an approximate integer.
termChannelCountApproxtermChannelCountText parsed to an approximate integer.

๐Ÿค– Add-on: Need additional YouTube data?

Pair this Actor with YouTube Channel Scraper for a channel's own profile, long-form videos, Shorts, live streams and community posts, or with YouTube Most Replayed Scraper to pull the "most replayed" heat-map segments for a list of video URLs you've already found through hashtag expansion.

How does YouTube Video Scraper by Hashtag differ from the official YouTube API?

The YouTube Data API v3 is Google's official, credentialed API for YouTube data; this Actor reads the same public pages a signed-out browser sees, with no Google Cloud project or API key to set up. As of Google's own quota documentation (checked 2026-08-04), a project's default allocation includes 100 search.list calls per day in their own bucket, and search.list has no parameter for hashtag-native search or for related/suggested terms โ€” that surface simply isn't exposed by the documented API.

FeatureYouTube Data API v3YouTube Video Scraper by Hashtag
SetupGoogle Cloud project, API key/OAuth, quota enablementRun directly on Apify โ€” no Google account needed
Hashtag-native searchNot a documented search.list parameter (checked 2026-08-04)Reads #tag, @handle or a keyword exactly as typed
Related/suggested termsNo autocomplete or related-terms endpoint documented (checked 2026-08-04)Calls YouTube's own public suggest endpoint for up to 14 ranked terms per seed
Daily call budget100 search.list calls/day in the default quota (checked 2026-08-04)Bounded by run time and this Actor's own maxResults/maxRelatedTags input caps
Results per callmaxResults parameter capped at 50, paginated via nextPageTokenUp to 500 videos per term, paginated automatically through YouTube's continuation API
Output shapeRaw API JSON โ€” pagination and normalization is your own codeFlat, pre-normalized rows with tag provenance already attached

Use the official API when you need YouTube's authoritative, quota-governed access and already have Google Cloud infrastructure in place. Use this Actor when you need hashtag-native, suggestion-driven crawling with zero setup.

How to use YouTube Video Scraper by Hashtag

You run this Actor from the Apify platform โ€” there's no separate signup or API key for YouTube itself.

  1. Open YouTube Video Scraper by Hashtag (Related Tag Expansion) on the Apify Store and click Try for free (or Run, if you already have it saved).
  2. Under Seed Tags, Keywords or Handles, add at least one entry โ€” a hashtag like #chatgpt, a keyword like coffee recipes, or a handle like @mkbhd.
  3. Optionally adjust Related Tags per Seed, Max Videos per Term, Scrape Shorts Only, Suggestion Language/Region, or attach a Proxy Configuration.
  4. Click Start.
  5. When the run finishes, open the Dataset tab and export the results as JSON, CSV, Excel, or any other format Apify's dataset export supports.

How to scale to bulk video extraction

seedTerms (and its compatibility alias hashtags) is an array โ€” add as many seeds as you want in a single run, and each one is expanded and crawled independently. With expandRelatedTags on, the total number of terms crawled is seeds ร— (1 + maxRelatedTags), so ten seeds with the default 5 related tags each crawl 60 terms in one run. There is no separate bulk-input file or URL list; the array field is the bulk mechanism.

What can you do with YouTube video data?

  • ๐Ÿ”ฌ Trend researchers mapping a topic use seedRelatedTerms and termRank to see which adjacent tags YouTube's own suggestion service ranks highest, ahead of a topic peaking.
  • ๐Ÿ“ˆ Content strategists picking a niche use termVideoCountApprox and termChannelCountApprox to gauge how crowded a term already is before publishing into it.
  • ๐ŸŽฏ Marketers scoping a Shorts campaign run with scrapeShortsOnly and filter on type and viewCount to shortlist high-performing Shorts around a hashtag.
  • ๐Ÿ“Š Analysts use termOrigin ("seed" vs "expanded") and seedTerm to attribute how much of a run's video count came from the original term versus its discovered neighbourhood.
  • ๐Ÿค– AI engineers building a hashtag-monitoring agent feed matchedTerm, termOrigin and viewCount into a scheduled tool call or RAG pipeline to track how a tag's neighbourhood shifts over time.

How does YouTube Video Scraper by Hashtag handle rate limits and blocking?

The Actor makes plain HTTP requests (via aiohttp) to YouTube's public pages โ€” there is no headless browser to render. Every request, including the suggestion calls, goes through the resolved Apify Proxy URL when proxyConfiguration is enabled. Each request retries up to 3 times with a short backoff on network errors or timeouts, and a response of HTTP 403, 429 or 503 is treated as a block. If a term's search page fails outright, the Actor automatically escalates the transport โ€” first to Apify Proxy's datacenter group, then to its residential group โ€” and re-runs only that term; rows already pushed are never re-pushed or re-charged. Proxy credentials are scrubbed from every log line. Pagination for a single term stops after 3 consecutive pages return no new rows, so a Shorts-only or exhausted term can't loop forever. โš ๏ธ maxResults is capped at 500 per term: the deepest term measured while building this Actor exhausted at 301 videos over 34 pages, so 500 is a ceiling YouTube itself will rarely fill, not an arbitrary limit.

โฌ‡๏ธ Input

All fields are optional, but the Actor exits with an error if no seed is supplied through either seedTerms or hashtags.

ParameterRequiredTypeDescriptionExample Value
seedTermsNoArrayOne entry per seed. #tag is searched as a hashtag, @handle as a handle, anything else as a plain keyword โ€” sent to YouTube unchanged.["#chatgpt", "coffee recipes", "@mkbhd"]
hashtagsNoArrayCompatibility key from the base Actor. When non-empty, it takes priority over seedTerms. Leave empty if you're using seedTerms.[]
expandRelatedTagsNoBooleanAsk YouTube's public suggestion service for terms near each seed, then crawl those too. Default true.true
maxRelatedTagsNoIntegerRelated terms to keep per seed, in YouTube's own ranking order. Minimum 0, maximum 14 (YouTube's own hard ceiling), default 5.5
suggestionLanguageNoStringInterface language (hl) used when requesting related terms. Default "en"."en"
suggestionRegionNoStringTwo-letter country (gl) used when requesting related terms. Default "US"."US"
relatedTagsOnlyNoBooleanSkip the seed terms themselves and crawl only the discovered related terms. Default false.false
maxResultsNoIntegerVideos collected per individual term. Minimum 1, maximum 500, default 10.10
dedupeAcrossTermsNoBooleanKeep each video once per run, attributed to the first term that found it, instead of billing it again under every overlapping term. Default true.true
scrapeShortsOnlyNoBooleanRestrict every crawled term to YouTube Shorts. Default false.false
proxyConfigurationNoObjectApify Proxy settings, attached to every request the run makes.{"useApifyProxy": true}

Example input

{
"seedTerms": ["#chatgpt", "coffee recipes", "@mkbhd"],
"hashtags": [],
"expandRelatedTags": true,
"maxRelatedTags": 5,
"suggestionLanguage": "en",
"suggestionRegion": "US",
"relatedTagsOnly": false,
"maxResults": 10,
"dedupeAcrossTerms": true,
"scrapeShortsOnly": false,
"proxyConfiguration": {
"useApifyProxy": true
}
}

โฌ†๏ธ Output

Every row lands in the default Apify dataset as typed, normalized JSON with the same 19 keys on every record โ€” no HTML, no nulls disguised as zeros. Export it from the Console or the API as JSON, JSONL, CSV, Excel, or any other format the Apify dataset export supports.

Example output

{
"thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"title": "ChatGPT Explained in 5 Minutes",
"id": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"viewCount": 1200000,
"type": "video",
"hashtagCategoryData.categoryInfoText": "2.6M videos - 822K channels",
"seedTerm": "#chatgpt",
"matchedTerm": "chatgpt prompts",
"termOrigin": "expanded",
"termRank": 3,
"termKind": "keyword",
"searchQuery": "chatgpt prompts",
"seedRelatedTerms": ["chatgpt prompts", "chatgpt 4", "chatgpt tutorial", "chatgpt for business"],
"viewCountText": "1.2M views",
"termVideoCountText": "2.6M videos",
"termChannelCountText": "822K channels",
"termVideoCountApprox": 2600000,
"termChannelCountApprox": 822000
}

How does it work?

The Actor sends a plain, unauthenticated HTTP GET to youtube.com/results?search_query=<term>, then extracts the ytInitialData and ytcfg blobs embedded in the returned HTML โ€” the same data YouTube's own front end reads. Further pages come from YouTube's internal youtubei/v1/search continuation endpoint, called with the API key and context pulled from ytcfg. Related terms come from a separate call to Google's public suggest endpoint, not from the search page itself. An optional Apify Proxy URL is attached to every request for IP rotation; no headless browser is used. Only what a signed-out visitor could see is ever returned, and the output schema โ€” the same 19 keys, in the same shape โ€” stays constant regardless of which YouTube layout served the page.

Integrations

Calling YouTube Video Scraper by Hashtag programmatically

from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("<YOUR_USERNAME>/youtube-video-scraper-by-hashtag-related-tag-expansion").call(
run_input={
"seedTerms": ["#chatgpt", "@mkbhd"],
"maxRelatedTags": 5,
"maxResults": 10,
}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["title"], item["matchedTerm"], item["viewCount"])

Works in Go, Ruby, Node.js, cURL โ€” any language that can make an HTTP request to the Apify API.

No-code tools (n8n, Make, LangChain)

In n8n or Make, use an HTTP Request node (or the platform's native Apify integration, where available) pointed at this Actor's run endpoint with your Apify API token, then read the resulting dataset items in the next step of your workflow. In LangChain or a similar agent framework, wrap the same apify_client call above as a tool so an agent can trigger a run and consume the dataset directly.

Scraping publicly available data โ€” the video titles, view counts and search results any signed-out visitor can see โ€” is generally permissible; this is not a statement about scraping data behind a login. YouTube Video Scraper by Hashtag returns only that kind of publicly available video and search-result data, not private, unlisted, or personal account information. This is business and platform data โ€” video metadata and aggregate search-result counts โ€” not personal data about identifiable individuals, so GDPR and CCPA do not attach to the rows this Actor returns; YouTube's Terms of Service and Google's database rights over its indexed content are the relevant framing instead. Consult legal counsel if your use case involves bulk storage of personal data.

Frequently asked questions

What YouTube video fields does this scraper return?

The top fields are title, viewCount, type (video or Short), matchedTerm and termRank โ€” see What data can I extract above for the full 19-field list.

Does YouTube Video Scraper by Hashtag require a YouTube account or login?

No. The Actor makes unauthenticated HTTP requests to YouTube's public search pages and Google's public suggest endpoint โ€” no YouTube account, cookie, or API key is used or needed.

How many videos can I extract in one run?

Up to maxResults (max 500) per crawled term, and the number of terms crawled is seeds ร— (1 + maxRelatedTags) when expansion is on โ€” so the practical ceiling per run scales with how many seeds and related tags you configure, not a single fixed number.

What happens if a search term returns zero videos?

The Actor logs it as a completed term with rows: 0 in its internal accounting and moves on to the next term in the crawl plan โ€” a zero-result term never stops the run or produces a fabricated row.

Can I scrape multiple YouTube hashtags, keywords or handles at once?

Yes. seedTerms (or the compatibility key hashtags) accepts an array, and every seed is expanded and crawled independently in the same run.

Does YouTube Video Scraper by Hashtag work with Claude, ChatGPT, and other AI agent tools?

It has no dedicated MCP server, but it is callable as a standard HTTP endpoint through the Apify API by any agent framework that can make an HTTP request โ€” including LangChain, custom Claude tool-use loops, or a scheduled agent job.

What makes this different from a plain YouTube keyword search scraper?

It doesn't stop at the term you typed: expandRelatedTags calls YouTube's own public suggestion service to find up to 14 ranked neighbouring terms per seed, crawls those too, and every resulting row carries termOrigin and termRank so you can see exactly which neighbouring term surfaced it โ€” a plain search scraper only has the one term you gave it.

Does YouTube Video Scraper by Hashtag return data in a format LLMs can use directly?

Yes. Every row is typed, normalized JSON with the same field names across runs โ€” no HTML to parse and no selectors to write. Pass it directly to an LLM, index it into a vector store, or feed it to an agent tool.

What happens when YouTube changes its layout or anti-bot system?

The Actor is maintained against YouTube's current layout โ€” for example, this version reads video Shorts from the current shortsLockupViewModel layout after YouTube retired the older reelItemRenderer renderer it used to rely on. The output schema is designed to stay stable across such changes, but no specific turnaround time for future fixes is promised.

Can I use YouTube Video Scraper by Hashtag without managing proxies or browser infrastructure?

Yes. There's no headless browser to configure โ€” the Actor uses plain HTTP requests โ€” and Apify Proxy is optional; when a request is blocked, the Actor escalates the proxy tier automatically without any action on your part.

Which fields work best for AI training data and RAG indexing?

For RAG, index title alongside matchedTerm and hashtagCategoryData.categoryInfoText for topical context. For training data, id, type, termOrigin and viewCount are the most structurally consistent fields โ€” they return as typed primitives (string, string, string, integer-or-null) on every single row.

Scraper NameWhat it extracts
YouTube Channel ScraperA channel's profile, long-form videos, Shorts, live/past streams and community posts.
YouTube Most Replayed ScraperThe "most replayed" heat-map segments for a list of YouTube video URLs.

Your feedback

Found a bug, or a field YouTube changed on you? Open an issue on this Actor's Issues tab in Apify Console โ€” reports and reproduction steps help keep the term-parsing and suggestion logic in sync with YouTube's current layout.