YouTube Music Scraper
Spider read music.youtube.com in 115 ms without a browser and returned 32 lines of clean markdown, including the section "Before you continue to YouTube".
# Before you continue to YouTube* Deliver and maintain Google services* Track outages and protect against spam, fraud, and abuse* Measure audience engagement and site statistics to understand how our services are used and enhance the quality of those servicesIf you choose to “Accept all,” we will also use cookies and data, including IP addresses, to* Develop and improve new services* Deliver and measure the effectiveness of ads* Show personalized content, depending on your settings* Show personalized ads, depending on your settingsIf you choose to “Reject all,” we will not use cookies or IP addresses for these additional purposes.Non-personalized content and ads are influenced by things like the content you’re currently viewing and your location (ad serving is based on general location). Personalized content and ads can also include things like video recommendations, a customized YouTube homepage, and tailored ads based on past activity, like the videos you watch and the things you search for on YouTube. We also use cookies and data to tailor the experience to be age-appropriate, if relevant.Select “More options” to see additional information, including details about managing your privacy settings. You can also visit g.co/privacytools at any time. The same call, in code.
The capture above came back as markdown. These examples add a key, so you get browser rendering, proxies, and concurrency on music.youtube.com.
import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://music.youtube.com/charts");
// No selectors, no schema. Spider reads the page and names the fields.
const data = await page.scrape();
console.log(data);
await spider.close(); import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
stealth: 2,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://music.youtube.com/charts");
await page.content(12000);
const data = await page.evaluate(`(() => {
const tracks = [];
document.querySelectorAll("a[href*='watch?v=']").forEach(a => {
const title = a.getAttribute("title") || a.textContent?.trim()?.slice(0, 80);
const href = a.getAttribute("href");
if (title && title.length > 2 && href && !tracks.find(t => t.href === href)) {
tracks.push({ title, href });
}
});
return JSON.stringify({ total: tracks.length, tracks: tracks.slice(0, 15) });
})()`);
console.log(JSON.parse(data));
await spider.close(); Ready for volume? Get an API key →
Fields you can pull.
Spider names these from the page. The capture above came back as markdown; the same
call with return_format: "json" returns them as keys.
What music.youtube.com costs to scrape.
The capture above cost $0.000906 to fetch. Pricing is $1 per GB of pre-transformation bandwidth plus $0.001 per CPU minute, so a page like this one lands at a fraction of a cent. Failed requests are billed at $0.
- Free balance on signup
- No card required to test
- Balance never expires
Run it keyless, no account
More Music & Podcasts scrapers.
Spotify Music Scraper
Extract playlist tracks, artist profiles, album metadata, and popularity scores from Spotify open web player.
Apple Music Scraper
Extract album tracklists, artist discographies, playlist contents, and editorial notes from Apple Music catalog.
Deezer Scraper
Extract music catalogs, playlist data, artist bios, and chart rankings from Deezer streaming platform.
Start scraping music.youtube.com.
You already have the call. A key raises the rate limit and turns on browser rendering, proxies, and concurrency. Balance never expires, and top-ups go through secure checkout.