关于通过Spotify API获取特定地区艺人/专辑粉丝数的技术问询
Great question! Let's break down what's possible with Spotify's public API, and where the hard limitations lie:
Core Reality
First off: Spotify's public API does NOT provide exact user counts like "25,000 Metallica fans in Lisbon" or "2,000 listeners of Muse's The Resistance in Barcelona".
This isn't an oversight—Spotify takes user privacy extremely seriously, and granular, region-specific follower/listener counts fall under sensitive user data that's never exposed via their public endpoints.
What You CAN Pull Instead
While exact numbers are off the table, there are useful region-related metrics you can work with:
- Artist Regional Popularity: Use the
GET /v1/artists/{id}endpoint with themarketparameter (e.g.,market=PTfor Portugal/Lisbon). The returnedpopularityfield is a 0-100 score representing the artist's relative popularity in that market (higher = more widely listened to locally). - Album Regional Popularity: Similarly,
GET /v1/albums/{id}with themarketparameter gives you an album's relative popularity score in the specified region, plus details on whether the album is even available there. - Global Follower Totals: For artists, the
followers.totalfield from the artist endpoint gives you the global number of users who follow the artist—but this can't be filtered or split by region.
Workarounds for Approximate Data
If you absolutely need region-specific audience estimates, you'd have to turn to third-party analytics tools. Keep in mind these tools only provide extrapolations based on Spotify's public data, not official exact counts. Just make sure any tool you use complies with Spotify's API terms of service.
If your goal is market comparison or content planning, the relative popularity scores are usually sufficient to gauge which artists/albums resonate more in a given region.
内容的提问来源于stack exchange,提问作者REM

