Announcements
From 28th September 2026, Community private messages will no longer be available. If you have any private messages you'd like to keep, please save or copy them using these steps before this date. Thank you.

Help Wizard

Step 1

NEXT STEP

Spotify Recently Played filter fields

Spotify Recently Played filter fields

Plan

Premium

Country

United Kingdom

Device

Macbook Pro M1

Operating System

macOS Ventura 13.2.1

 

My Question or Issue

I want to grab the recently played songs. My query currently is this.

https://api.spotify.com/v1/me/player/recently-played?limit=20&after=1695243480480

 This returns something like this:

{
"items": [{
"track": {
"album": {...},
"artists": [...],
"available_markets": [...],
"disc_number": 1,
"duration_ms": 202212,
"explicit": false,
"external_ids": {...},
"external_urls": {...},
"href": "https://api.spotify.com/track/a-track",
"id": "an id string",
"is_local": false,
"name": "Song name",
"popularity": 100,
"preview_url": "https://preview.url",
"track_number": 1,
"type": "track",
"uri": "spotify:track:id"
"played_at": timestamp,
"context": None
}
}]

However, I am only interested in grabbing the song name, when it was played at and the artists. I tried to edit my query to:

 

"https://api.spotify.com/v1/me/player/recently-played?fields=items(track(name, artists), played_at)&limit=20&after=1695243480480"

but this doesn't work. How can I do this?
 

Reply
1 Reply

Ah! I think I've finally figured it out after lots of trial and error. It's:

"https://api.spotify.com/v1/me/player/recently-played?fields=track.name,track.artists.name,track.artists.id,played_at"

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/ 5 years ago  in Social & Random