YouTube Channel Scraper: How to Vet Sponsorship Partners with Python
You can vet a YouTube creator for sponsorship without relying on their media kit: export the channel's public profile and its recent video records, normalize both into a single dated snapshot, and score four things that public counts actually support — upload consistency, view reliability, engagement proxy, and momentum. This guide is for brand partnership managers, agency media buyers, and growth engineers who need to compare 20 or 200 channels on the same terms instead of reading 200 PDFs with incompatible numbers.
The workflow below uses two repositories from the data-scrape account: a YouTube channel scraper for channel-level records and video URLs, and a YouTube video scraper API that serves per-video details with pagination. Neither repository replaces your judgment. They replace the spreadsheet.
TL;DR
- Pull channel-level fields (subscribers, total views, video count, creation date, video URLs) once per channel per run.
- Pull per-video stats for the last 12-20 uploads, not the channel's best 12-20 uploads.
- Compute four metrics: uploads per month, median views, engagement proxy, and momentum (recent half vs prior half).
- Store every run as an immutable, date-stamped JSON snapshot so a later disagreement can be resolved with evidence.
- Treat the score as a triage filter. It decides who gets a human review, not who gets the contract.
Why media kits are a weak vetting input
A media kit is a marketing document, and that is fine — it is just not a dataset. Four problems show up in almost every partnership review.
The window is chosen after the results. A creator whose one breakout video landed in March will show you March. Your campaign is in December, and the kit cannot tell you what the last 90 days looked like.
The denominator is undefined. "Engagement rate 7.2%" can mean likes divided by followers, likes plus comments divided by views, or interactions divided by reach. Two kits using different denominators are not comparable, and the difference is often large enough to reverse a ranking.
Outliers are not handled. One algorithmic push can dwarf a year of normal uploads, and a kit will quote the push.
Nothing is reproducible. Six weeks later, nobody can re-derive the number that justified the spend. When the campaign underperforms, there is no baseline to argue against.
A public-record snapshot fixes all four, not because public data is more accurate than the creator's own analytics — it is not — but because it is consistent, dated, and re-runnable across every channel in your list.
What public data can and cannot answer
Be strict about this boundary before you build anything. Public counts support comparison; they do not support prediction.
| Vetting question | Public records | Reality |
|---|---|---|
| How often does the channel publish? | Yes | Upload timestamps are public |
| What is typical reach per video? | Yes | View counts are public, but they keep moving |
| Do viewers interact? | Partly | Likes and comments are public when enabled; dislikes are not |
| Is the audience in my target market? | No | Requires the creator's own audience geography |
| What is average watch time? | No | Visible only in the creator's analytics |
| Are subscribers authentic? | No | No public signal can prove this |
| Is the channel brand-safe? | Partly | Titles and descriptions help; full video review still needs a human |
| Has the creator promoted competitors? | Partly | Detectable from titles and descriptions when disclosed |
If a vendor promises the "No" rows from public data alone, they are guessing; the scorecard below sticks to "Yes" and "Partly".
How the two repositories fit together
The YouTube channel scraper repository handles channel-level extraction: channel name, subscriber count, video count, total views, description, banner and profile images, creation date, video URLs, and playlists with video counts. That is your roster layer — one record per channel, plus the list of video URLs you will sample.
The YouTube video scraper API repository handles the per-video layer: video details, comments, search, and channel endpoints behind a JSON service with pagination, API-key authentication, and batch lookup. It is documented as Docker-ready with Swagger docs, so read the served schema for the current base URL, port, and paths instead of guessing them from this article.
Each run:
- Read a roster file of channel handles or URLs.
- Export one channel record per handle, and keep the returned video URL list.
- Sort those URLs by publish date, take the most recent N, and request details for each.
- Write both layers into a dated snapshot directory:
snapshots/2026-11-22/channel.json,videos.json. - Compute metrics from the snapshot, never from live calls, so the numbers in your memo can be reproduced later.
Step 5 is the one people skip, and it is the one that makes the workflow defensible.
Setup
Install both repositories in editable mode so you can patch field mappings without forking:
git clone https://github.com/data-scrape/youtube-channel-scraper.git cd youtube-channel-scraper pip install -e . git clone https://github.com/data-scrape/youtube-video-scraper-api.git cd youtube-video-scraper-api pip install -e . Configure the service through environment variables rather than editing source:
export YT_API_BASE_URL="http://127.0.0.1:8000" # confirm host, port, and paths in the repo README or Swagger UI export YT_API_KEY="your-service-key" # only if your deployment enables API-key auth export ROSTER_PATH="roster.txt" export SNAPSHOT_DIR="snapshots/2026-11-22" Keep the roster as plain text, one handle per line — the only file a non-engineer needs to touch.
The data contract
Every downstream bug in this kind of pipeline comes from treating the export as fixed. Define your own normalized schema and map into it. Split across channel.json and videos.json, the workflow expects this shape — rename the fields to match your export:
{ "channel": { "handle": "@example", "name": "Example Studio", "subscribers": 184000, "total_views": 41200000, "video_count": 310, "created_at": "2017-04-11", "video_urls": ["https://www.youtube.com/watch?v=VIDEO_ID_1"] }, "videos": [ { "video_id": "VIDEO_ID_1", "title": "Example title", "published_at": "2026-11-14T09:00:00Z", "views": 21300, "likes": 940, "comments": 61 } ] } Two rules keep this honest: missing likes or comments become None, never 0 — a video with comments disabled is not a video with zero comments. And views is recorded as an observation at a timestamp, because it is not a fixed property of the video.
Runnable Python: from snapshot to scorecard
The script below uses only the standard library. It reads a snapshot directory, computes the four metrics, and prints one scorecard row. Save it as scorecard.py and run SNAPSHOT_DIR=snapshots/2026-11-22 python scorecard.py. If the directory is missing, it falls back to embedded example records so you can see the output shape immediately.
import json import os import pathlib import statistics from datetime import datetime SNAPSHOT = pathlib.Path(os.environ.get("SNAPSHOT_DIR", "snapshots/demo")) WINDOW_DAYS = int(os.environ.get("WINDOW_DAYS", "180")) SAMPLE_SIZE = int(os.environ.get("SAMPLE_SIZE", "12")) DEMO = { "channel": {"handle": "@demo", "name": "Demo Studio", "subscribers": 184000, "total_views": 41200000, "video_count": 310}, "videos": [ {"video_id": f"v{i}", "published_at": f"2026-{m:02d}-{d:02d}T09:00:00Z", "views": v, "likes": l, "comments": c} for i, (m, d, v, l, c) in enumerate([ (11, 14, 21300, 940, 61), (11, 7, 18700, 810, 48), (10, 29, 26400, 1290, 92), (10, 21, 9800, 380, 21), (10, 12, 17600, 740, 39), (10, 3, 15900, 690, 44), (9, 24, 14200, 610, 30), (9, 16, 22500, 1010, 73), (9, 7, 16800, 720, 41), (8, 30, 15100, 650, 35), (8, 21, 13400, 560, 28), (8, 12, 14900, 600, 33), (8, 3, 11600, 470, 19), (7, 25, 12300, 500, 24), (7, 16, 10800, 430, 18), ]) ], } def load_snapshot(path): """Read channel.json + videos.json, or fall back to labeled demo records.""" channel_file, videos_file = path / "channel.json", path / "videos.json" if not channel_file.exists() or not videos_file.exists(): print(f"[demo] No snapshot at {path}; using illustrative records (not real channel data).") return DEMO["channel"], DEMO["videos"] channel = json.loads(channel_file.read_text(encoding="utf-8")) videos = json.loads(videos_file.read_text(encoding="utf-8")) if isinstance(videos, dict): videos = videos.get("videos", []) return channel, videos def published(video): return datetime.fromisoformat(video["published_at"].replace("Z", "+00:00")) def pct(value): return f"{value * 100:.1f}%" if value is not None else "n/a" def scorecard(channel, videos): # Anchor the window to the newest record so a historical snapshot scores the same way later. anchor = max(published(v) for v in videos) window = [v for v in videos if (anchor - published(v)).days <= WINDOW_DAYS] window.sort(key=published, reverse=True) sample = window[:SAMPLE_SIZE] if len(sample) < 4: return None span_days = max((anchor - published(window[-1])).days, 30) uploads_per_month = len(window) / (span_days / 30.44) views = [v["views"] for v in sample if v.get("views") is not None] median_views = statistics.median(views) spread = statistics.pstdev(views) / statistics.mean(views) if len(views) > 1 else 1.0 consistency = max(0.0, 1.0 - spread) rates = [] for v in sample: if v.get("views") and v.get("likes") is not None: rates.append(((v["likes"] or 0) + (v.get("comments") or 0)) / v["views"]) engagement = statistics.median(rates) if rates else None half = max(len(sample) // 2, 2) recent_views = statistics.median([v["views"] for v in sample[:half]]) prior_views = statistics.median([v["views"] for v in sample[half:half * 2]]) if len(sample) >= 4 else None momentum = (recent_views / prior_views) if prior_views else None def scale(x, lo, hi): return 0.0 if x is None else max(0.0, min(1.0, (x - lo) / (hi - lo))) parts = { "cadence": (scale(uploads_per_month, 0.5, 8.0), 0.25), "reach": (scale(median_views, 2000, 100000), 0.30), "engagement": (scale(engagement, 0.005, 0.06), 0.25), "momentum": (scale(momentum, 0.7, 1.4), 0.20), } total = sum(v * w for v, w in parts.values()) * 100 return { "channel": channel.get("name") or channel.get("handle"), "subscribers": channel.get("subscribers"), "sample": len(sample), "uploads_per_month": uploads_per_month, "median_views": median_views, "consistency": consistency, "engagement": engagement, "momentum": momentum, "score": round(total, 1), "verdict": "shortlist" if total >= 70 else "watchlist" if total >= 45 else "pass", } if __name__ == "__main__": channel, videos = load_snapshot(SNAPSHOT) print(f"{'channel':<18}{'subs':>9}{'n':>4}{'upl/mo':>8}{'med.views':>11}" f"{'eng.':>8}{'mom.':>7}{'score':>7} verdict") print("-" * 82) result = scorecard(channel, videos) if not result: raise SystemExit("Not enough dated videos in the window to score this channel.") print(f"{str(result['channel'])[:17]:<18}{result['subscribers'] or 0:>9,}" f"{result['sample']:>4}{result['uploads_per_month']:>8.1f}" f"{int(result['median_views']):>11,}{pct(result['engagement']):>8}" f"{(result['momentum'] or 0):>6.2f}x{result['score']:>7} {result['verdict']}") Run it across a roster by looping the directory and sorting by score, but keep the raw metrics in the output — a reviewer needs to see why a channel landed where it did.
Representative output
The demo records above produce this, and a real channel produces the same shape with different numbers:
channel subs n upl/mo med.views eng. mom. score verdict ---------------------------------------------------------------------------------- Demo Studio 184,000 12 3.8 16,350 4.5% 1.21x 48.2 watchlist Read it as a summary, not a verdict: 3.8 uploads per month across the observed window, a median of 16,350 views on the last 12 uploads, a 4.5% median interaction-to-view ratio, and recent videos performing about 21% better than the prior batch. Strong interaction and rising momentum still land at 48, because reach is the weakest component at this scale. For a niche B2B placement that is a watchlist; for a reach campaign it is a pass — and now you can say why in one sentence.
How the score is weighted, and why
| Component | Weight | Source field | Why it matters for sponsorship |
|---|---|---|---|
| Cadence | 25% | Publish dates | Low cadence means fewer guaranteed impressions during a campaign window |
| Reach | 30% | Median views on last N uploads | Median resists the single viral outlier that a media kit quotes |
| Engagement proxy | 25% | Likes + comments / views | Signals active audience, not just accumulated subscribers |
| Momentum | 20% | Recent half vs prior half | Detects a channel that is declining while its subscriber total still looks healthy |
Two choices worth defending. Median replaces mean everywhere, because one 2M-view video can double a mean and say nothing about the next four uploads. Consistency is computed but not scored: it shows whether "median 16k" means 14-18k every time or 3k-to-60k swings, which changes campaign risk more than the score does.
Tune the bands to your category. A B2B software channel with 3,000 median views can be an excellent buy; a consumer impulse product needs reach. Hard-coded thresholds are a starting point, not a standard.
Comparison: three ways to get the same snapshot
| Approach | Setup | Refresh | Audit trail | Maintenance |
|---|---|---|---|---|
| Hand-built spreadsheet | None | Manual | Screenshots, if kept | Breaks when the person leaves |
| Channel + video repositories, scripted | An afternoon | Cron or CI job | Dated JSON snapshots in git | Field mapping and layout changes |
| Managed scraping API | Account and key | Scheduled by provider | Provider-side logs | Provider handles extraction |
The middle row is the reason this article exists: it is reproducible without a vendor contract, and the snapshot directory is the evidence. The third row is usually right when you need coverage across many platforms, not just YouTube — verify current pricing and quotas on the provider's own page rather than in a blog post, including this one. The first row is fine for one channel and indefensible for forty.
Where this workflow earns its keep
Category campaign shortlisting. Export 40 channels in a niche, score them, and send only the top 12 to human review. The reviewer's time goes to fit and creative, not to arithmetic.
Renewal reviews. Re-run the same script a quarter later. Momentum below 1.0 on a partner you are about to renew is a concrete, dated talking point.
Creator-side benchmarking. A creator can run the same snapshot against three competitors and see whether a reach dip is channel-specific or category-wide.
Affiliate and publisher selection. Median views and cadence predict whether a featured embed keeps producing traffic.
Limits, maintenance, and compliance
Counts drift. A view count captured today is not the count tomorrow. Always pair numbers with the snapshot date, and never compare a 30-day-old snapshot against a fresh one without saying so.
Video mix distorts medians. Shorts and long-form have different reach distributions. Segment by duration or format before comparing channels, or you will reward whoever posts more Shorts.
Attrition is real. Videos get deleted, made private, or region-blocked between runs. Keep video IDs, and log how many from the previous snapshot are now missing — a channel quietly removing sponsored videos is a signal.
Extraction breaks. Public page structures and service schemas change. Pin the repository version you validated, check the Swagger schema after upgrades, and fail loudly rather than writing partial snapshots. Respect rate limits and pagination caps; retry with backoff instead of hammering.
Compliance is not optional. Use public data only: no logged-in sessions, no private analytics, no access-control bypass, no CAPTCHA evasion. Follow YouTube's terms and any applicable API policies, keep the minimum data you need, and do not build contact lists by harvesting personal details from descriptions. If your jurisdiction requires a lawful basis for processing, document it before the first run. For a broader Chinese-language overview of scoping public video research, the guide to researching public YouTube content is a useful companion read; it is editorial material, not product documentation.
The score is not a prediction. It ranks channels on observed behavior. It cannot tell you whether the audience will like your product, and it should never be the only input to a spend decision.
Pre-outreach checklist
- [ ] Snapshot directory is dated and committed, with the script version that produced it.
- [ ] Sample is the most recent N uploads, not the top N by views.
- [ ] Likes and comments missing values are
None, not0. - [ ] Shorts and long-form are segmented or flagged.
- [ ] Median views, not mean, is quoted in the memo.
- [ ] Momentum window covers at least six recent and six prior uploads.
- [ ] At least three videos were watched by a human for brand safety.
- [ ] Media kit claims are compared against the snapshot, with differences noted.
- [ ] Data retention and deletion policy is written down.
FAQ
Is there an official YouTube API, and should I use it instead?
Yes, YouTube publishes an official Data API. It has quotas and policy terms that change, so check Google's current documentation before designing around it. The repositories here are an alternative extraction path for public records; they are not affiliated with YouTube, and they do not remove the need to comply with platform terms.
Do I need the creator's permission to collect this?
You are reading public counts, which is different from having permission to contact someone or to process their data for marketing. Sponsorship outreach needs consent and disclosure regardless of how the data was gathered. Keep the dataset minimal and document your basis for holding it.
How many videos should the sample include?
Twelve to twenty recent uploads is enough to stabilize a median for most channels. Below eight, one outlier dominates. Whatever you choose, state the sample size next to the number — "median 16k on the last 12 uploads" is a claim someone can check.
What if the channel only posts Shorts?
Score it separately. Short-form reach and cadence behave differently, and mixing formats in one ranking will systematically favor Shorts-heavy channels. Use duration as a segmentation key before scoring.
What happens when a page layout or service schema changes?
The extraction step fails or returns nulls. That is why the scoring step reads only from a snapshot: a broken run should produce no snapshot, not a partially filled one. Add a validation check that rejects snapshots where more than a small fraction of videos lack views.
Can I automate this weekly?
Yes — a scheduled job that writes a new dated snapshot and appends one row per channel to a results file works well. Keep raw snapshots immutable, and never overwrite a previous run; the history is the point.
A channel has 500k subscribers but 4k median views. What does that mean?
Usually that the subscriber count is historical and current distribution is much smaller, or that the audience is inactive. The ratio of median views to subscribers is a useful sanity check, but it is not proof of anything — bought subscribers and a genuinely dormant audience look similar from outside. Escalate to human review rather than auto-rejecting.
Next step
Clone the YouTube channel scraper for the channel layer and the video scraper API for per-video details, then run the script above against five channels you already know well. If the scores do not match your intuition, your weights are wrong for your category — fix the weights before you touch a real candidate list. More runnable examples for public web data workflows live on the data-scrape GitHub profile.
