After songs made famous on TikTok began to rise on Billboard’s Hot 100, we began to wonder if we could predict each week’s top 10 songs based on the previous chart-topping songs.

What it does

Billboard Next is a data-driven website that predicts that Billboard’s top 10 chart-topping songs for the next week. Using the PyTorch machine learning library, Billboard Next generates the next hit tunes based on previous popular songs. Clicking the Spotify icon for each song opens Spotify in a new tab and begins playing the selected song.

How we built it

HTML, CSS, and JavaScript were used to create the front end design of Billboard Next. The design was based on Billboard’s modern website, and we wanted to mimic the aesthetic in Billboard Next. Flask was used to connect out backend model to our front end display, and our domain was hosted on Heroku. A neural network was created in PyTorch and was trained in Google Colab to predict next week’s top ten songs. This network was trained on the last 2 years of Billboard top 100 data, and takes the current and previous top 100 songs to predict next week's top 10. The library was used to access the top 100 songs, and the Spotify Web API was used to grab Spotify links for each song.

Challenges we ran into

The first challenge we ran into while developing Billboard Next was hosting our site. In the past, we have hosted on, but their service lacks support for PyTorch, so we had to switch our host to Heroku, which none of us have used before. After 116 deploys, we had a working site hosted on Heroku rather than Another challenge we faced was grabbing the Spotify url for each song. While the library used to give the Spotify link with every song, that feature has been deprecated for years. We got around this by using the Client Credentials flow for the Spotify Web API, allowing us to register our app with the API for song lookup without requiring users to sign in. We verified the app in the main Flask code, and used the access key granted to look up the song links in the JavaScript code used in displaying the songs.

Accomplishments that we’re proud of

We’re very proud of our predictions and linking our website Spotify. Billboard’s website does not have the ability to play the ranked songs, and we wanted to be able to listen to the songs without an additional search. We’re also very proud of the clean, modern aesthetic that matches Billboard’s original website.

What we learned

This was the first time that any of us have used Flask for a website rather than Node.js, so we have all learned the basics of Flask and how to host a website using Python rather than JavaScript. This was also the first time we have hosted an app in Heroku, so we learned how to deploy an app on Heroku from a GitHub repository. Also, we learned how to use the Spotify Web API, as, while some of us had tried to experiment with it before, we had never been able to implement it into a project successfully before. Also, most of us did not have much experience using PyTorch, so this was a huge learning experience for all of us.

What's next for Billboard Next

Going forward, we hope to add an analysis of the audio files to detect what makes a song popular. While our current model relies on past Billboard data in order to predict the most popular songs for the next week, we hope to incorporate analysis of the actual song to see what aspects of the songs make them more popular. This would allow us to predict how popular newly released songs will be.

Share this project: