Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

403 forbidden errors

403 forbidden errors

# Spotify API Bug Report

**Reporter:** DJ/Developer using Spotify API for music library analysis
**Date:** October 13, 2025
**Environment:** macOS, Python 3.9, Spotipy library

---

## Summary

Multiple critical issues encountered when using Spotify Web API for DJ music library analysis and playlist management. The API returns numerous 403 Forbidden and 404 Not Found errors for standard operations, preventing legitimate use cases.

---

## Issues Encountered

### 1. **403 Forbidden Errors on Audio Features Endpoint**

**Endpoint:** `GET /v1/audio-features`
**HTTP Status:** 403 Forbidden
**Code:** -1

**Description:**
Consistently receiving 403 errors when attempting to fetch audio features (BPM, energy, key, danceability, valence) for tracks, even with proper user authentication (OAuth with all required scopes).

**Authentication Used:**
- OAuth 2.0 with SpotifyOAuth
- Scopes: `user-library-read`, `playlist-read-private`, `playlist-modify-public`, `playlist-modify-private`, `user-top-read`
- Redirect URI: `http://127.0.0.1:8888/callback`
- Valid access token with proper cache

**Impact:**
- **CRITICAL** - Cannot access BPM, key, or energy data for intelligent playlist curation
- Blocks DJ-specific use cases requiring musical analysis
- No alternative API endpoint available for this data

**Example Error:**
```
HTTP Error for GET to https://api.spotify.com/v1/audio-features/?ids=2Kt9BxrGKoFF9QPueruRe5,1GJLqaSf3YAHzHlnrFjeCS,...
returned 403 due to Forbidden
```

**Affected Operations:**
- Analyzed 76 playlists (all failed to retrieve audio features)
- ~10,000+ individual track audio feature requests (all 403 errors)

---

### 2. **403 Forbidden Errors on Playlist Modification for Curated Playlists**

**Endpoint:** `POST /v1/playlists/{playlist_id}/tracks`
**HTTP Status:** 403 Forbidden

**Description:**
Attempting to add tracks to playlists returns 403 Forbidden errors for Spotify-curated playlists (e.g., "EDM Essentials 2025", "90s HITS | TOP 100 SONGS").

**Impact:**
- **MEDIUM** - Clear distinction between user-owned and Spotify-curated playlists not documented
- Error message doesn't specify that the playlist is read-only
- Expected behavior: API should return 403 with clear message "Cannot modify Spotify-curated playlists"

**Expected Fix:**
Better error messaging: "This is a Spotify-curated playlist and cannot be modified."

---

### 3. **404 Not Found Errors on Related Artists Endpoint**

**Endpoint:** `GET /v1/artists/{artist_id}/related-artists`
**HTTP Status:** 404 Not Found

**Description:**
Valid artist IDs (obtained from search results) return 404 errors when requesting related artists.

**Examples:**
- Artist ID: `0GMRc9IPm7gm3Oripjg61B` (438 Tok) - 404
- Artist ID: `6zFYqv1mOsgBRQbae3JJ9e` (Billy Joel) - 404
- Artist ID: `5me0Irg2ANcsgc93uaYrpb` (Big K.R.I.T.) - 404
- Artist ID: `4LLpKhyESsyAXpc4laK94U` (Mac Miller) - 404

**Impact:**
- **MEDIUM** - Cannot discover similar artists
- Artist IDs obtained from valid API responses return 404 on related operations
- Inconsistent API behavior

---

### 4. **404 Not Found Errors on Recommendations Endpoint**

**Endpoint:** `GET /v1/recommendations`
**HTTP Status:** 404 Not Found

**Description:**
Recommendations endpoint returns 404 even with valid seed tracks.

**Request:**
```
GET /v1/recommendations?limit=50&seed_tracks=5oyukJiHDBC6wsnH9GrnpO,6JRkAKkm7XkSuXF09uSBOX,3UYuDTslR35thjQzaVwRMe,4mRWfv84isuvVRvsfDxhQx
```

**Impact:**
- **HIGH** - Cannot generate personalized recommendations
- Blocks AI-driven music discovery features
- Seed tracks are valid Spotify URIs from user's library

---

## Use Case Context

**Application:** DJ Music Library Manager
**Purpose:**
- Analyze DJ's existing music collection (3,574 Rekordbox tracks)
- Match tracks by BPM, key, and energy for intelligent mixing
- Create genre-specific and vibe-based playlists
- Discover new music similar to frequently played tracks
- Enhance 76 existing playlists with compatible tracks

**Why These APIs Are Critical:**
1. **Audio Features** - Essential for BPM/key matching in DJ mixing
2. **Related Artists** - Discovery of new artists with similar sound
3. **Recommendations** - Intelligent track suggestions based on DJ style

---

## Workarounds Implemented

Due to API limitations, we had to implement suboptimal workarounds:

1. **Audio Features Workaround:**
- Used Rekordbox play history instead of Spotify audio features
- Keyword-based genre/mood matching (less accurate)
- Lost ability to match by BPM, key, energy

2. **Related Artists Workaround:**
- Manual artist research
- No programmatic discovery

3. **Recommendations Workaround:**
- Based recommendations solely on play count
- No intelligent music discovery

---

## Expected Behavior

1. **Audio Features:** Should return BPM, energy, key, danceability, valence for valid track IDs with proper authentication
2. **Related Artists:** Should return related artists for valid artist IDs
3. **Recommendations:** Should return track recommendations for valid seed tracks
4. **Playlist Modifications:** Should provide clear error messages distinguishing user-owned vs. curated playlists

---

## Technical Details

**Client Library:** Spotipy v2.x
**Python:** 3.9
**OS:** macOS 14.6.0
**Authentication:** OAuth 2.0 (SpotifyOAuth)
**Rate Limiting:** Implemented delays (0.5s between requests)
**Retry Logic:** Standard HTTP retry with exponential backoff

---

## Request for Action

1. **Investigate 403 errors on audio features endpoint** - This is the most critical issue
2. **Clarify API access requirements** - Is there a DJ/professional tier needed?
3. **Improve error messaging** - Specify why requests are forbidden
4. **Fix 404 errors on valid artist IDs** - Inconsistent behavior
5. **Document limitations** - Clearly state which endpoints require specific access levels

---

## Impact on Developer Community

These issues affect legitimate use cases:
- ‚úÖ **DJ software integration** (BPM/key matching)
- ‚úÖ **Music analysis tools** (energy/mood classification)
- ‚úÖ **Smart playlist generation** (compatibility matching)
- ‚úÖ **Music discovery applications** (similar artists/tracks)

---

## Supporting Data

**Successfully Completed Despite API Issues:**
- Analyzed 76 playlists
- Integrated 705 Rekordbox tracks based on play history
- Identified 79 priority tracks for acquisition
- Processed 3,574 Rekordbox tracks
- Managed 1,114 music files

**Could Have Been Better With Working APIs:**
- BPM/key-based matching for intelligent mixing
- Energy-level analysis for vibe-based playlists
- Cross-genre discovery based on musical features
- Personalized recommendations for DJ style

---

## Contact

If Spotify Engineering needs:
- Additional logs
- Reproduction steps
- API call traces
- Sample code

Please contact via Spotify Developer Forums or GitHub.

---

## Appendix: Error Logs

### Sample 403 Error (Audio Features)
```
HTTP Error for GET to https://api.spotify.com/v1/audio-features/?ids=...
returned 403 due to Forbidden
None, reason: None
```

### Sample 404 Error (Related Artists)
```
HTTP Error for GET to https://api.spotify.com/v1/artists/0GMRc9IPm7gm3Oripjg61B/related-artists
returned 404 due to Not Found
None, reason: None
```

### Sample 404 Error (Recommendations)
```
HTTP Error for GET to https://api.spotify.com/v1/recommendations?limit=50&seed_tracks=...
returned 404 due to None
None, reason: None
```

---

**Thank you for your attention to these issues. A working audio features API would significantly improve DJ and music analysis applications built on Spotify's platform.**

 

Reply
1 Reply

Hi @idirectships 

Thanks for the extensive big report, and Welcome to Spotify Community!

 

The errors you are experiencing are all caused by changes made to the Web API last year. You can read about it on this page.

I hope this clears things up. If you have further questions, feel free to ask!

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random