Using Alteryx to Connect to the Spotify API

If you are looking to access Spotify's wealth of data for your analytical needs, then an Alteryx to API connection could well be your answer.

Step 1: Create an 'app' in the Spotify Developer Dashboard

Head over to Spotify Developer:

Getting started with Web API | Spotify for Developers

Sign in with your Spotify account (create a free one if needed), navigate to your dashboard, and select create an app:

Once created, open it up select 'Settings' and you should now be able to see your 'Client ID' and your 'Secret Client' codes. You'll be needing these.

Step 2: Download handy Alteryx Macro

This will get you your authorisation token utilising the codes we got in step 1

Spotify Get Authorization Token
This macro can be used to get the authorisation token required for use in Spotify API using the Client Credentials method. The macro has an interface to allow you to put in the Client ID and Client Secret. To obtain your Client ID and Client Secret: 1. Go to https://developer.spotify.com/dashboa…

Step 3: Add your Macro to your Alteryx flow

Once you have dragged in the Macro, enter the Client ID and Client Secret into the Macro Interface. When you run the flow it will return an Authorisation Field.

Step 4: Review API documentation to find URL needed to access relevant data:

Web API | Spotify for Developers
Retrieve metadata from Spotify content or control playback

For example, to access an artist I needed the following URL: https://api.spotify.com/v1/artists/{id}

(I would replace {id} with the Spotify id of my artist of interest).

Step 5: Input your URL into an Input Text tool, and append to Macro Output.

1)

2)

You should see a single row output as follows:

(I have cropped out my authorisation code)

Step 6: Set up your download tool

In the tool's settings uncheck 'Encode URL', and in Headers check 'Authorisation'

Step 6: Time to Parse!

Drag in the JSON Parse tool, and select the Download Data field

and you should see an output looking something like this:

Step 7: Clean until you can clean no more

In the last two fields, all your extracted data will exist. The art then is in extracting the relevant information... this will no doubt entail a fun combination of Cross Tab, Transpose, Formula, and Filter tools. Enjoy!

Author:
Dominic Brady
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab