[GH-ISSUE #932] Get embed links? #556

Closed
opened 2026-02-27 23:23:20 +03:00 by kerem · 2 comments
Owner

Originally created by @dsm-72 on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/932

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Using BeautifulSoup to get data from Spotify is very annoying (even when using selenium) because data (e.g. playlist songs) is dynamically rendered based on intersection observers. So this library is a nice way to get all songs in a given playlist. However, they only have external links, not embedded links. It would be cool to be able, given a playlist or a list of tracks, to get the corresponding embed links.

Describe the solution you'd like
A clear and concise description of what you want to happen.

get_embeded_link(track)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Selenium + Spotipy to go to the track page and click the corresponding buttons to get the embed link.

Additional context
Add any other context or code about the feature request here.

Originally created by @dsm-72 on GitHub (Jan 22, 2023). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/932 **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Using BeautifulSoup to get data from Spotify is very annoying (even when using selenium) because data (e.g. playlist songs) is dynamically rendered based on intersection observers. So this library is a nice way to get all songs in a given playlist. However, they only have external links, not embedded links. It would be cool to be able, given a playlist or a list of tracks, to get the corresponding embed links. **Describe the solution you'd like** A clear and concise description of what you want to happen. ``` get_embeded_link(track) ``` **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. Selenium + Spotipy to go to the track page and click the corresponding buttons to get the embed link. **Additional context** Add any other context or code about the feature request here.
kerem 2026-02-27 23:23:20 +03:00
Author
Owner

@dieser-niko commented on GitHub (Jan 22, 2023):

I'm not sure if it's Spotipy's job to convert a track ID into an embed link, and so I don't think such a function will be implemented. However, you can create such a function yourself. An embed link is very easy to create:
https://open.spotify.com/embed/track/<track_id>. So with that you could write a function like this:

def get_embed_link(track_id):
    return f"https://open.spotify.com/embed/track/{track_id}"

You could also remove things like the spotify:track: prefix from the track_id, but that's up to you.

<!-- gh-comment-id:1399538987 --> @dieser-niko commented on GitHub (Jan 22, 2023): I'm not sure if it's Spotipy's job to convert a track ID into an embed link, and so I don't think such a function will be implemented. However, you can create such a function yourself. An embed link is very easy to create: `https://open.spotify.com/embed/track/<track_id>`. So with that you could write a function like this: ```python3 def get_embed_link(track_id): return f"https://open.spotify.com/embed/track/{track_id}" ``` You could also remove things like the `spotify:track:` prefix from the track_id, but that's up to you.
Author
Owner

@stephanebruckert commented on GitHub (Jan 23, 2023):

You can definitely construct an embed yourself. Note this would be the responsibility of a front-end app rather than back-end app, so probably out of scope for both spotipy or the Spotify API. For example if using react you could use https://www.npmjs.com/package/react-spotify-embed

<!-- gh-comment-id:1399656737 --> @stephanebruckert commented on GitHub (Jan 23, 2023): You can definitely construct an embed yourself. Note this would be the responsibility of a front-end app rather than back-end app, so probably out of scope for both spotipy or the Spotify API. For example if using react you could use https://www.npmjs.com/package/react-spotify-embed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#556
No description provided.