[Python] How to get albums' URIs in an automatic way - Spotify API

Discussão em 'Python' iniciado por Stack, Março 10, 2025.

  1. Stack

    Stack Membro Participativo

    Good morning. I created this morning a program in python which, giving in input the URI of an album, gives me back the list of the tracks present in that album (using the Spotify API). Following I continued the program in order to download the features of the songs in that list.

    Since I need to perform this operation for several albums, I then created a json file with all the URIs of all the albums I need and with a FOR cycle I extracted all the tracks for each album (and then I extracted the songs features).

    The problem is: if I have to download the track list of for example 500 albums, how can I get the URIs of each album in an automatic way? It seems impossible to get each URI by hand.

    Maybe there is a way to give in input the list of track names and, exploiting the API, receive as output directly the features of those songs? Or maybe there is a way of giving in input the list of the albums' names and receive as output the URIs? Thank you.

    I tried to start getting all the URIs by hand, but it's too slow and not very scalable (maybe one day I need to download the tracks of a thousand of albums..).

    EDIT: ------------------------------------------------------- Here's the code.

    first part

    second part

    Continue reading...

Compartilhe esta Página