DEV Community

KinderBB
KinderBB

Posted on

Build a YouTube Channel Finder in Python That Qualifies Creators

A basic YouTube channel finder returns channels that match a name or topic. That is useful for lookup. It is not enough for creator outreach.

If you are building a sponsor list, recruiting educators, or selling a service to creators, the real question is narrower:

Which channels match my niche, still publish, reach enough viewers, and expose a public route for business contact?

This tutorial builds that workflow in Python. It starts without a seed list, discovers candidates from a niche, qualifies recent public performance, and returns one structured Dataset row per channel.

The result we want

The input should describe the opportunity, not a pile of channel URLs:

run_input = {
    "preset": "qualified_shortlist",
    "niches": ["AI automation", "B2B SaaS"],
    "languages": ["en"],
    "countries": ["US", "CA", "GB"],
    "worldwideLanguageMode": False,
    "minSubscribers": 5_000,
    "maxSubscribers": 250_000,
    "minVideosPerMonth": 1,
    "lastUploadWithinDays": 60,
    "minRecentMedianViews": 1_000,
    "contentFormats": ["long-form", "Shorts"],
    "requirePublicBusinessContact": False,
    "maxChannels": 10,
    "videosAnalyzedPerChannel": 10,
    "maximumSearchCalls": 12,
}
Enter fullscreen mode Exit fullscreen mode

The output should be reviewable without opening every channel manually. Useful fields include:

  • channel identity and URL;
  • subscriber count and recent upload date;
  • videos published in the last 30 and 90 days;
  • estimated videos per month;
  • recent median and average views;
  • engagement when the public counts make it calculable;
  • Shorts, long-form, and live ratios;
  • declared country, inferred countries, and confidence kept separate;
  • public business email, website, or social route when explicitly exposed;
  • an opportunity score plus the reasons behind it.

That is the difference between a channel scraper and a creator-prospecting dataset.

Why subscriber count is a weak filter by itself

Subscriber count is easy to retrieve, so many YouTube scraping tutorials stop there. But two channels with 50,000 subscribers can be completely different prospects:

  • one published yesterday and regularly reaches 8,000 views;
  • the other last uploaded nine months ago;
  • one is mostly Shorts while your offer is for long-form editing;
  • one covers your niche consistently while the other mentioned it once;
  • one publishes a business email in the channel description while the other does not expose a public contact.

A useful YouTube creator finder therefore has to qualify the recent channel state, not only copy lifetime totals.

Run the Actor from Python

Install the Apify client:

pip install apify-client
Enter fullscreen mode Exit fullscreen mode

Store your Apify token in an environment variable. Do not paste it into source code, a notebook, a screenshot, or a public repository.

export APIFY_API_TOKEN="..."
Enter fullscreen mode Exit fullscreen mode

Then call the Actor and retrieve its default Dataset:

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_API_TOKEN"])

run_input = {
    "preset": "qualified_shortlist",
    "niches": ["AI automation", "B2B SaaS"],
    "languages": ["en"],
    "countries": ["US", "CA", "GB"],
    "worldwideLanguageMode": False,
    "minSubscribers": 5_000,
    "maxSubscribers": 250_000,
    "minVideosPerMonth": 1,
    "lastUploadWithinDays": 60,
    "minRecentMedianViews": 1_000,
    "contentFormats": ["long-form", "Shorts"],
    "requirePublicBusinessContact": False,
    "maxChannels": 10,
    "videosAnalyzedPerChannel": 10,
    "maximumSearchCalls": 12,
}

run = client.actor("kazkn/youtube-creator-lead-finder").call(
    run_input=run_input
)

items = client.dataset(run["defaultDatasetId"]).list_items().items

for creator in items:
    print(
        creator["channelName"],
        creator["channelUrl"],
        creator.get("recentMedianViews"),
        creator.get("opportunityScore"),
    )
Enter fullscreen mode Exit fullscreen mode

The Actor writes one deduplicated row per channelId within the run. Separate runs use separate Datasets, so the same channel can legitimately appear again in a later search.

Search by language worldwide

Country and language are different filters. A French-speaking creator might be based in France, Canada, Belgium, Switzerland, Morocco, or somewhere else entirely.

To find French-speaking creators without forcing one country:

run_input = {
    "preset": "quick_leads",
    "niches": ["AI agents"],
    "languages": ["fr"],
    "countries": [],
    "worldwideLanguageMode": True,
    "maxChannels": 5,
    "videosAnalyzedPerChannel": 5,
    "maximumSearchCalls": 5,
}
Enter fullscreen mode Exit fullscreen mode

The discovery hints guide the search. The output still keeps confirmed language evidence and confidence separate from geography. A search region is not silently presented as a creator’s declared country.

Require activity and recent performance

For outreach, “active” should be explicit. Three inputs do most of the work:

{
    "minVideosPerMonth": 2,
    "lastUploadWithinDays": 45,
    "minRecentMedianViews": 2_000,
}
Enter fullscreen mode Exit fullscreen mode

The Actor samples a bounded number of recent videos per candidate. It calculates cadence over 30 and 90 days, then computes recent median and average views from the available sample.

Median views are especially useful because one viral upload can inflate the average. You should still inspect the sample size and warnings before treating any metric as complete.

Filter by content format

The same niche can contain very different production workflows. A thumbnail agency may want long-form channels. A vertical-video editor may want Shorts-heavy creators. A webinar platform may prefer live streams.

{
    "contentFormats": ["long-form"]
}
Enter fullscreen mode Exit fullscreen mode

The output exposes shortsRatio, longFormRatio, liveRatio, and formatConfidence. Shorts detection from the official API uses a documented duration heuristic, so the Dataset can include a warning instead of pretending the classification is exact.

Treat public contacts as evidence, not enrichment

A YouTube email finder can mean two very different things:

  1. collect a business email the creator explicitly published; or
  2. reveal or guess an address the creator did not expose.

This workflow only does the first.

{
    "preset": "contact_ready",
    "requirePublicBusinessContact": True,
    "contactTypes": ["business_email", "website", "social"],
}
Enter fullscreen mode Exit fullscreen mode

Each returned contact keeps its type, value, source URL, collection time, public status, and confidence. The current provider reads public channel text. It does not access YouTube’s protected business-email field, bypass CAPTCHA, sign in, guess private addresses, or fetch linked websites.

If a protected email is unavailable, that absence is a real result. It should not be replaced by a guessed pattern.

Export to CSV without flattening away the evidence

Apify can export the Dataset directly to CSV, JSON, or Excel. If you need a small CSV for manual review, keep the qualification and provenance columns:

import csv

columns = [
    "channelId",
    "channelName",
    "channelUrl",
    "primaryLanguage",
    "declaredCountry",
    "subscriberCount",
    "lastUploadAt",
    "estimatedVideosPerMonth",
    "recentMedianViews",
    "publicBusinessEmail",
    "contactSourceUrl",
    "opportunityScore",
]

with open("youtube-creators.csv", "w", newline="", encoding="utf-8") as file:
    writer = csv.DictWriter(file, fieldnames=columns, extrasaction="ignore")
    writer.writeheader()
    writer.writerows(items)
Enter fullscreen mode Exit fullscreen mode

Do not drop contactSourceUrl, opportunityReasons, or warnings in the production pipeline. They are what let a human review why a creator qualified and where a contact came from.

Keep the run bounded

YouTube discovery has quota and latency costs. A sensible workflow performs cheap discovery first, then enriches only the best candidates.

Start small:

  • 5–10 qualified channels;
  • 5–10 recent videos checked per channel;
  • one or two niches;
  • a bounded search-call budget;
  • no public-contact requirement until you confirm the niche produces enough candidates.

Then tighten the filters. Requiring a contact, high cadence, high median views, a narrow country, and a small subscriber band all at once can correctly return zero rows.

Try the preconfigured YouTube channel finder

The quickest path is the public YouTube Channel Finder by Niche Task. It opens with a bounded, editable input and the qualified-creator Dataset view:

Run the YouTube Channel Finder by Niche

For all filters, output fields, limits, and live pricing, use the full YouTube Creator Lead Finder.

The useful output is not a longer list. It is a list you can explain, review, and act on.

Top comments (0)