YouTube SEO Pipeline
I built a YouTube SEO tool that researches keywords, studies the competition, writes titles, descriptions and tags, and scores them from 0 to 100 before anything is published.
The problem
Publishing videos at volume means writing a title, description and tags for every one and guessing which keywords are worth targeting. I wanted that step to be repeatable, scored and measurable instead of done by feel.
How I built it
A Python pipeline in stages: keyword research (YouTube Suggest, the YouTube Data API, Google Trends and competitor tag mining), competition analysis of the top 20 results for a keyword, GPT-4o metadata generation, then a 0 to 100 scorer that weights title, description, tags, thumbnail, engagement and freshness, with an improve loop that regenerates weak metadata. The plan set a hard floor of 75 before anything could be uploaded. It runs from a command line or a FastAPI dashboard, supports five languages (English, Spanish, Arabic, German, French), and keeps a log of how published videos performed so later runs can learn from it.
What got hard
- YouTube's API quota is small (10,000 units a day) and one search call costs 100 of them.
I built a quota-aware client that tracks the cost of each call type, caches keyword and video lookups in SQLite so repeat research is free, and draws on the free Suggest and Trends sources alongside the paid API calls.
- A pipeline that carries on while the AI service, the API or the network is down produces junk metadata that is worse than no output.
Health checks run before every pipeline run. If a critical dependency is down the pipeline halts and sends an email alert instead of generating anything.
- API calls fail in bursts (rate limits and timeouts).
The client backs off exponentially with jitter, honours rate-limit responses, and opens a circuit breaker after three consecutive failures.
The result
A working CLI and web dashboard of about 2,900 lines across the seo modules, with endpoints for research, competition, optimise, score, trends, rank tracking and performance logging. The project's cache shows 40 keywords and 40 competitor videos analysed in testing.
The ← and → keys turn the page too.