DEV Community

Алексей Спинов
Алексей Спинов

Posted on

How to Scrape Spotify, Apple Music, and SoundCloud Data

Music streaming platforms have rich data. Here is how to access each.

Spotify (Free API)

Client credentials flow — no user login needed:

const token = await getSpotifyToken(CLIENT_ID, SECRET);
const tracks = await fetch(`https://api.spotify.com/v1/search?q=web+scraping&type=track`, {
  headers: { Authorization: `Bearer ${token}` }
}).then(r => r.json());
Enter fullscreen mode Exit fullscreen mode

Apple Music (MusicKit JS)

Apple provides MusicKit for web:

// Requires Developer Token
const music = MusicKit.getInstance();
const results = await music.api.search("query", { types: "songs" });
Enter fullscreen mode Exit fullscreen mode

SoundCloud (Widget API)

SoundCloud widget API is public:

https://api-v2.soundcloud.com/search?q=QUERY&client_id=CLIENT_ID
Enter fullscreen mode Exit fullscreen mode

Comparison

Platform Free API Auth Rate Limit
Spotify Yes OAuth Generous
Apple Music Yes Token Moderate
SoundCloud Limited Client ID Strict

Resources


Need music data? $20. Email: Spinov001@gmail.com | Hire me

Top comments (0)