Skip to content
Generates mood based playlists using Spotify listening history
Python HTML JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Moodify is a web application that uses the Spotify API to generate playlists based on a users Spotify listening history and current mood.

Table of Contents


Once authorized, Moodify gathers and stores a users listening history in a PostgreSQL database along with information for three audio features: danceability, energy, and valence. In order to uniformly segment the data provided by Spotify, Moodify normalizes the audio feature data for each user and an algorithm is applied to the normalized values to create a playlist with tracks specific to the user and their current mood. Once the playlist is created, the users can then view and play their playlist through Spotify as well as Moodify itself.

Tech Stack

Frontend: ReactJS, Javascript, Jinja, jQuery, Bootstrap
Backend: Python, Flask, SQLAlchemy, PostgreSQL
Libraries: Scipy, Numpy
APIs: Spotify


Get Client ID and Client Secret from Spotify and save them to a file


On local machine, go to directory where you want to work and clone Moodify repository:

$ git clone

Create a virtual environment in the directory:

$ virtualenv env

Activate virtual environment:

$ source env/bin/activate

Install dependencies:

$ pip install -r requirements.txt

Create database:

$ createdb moodify

Create your database tables:

$ python3


$ source

Run the app:

$ python3

Open localhost:5000 on browser.


Log in through Spotify and create your playlist by selecting a mood:


Once created, play your playlist through Spotify Web Player or through Moodify:

Selecting Mood

View playlist and select song to play as well as skip through songs:

View and Play Playlist

Future Features

  • Fine tune algorithm that selects songs
  • Give user's the ability to view all their past mood playlists
  • Option to preview playlist and then save it
You can’t perform that action at this time.