2026-07-23 · python · youtube · search · pandas
Export YouTube search results to CSV with Python and pandas
Turn keywords into a pandas DataFrame and out to CSV: up to 50 queries in, one row per result — video, channel, playlist, or Shorts under type: all — with its canonical URL plus type-specific fields. The script requests videos, which carry duration and the audience display field (lifetime views, or a watching count on live rows). Dedupe and failure-row handling, and cost math ($0.20 per 1,000 results) — queries that return nothing cost $0.