Scrape a Spotify discography into a Google Sheet


How to scrape a Spotify discography into a Google Sheet: install the Chrome extension, click Build with Browser agent, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.

Here is how the automation works. To scrape a Spotify discography, loop through artist links in a Google Sheet, open each artist's discography page, collect the album links with Get a list of links to pages from bot's current page, and in a second loop open each album and scrape its title, release date and copyright with Get data from bot's current page into another tab. Each artist is deleted from the sheet once done.

Author
Alex Barlow
Published

Build the Spotify discography from a description


Describe it and click the button: the agent builds and tests the scraper in your Chrome extension. It is a loop inside a loop: artists, then their albums.

  1. Open each artist link in the Artists tab
  2. Go to the artist's full discography
  3. Open every album and scrape the title and date
  4. Add them to the Data tab and delete the artist
Click to launch the Chrome extension. Not installed? You can create an account and try it free.Opens the Chrome extension. Free account to try.

You need a Google Sheet with two tabs: Artists, one Spotify artist URL per row in column A with no header, and Data, empty. Leave both tabs as they are while the run adds albums to Data and deletes each finished artist from Artists.

The video shows the agent building the Spotify discography scraper from the four lines above, in a few minutes.

Build the Spotify discography step by step


The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.

  • 1.0 Read data from a Google Sheet
    • Spreadsheet: your sheet
    • Sheet name: Artists, the tab with one artist link per row in column A
  • 2.0 Loop through data
    • repeats for every row in [google-sheet-data]
    • 2.1 Go to page
      • URL: the link column of [google-sheet-data] followed by /discography/all
    • 2.2 Click element
      • Select: the grid layout icon on the discography page
    • 2.3 Get a list of links to pages from bot's current page
      • Select: one album in the grid
    • 2.4 Loop through data
      • repeats for every row in [link-data]
      • 2.4.1 Go to page
        • URL: the album link of [link-data]
      • 2.4.2 Get data from bot's current page
        • Select: the title, release date and copyright line on the album page, one column each
        • Max results: 3
      • 2.4.3 Write data to a Google Sheet
        • Spreadsheet: your sheet
        • Sheet name: Data
        • DATA: [scrape-data]
        • Write options: Add to existing data
    • 2.5 Delete rows from a Google Sheet
      • Spreadsheet: your sheet
      • Sheet name: Artists
      • First row: 1
      • Last row: 1

Common questions about scraping a Spotify discography


Why does the Spotify artist page not load the discography?

The URL is missing its ending. Check the Go to page URL ends with /discography/all after the inserted artist link.

The albums are not all showing. The grid layout icon has to be clicked first so the albums are visible, then reselect one album in Get a list of links to pages from bot's current page. When a run fails, hand it to the agent and it repairs the step.

Why is the same Spotify artist scraped every time?

The wrong tab is cleared. Delete rows from a Google Sheet must point at the Artists tab, not Data.

Can I scrape other fields from a Spotify album?

Yes. Open the agent's result in the builder and reselect the fields in Get data from bot's current page: any field on the album page, such as the track count or the label, and raise Max results to match.

Can I scrape a Spotify discography without code?

Yes. The automation is built from the four lines above and runs in your Chrome extension; there is no script and no Spotify API key.

Can I stop the Spotify scraper and carry on later?

Yes. Each artist is deleted from the Artists tab once its albums are in Data, so a run you stop or that fails part way starts again from the first artist left in the tab, with no albums repeated.

Can I get the Spotify discography as a CSV or Excel file?

Yes. The albums land in the Data tab of your Google Sheet, and Google Sheets downloads any tab as CSV or Excel from its File menu.

Where do I get help?

Get in touch with support, or ask in the axiom.ai community.

Related guides