Get Your Spotify Data Into Notion: A Guide to Creating a Notion Database of All Your Liked Songs
Updated: Feb 2
If you like music, automations, and playing with data, this post is for you.
Tracking behaviors from different aspects of my life is one of my favorite hobbies. Not only to learn more about myself, but also to create beautiful and interactive environments in my second brain - Notion. I just love adding to Notion every piece of content, knowledge, or reference that I come across. Music, which is a big part of my life, deserves a seat of honor.
With that in mind, I created one of my favorite automations: integrating my Spotify account using Make automation system. I've used all the popular streaming apps, but Spotify has one big advantage - its API connectivity, flexibility, and abilities.
Here's how I made a mirror image of my Spotify on Notion, all automated.
1st Step - Create Databases on Notion
Before executing this automation, the first step we need to take is creating the databases that will store all the data on Notion. So, let's go ahead and create a new page and add three different databases to it: artists, albums and songs.
In Notion, create a new page and then add the / mark and choose Database - inline. You'll be able to change the database view afterwards. For each database, we'd like to add the database's fields according to the data we receive from Spotify. For example, in the album data, we're getting the release year, along with the number of tracks, and some other fields. Of course, we don't need to use all the fields we receive, but just the ones we think have value for the long run.
But let's start from the beginning: How can we know exactly what data we receive from Spotify?
Well, this one is quite simple. Now, we are going to create a new scenario in Make and add a trigger of "Watch Saved Tracks".

Then, we need to choose where the trigger starts. For our example, we'll select "All".


Now, we can run it once and see the results by clicking on the balloon above the module's circle.

There is a collection called "Track" in the data. We can click the plus sign to view its contents.


We can see that we receive data about the song, such as its duration (in milliseconds), track ID, song name, etc. We can also see that there is another collection called "Album" and another array called "Artists". As you probably guessed, these contain data about the song's album and artists. We can simply click on the plus signs to uncover more data.

Pretty cool. Now, we have all available data for all three databases, and we can choose which ones we want to store in Notion. For my personal use, I chose to build the databases according to the following structure:
Artists
Artist ID (the primary key of our database)
Created time
URL (Spotify URL)
Albums (in relationship with the Albums database)
Songs (in a relationship with the Songs database)
Number of saved songs (aggregated from the relationship)
Albums
Album ID (primary key)
Release year
Number of tracks
URL (Spotify URL)
Artist
Songs
Number of saved songs (aggregated from the relationship)
Songs
Song ID (primary key)
Created time
Duration
Popularity
Preview link
URL
Artist
Album
One more thing to keep in mind is that we want to add album art to both the album and the song items, for both the icon and the cover (I find it better looking, but of course, you can choose not to do that, or do only the cover or the icon).
After we decided on the desired structure, we can move on to the next step.
2nd Step - Sketch the automation’s model
Now, we can go ahead and sketch the desired outcome of our automation. I always like to sketch a diagram on Miro before executing, as it gives me a clear vision of the desired outcome.
The logic should be simple and straightforward. We'll use Spotify's unique track, album, and artist ID to avoid duplications in our databases. For each asset, we'll first look for it by the ID, and then execute according to the results. It should look something like this:

This is the basics of our scenario. From here on, the logic will repeat itself, more or less. After we create the song item in the database, we should search for the album ID in the albums database. This time, the condition will act a bit differently. Even if the album exists, we still need to make one adjustment: connecting the song with the album. It should look something like this:

And we continue to do the same for the artist database.

In the end, our model looks like this:

We have our logic sketched out in a diagram. We can move on to the actual execution of the scenario on Make.
3rd Step - Develop
Now, we can move on to the real deal—developing the automation itself. We have already chosen the first module, which is Spotify's "Watch Saved Tracks". As our diagram shows, after the trigger is activated, the first thing we need to do is look for the song ID in our songs database. So, we'll choose the "Search Objects" module for Notion's connector.

We will look for database items. If you have the database's ID, you can simply copy and paste it into the relevant field. If not, you can search for it by its name.


After we find the desired database, we will use the primary key as the filter and compare it with the song ID received with the trigger. The limit of results should be 1, since there should not be any duplicates of the track IDs. It should look like this:

We're done with the second step. Now, we need to add a condition so that the scenario will continue only if the song doesn't exist in our database. We'll add a "Create a Database Item" module and add a condition so that the scenario will continue only if the number of bundles from our previous module is equal to zero.



We can go ahead and add all the relevant fields to our song database item.

Nothing needs to be filled in the "Artist" and "Album" fields, as they will be populated afterwards. Now, we'll repeat the same process for the album. We'll use the "Search Objects" module, but this time for the Albums database, and use the album ID from the data received.

Now it's time to use the condition (router). As the diagram shows, if the album is found, we just need to connect it with the song. And if nothing is found, we need to create a new database item, just like we did for the songs database. Since the album creation is the same as the song, we'll just go through the case in which the album already exists. We'll add a router, a condition, and then the module "Update a Database Item".



To update only the relevant album, we'll use the "Page ID" field and enter it in the "Database Item ID" field.

To make the process dynamic, switch the field to "Map". Then, to connect it with the song, get the song's database item ID from the previous module and put it in the "Songs" field. It should look like this:

Remember that there is another route. If the album was not found in the previous module, you can use the module "Create a New Database Item", add all relevant fields, and make the connection with the song, just like we did in the example above.

We are done with the albums, and we can move on to the artists. Right now, we have two routes, but the process will be identical for both of them. As you have probably guessed, we first need to search for the artist ID, then update or create it, along with the relevant database and its fields.
However, there is one thing to keep in mind before executing it. In some cases, a certain song has more than one artist. In this case, we will get all artists as part of an array within the data. What needs to be done then? It is simple; we need to use an "interior" for the artists array before searching for the artist.


This way, we'll get all the song's artists separately. So, when searching, updating, or creating a new artist, we'll use the fields generated by the interior instead of the ones that came directly from Spotify.

To make the connection with the song and album, we will add the song's database item ID and the album's page ID to the relevant fields. These will be taken from the modules performed earlier in the scenario. Note that both "Database Item ID" and "Page ID" refer to the same purpose in this case; it is a matter of the type of modules used.

And that's it. Now we have a full scenario where all the data is getting to our desired databases, with the relationships and values we wanted.

But wait, we're not done yet. What happens when an artist or album has more than one song? In our scenario, every time we receive new data, it will overwrite the old one and destroy all existing relationships. We certainly don't want that. So, what can be done instead?
Remember that when creating a new album or artist, it's not realistic that they already have songs related to it. So, we're essentially talking about updating the database item module only. Instead of just adding the song's page ID, we first need to take all the existing songs related to the album/artist, add the new song, and then populate it. Let's take the artist's case for example.
We first need to take all songs that are related to the artist. We'll do it by using the "Search Artist" module. As we said, only when updating an existing artist do we need to execute this process. All songs related to the artist can be used as an array in the scenario. But to populate it properly, we need to perform the "map" function, to use only the relevant values. It should look like this:


The value in the field should look something like this: map({properties_value.Songs}; "id"). This way, the automation will take only the relevant data from the array.
To modify the relationship, we need to add the new song ID to the array. To do that, we can use the add function from Make's functions library and add the song's database item ID to the array.


We will repeat the same process for the "Albums" field, using the relevant values from the scenario.

Great! Now, we can do the same for the album's relationship with the song, since we don't want to overwrite any data there either.
The last thing we're going to do is add the album art, and put it in the album and song items. This will make our music hub look much nicer, and album art is just as important as the music itself. To do that, we first need to map it from our trigger. As we can see, we receive three different images in an array, each one in a different size.

Since we will use the image for the item's covers, we'll take the first image, which is the largest. To take only the first image, we'll use an iterator again, but this time put the images[] field in it.

Since we want to take only the first image, we can make a condition from the interior to continue the execution only if the bundle's order position is 1 (the largest is the first one in order) and ignore the rest.

Now we have the image URL, and can set it as the items' icons and cover. To do that, we'll use the module "Make an API Call". Make doesn't let us add an external image URL as the item's icon, so this time we're getting a little more technical than with the other modules. However, it's still very simple. Just make sure to fill in the fields as shown in the example below:
In the URL field, you'll need to use "v1/pages/Database Item ID Variable". The Database Item ID is the dynamic value generated from the module that created the song or album in Notion.
For the method, use “PATCH”.

In the API call body, add the following:
{
"cover": {
"external": {
"url": "IMAGE_URL_VARIABLE_FROM_INTERIOR"
}},
"icon": {
"external": {
"url": "IMAGE_URL_VARIABLE_FROM_INTERIOR"
}}
}
The image URL is taken from the interior’s field. Keep in mind that it is not critical where you position this module in the scenario; it can be the last step or in the middle. It just needs to be located after you have the actual page/database item ID of the song or album in order to use it in the API call URL.
That is it; that is the whole scenario. In the end, we will have a beautiful page containing all the assets and their relationships. This is how my scenario looks eventually:

Conclusion
You can give it a try and run the scenario. If you have followed all steps, you should get an automated process that updates three databases, establishes relationships, and adds media. Once you have all the data in Notion, you can add advanced fields, such as a "Rollup," which can count all the albums or artists' saved songs. Then, you can also make calculations and even design beautiful dashboards using that data.
I like browsing the data I have. Seeing what new artists or songs I have liked recently, and learning more about them. Of course, all data exists on Spotify already, but as a data person, I like having the data on my side and drawing my own conclusions. You can enrich the data with content from the web, videos, articles, images, etc., and have a complete "knowledge base" of your favorite music. It's great to have the ability to do that, especially when it's automated and happens in the background.
If you have any more automation ideas or feedback on this one, please contact me. I'd love to hear what you have to say. Here's a quick look at how my "music hub" looks:


