# How to Automate Spotify Listening Reports using the API

- Tool: API Automations
- Difficulty: Beginner
- Fix time: 15-30 minutes
- Compatibility: OAuth 2.0 — Development Mode (max 5 authorized users, app owner must have Spotify Premium)
- Last updated: May 2026

## TL;DR

Generate Spotify listening reports using GET /v1/me/top/tracks and GET /v1/me/top/artists with time_range=short_term|medium_term|long_term, plus GET /v1/me/player/recently-played for up to 50 recent plays. Important: recently-played returns only ~50 items with no way to paginate further back. The deprecated Audio Features endpoint (GET /v1/audio-features) returns 403 for apps created after November 27, 2024 — tempo, energy, danceability, and valence cannot be included in reports for new apps.

## Best practices

- Always request all three time ranges in a single run — it only costs 6 extra API calls and provides much richer report content
- Make the absence of audio features data explicit in your reports — note that tempo, energy, and danceability are unavailable for apps created after November 27, 2024, so users don't think the report is broken
- Handle the 204 (no content) response from recently-played gracefully — new Spotify accounts or users who haven't played anything recently will trigger it
- Save reports with dated filenames to build a historical archive — the API provides no way to retrieve historical top-item data retroactively
- Use genre aggregation from top artists as the primary taste-characterization signal, since audio features are no longer available
- Test with your own account first (in Development Mode) before building a multi-user report service that would require Extended Quota approval

## Frequently asked questions

### Is the Spotify API free for generating listening reports?

Yes — the Spotify Web API is free to use. In Development Mode you are limited to 5 authorized users per Client ID (as of February 11, 2026) and the app owner must have Spotify Premium. This is sufficient for personal use or small team applications.

### Why can't I include tempo, energy, or danceability in my listening reports?

GET /v1/audio-features was permanently deprecated for apps created after November 27, 2024 and returns HTTP 403. This includes tempo, energy, danceability, valence, instrumentalness, and all other audio analysis properties. These endpoints are still accessible to grandfathered Extended Quota apps that existed before that date. For new apps, use genre data from top artists as the alternative for taste characterization.

### Can I retrieve more than 50 recently played tracks for my report?

No — GET /v1/me/player/recently-played has a hard limit of ~50 items and cannot be paginated further back. The before and after cursor parameters only move within this ~50-item window. There is no Spotify API endpoint that provides complete historical listening data. The top tracks endpoints (short_term, medium_term, long_term) are the best proxy for longer-term listening patterns.

### What exactly does 'short_term' mean for the time_range parameter?

Spotify describes short_term as 'approximately last 4 weeks', medium_term as 'approximately last 6 months', and long_term as 'calculated from several years of data and including all new data as it becomes available'. These are Spotify's descriptions — the exact algorithm for determining top items is proprietary and not publicly documented.

### What happens when I hit the rate limit?

You receive HTTP 429 with a Retry-After header. A single-user report generation uses only ~7 API calls and is extremely unlikely to trigger rate limits. Multi-user report generation is where rate limiting becomes relevant — add 1-second delays between each user's batch of requests.

### Can RapidDev help build a custom Spotify listening report tool?

Yes — RapidDev has built 600+ integrations and can create a production Spotify analytics dashboard with OAuth flow, scheduled report generation, historical data storage, and trend visualization. Reach out at rapidevelopers.com for a free consultation.

### Does Spotify have a webhook I can use to trigger report generation when a user plays a new track?

No — Spotify has no webhook system for the Web API. There is no way to receive a push notification when a user plays a track. Report generation must be scheduled (e.g., monthly cron) or triggered manually. The Web Playback SDK offers in-browser player events, but only while your web page is actively open and the user is using your embedded player.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-spotify-listening-reports-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-spotify-listening-reports-using-the-api
