Scrape data from YouTube

YouTube's public pages hold a lot you might want in a sheet, video titles and views, channel details, search and playlist results. A bot can read them off the page for you. YouTube also has a strong official API, so the browser is for the gaps. There are three ways to start, with no code, with code, or with a Claude skill.

What I mean by scraping YouTube


Scraping YouTube means a bot reads public video and channel data off the page into a sheet. The title, views, and date of a video, the videos in a search or a playlist, a channel's public details. Point it at a search or a list of videos and it gathers the same fields, so research that meant opening tabs becomes rows you can sort.

The Data API is the front door


Be honest about the official route first. YouTube has a proper Data API that returns video, channel, and search data cleanly, and for anything structured or large it is the right tool, built to be queried in volume.

So the browser is for the gaps. A quick scrape of a search or a page without setting up API keys, something the API rate-limits or does not expose neatly, or a one-off pull where code against an endpoint is more than the job needs. For heavy, repeated data work, learn the API. For the quick and occasional, read the page. Either way, stay on public data and the video text, not the videos themselves.

Who this is for


This is for the person gathering public YouTube data for their own work. A researcher tracking videos on a topic, a marketer mapping a niche, an analyst pulling public view counts. Public data, into a sheet. No-coders and coders both, since you can build it without code and drop into code when you want.

How I'd approach it


Decide between the API and the page. For volume, use the Data API. For a quick pull, open the search or playlist you want and have the bot read the title, channel, and views of each into a sheet, then page or scroll for more. Keep the pace reasonable and take the public fields, not the video files.

API for volume, the page for quick pulls. I would lay out the first draft with Build with description.

Scrape YouTube from a description


Describe what you want in plain words in the Chrome extension and it builds the steps for you. Give it a few short lines, check what it made, and run it. Explore no-code.

To the right is an example. Describe the search or playlist, and the AI lays out the steps.

Chrome extension
Describe your automation

Instructions

  • Open the YouTube search or playlist35 / 500
  • Scroll to load the results26 / 500
  • Scrape the title, channel, and views of each44 / 500
  • Grab the link to each video27 / 500
  • Write them to a Google Sheet28 / 500

Scrape YouTube in code


Build with code. If you would rather script it yourself, this is the path. Explore code

Connect Playwright (or Puppeteer) to our cloud Chromium and write the same scripts you'd run locally, without managing the browser.

Code tool
Code example
import { chromium } from "playwright";

const browser = await chromium.connectOverCDP(
  `wss://cdp-lb.axiom.ai/?token=${process.env.AXIOM_API_KEY}`
);

try {
  const context = browser.contexts()[0];
  const page = context.pages()[0] ?? await context.newPage();

  await page.goto("https://www.youtube.com/results?search_query=web+scraping");
  await page.waitForSelector("ytd-video-renderer");

  // Read the public video details off the results
  const videos = await page.$$eval("ytd-video-renderer", els =>
    els.map(el => ({
      title:   el.querySelector("#video-title")?.textContent.trim(),
      channel: el.querySelector("#channel-name")?.textContent.trim(),
      link:    el.querySelector("#video-title")?.getAttribute("href"),
    }))
  );

  console.log(videos); // write these to your sheet
} finally {
  await browser.close();
}

Build with a Claude skill

Build no-code or code bots with a skill.

Add the Claude skill and describe the public YouTube data you want. It builds the scraper for you, no-code or code, into a sheet.

Claude building a YouTube scraper from a description

What can you scrape?


Public video data, into a sheet. A couple of cases worth knowing first.

Works well

  • Video titles, channels, and views
  • Search and playlist results
  • Public channel details
  • Links to gather elsewhere
  • Running it on a schedule

Harder

  • Comments at any real volume
  • Counts that load after the page
  • Results that load as you scroll

Don't try

  • Downloading videos against the terms
  • Scraping personal data for spam
  • Anything against YouTube's terms

What I'd watch out for


YouTube has a strong API, so the browser is the fallback, not the first choice. Here is what I would watch for.

API for volume

For structured or repeated data work, the Data API beats scraping the page. Use the browser for quick, occasional pulls and the gaps.

Read text, not the video

Gather the title, channel, and views, not the video file. Downloading videos is a different thing, and against the terms.

Wait for the counts

View counts and other numbers can load after the page. Wait for them before reading, or you will scrape a blank.

Pick fields reliably

YouTube changes its markup, so pick what you read with the selector tool and recheck as you scroll.

"I was skeptical about no-code automation, but Axiom proved me wrong. It's incredibly powerful."

David Wilson

"The best investment we've made in our automation workflow. Simple yet powerful."

Jennifer Brown

"The support team is amazing, and the product just keeps getting better. Worth every penny."

Emma Davis

"Finally, a tool that makes browser automation accessible without compromising on power. Highly recommended!"

Michael Chen

"Axiom has saved me countless hours. The automation possibilities are endless."

Robert Taylor

"The best browser automation tool I've used. The AI features are game-changing for complex workflows."

Sarah Johnson

"Axiom has completely transformed how I handle browser automation. The no-code interface is intuitive and powerful."

John Smith

Fast to build. Easy to run and scale. Outstanding support.

Start for free. No credit card required.