RepositoryTypeScriptFRFrance
Yooooomi

Yooooomi/your_spotify

Self hosted Spotify tracking dashboard

4.6kstars
220forks
127issues
3views

Featured achievements

The project's latest awards

5
TINIX TRENDING·Topic: webapp

#5 Repository of the week

6
TINIX TRENDING·Topic: spotify

#6 Repository of the week

7
TINIX TRENDING·Topic: statistics

#7 Repository of the week

Build CI Release CI Donate

Your Spotify

YourSpotify is a self-hosted application that tracks what you listen and offers you a dashboard to explore statistics about it! It's composed of a web server which polls the Spotify API every now and then and a web application on which you can explore your statistics.

Table of contents

Prerequisites

  1. You have to own a Spotify application ID that you can create through their dashboard.
  2. You need to provide the Server environment the public AND secret key of the application (cf. Installation).
  3. You need to provide an authorized redirect URI to the docker-compose file.

A tutorial is available at the end of this readme.

Installation

Using docker-compose

Follow the docker-compose-example.yml to host your application through docker.

services:
  server:
    image: yooooomi/your_spotify_server
    restart: always
    ports:
      - "8080:8080"
    links:
      - mongo
    depends_on:
      - mongo
    environment:
      API_ENDPOINT: http://localhost:8080 # This MUST be included as a valid URL in the spotify dashboard (see below)
      CLIENT_ENDPOINT: http://localhost:3000
      SPOTIFY_PUBLIC: __your_spotify_client_id__
      SPOTIFY_SECRET: __your_spotify_secret__

  web:
    image: yooooomi/your_spotify_client
    restart: always
    ports:
      - "3000:3000"
    environment:
      API_ENDPOINT: http://localhost:8080

  mongo:
    container_name: mongo
    image: mongo:8
    volumes:
      - ./your_spotify_db:/data/db

You can follow the instructions here. Note that you will still have to do the steps below.

Environment

KeyDefault value (if any)Description
CLIENT_ENDPOINTREQUIREDThe endpoint of your web application
API_ENDPOINTREQUIREDThe endpoint of your server
SPOTIFY_PUBLICREQUIREDThe public key of your Spotify application (cf Creating the Spotify Application)
SPOTIFY_SECRETREQUIREDThe secret key of your Spotify application (cf Creating the Spotify Application)
TIMEZONEEurope/ParisThe timezone of your stats, only affects read requests since data is saved with UTC time
MONGO_ENDPOINTmongodb://mongo:27017/your_spotifyThe endpoint of the Mongo database, where mongo is the name of your service in the compose file
PROMETHEUS_USERNAMEnot definedPrometheus basic auth username (see here)
PROMETHEUS_PASSWORDnot definedPrometheus basic auth password
LOG_LEVELinfoThe log level, debug is useful if you encouter any bugs
CORSnot definedList of comma-separated origin allowed (not required; defaults to CLIENT_ENDPOINT)
COOKIE_VALIDITY_MS1hValidity time of the authentication cookie, following this pattern
MAX_IMPORT_CACHE_SIZEInfiniteThe maximum element in the cache when importing data from an outside source, more cache means less requests to Spotify, resulting in faster imports
MONGO_NO_ADMIN_RIGHTSfalseDo not ask for admin right on the Mongo database
PORT8080The port of the server, do not modify if you're using docker
FRAME_ANCESTORSnot definedSites allowed to frame the website, comma separated list of URLs (i-want-a-security-vulnerability-and-want-to-allow-all-frame-ancestors to allow every website)

Advanced CORS settings

Manually specifying CORS configuration is not required for typical deployments.
99.9% of users do not need to worry about this, it is handled automatically.

If your use case requires the backend to be used from multiple frontend origins, you can manually adjust the CORS variable. For example, a value of origin1,origin2 will allow origin1 and origin2.

Creating the Spotify Application

For YourSpotify to work you need to provide a Spotify application public AND secret to the server environment. To do so, you need to create a Spotify application here.

  1. Click on Create app.
  2. Fill out all the information.
  3. Set the redirect URI, corresponding to your server location on the internet (or your local network) adding the suffix /oauth/spotify/callback (/api/oauth/spotify/callback if using the linuxserver image).
  • i.e: http://localhost:8080/oauth/spotify/callback or http://home.mydomain.com/your_spotify_backend/oauth/spotify/callback
  1. Check Web API
  2. Check I understand and agree
  3. Hit Settings at the top right corner
  4. Copy the public and the secret key into your docker-compose file under the name of SPOTIFY_PUBLIC and SPOTIFY_SECRET respectively.
  5. Once you have created your application, Spotify wants you to register the users that will be able to access the application. (You don't need to do that for the account that created the application)
    1. Click the User Management button
    2. Enter the required information, a name and the email the user's Spotify account has been created with.
    3. (Optional) You can Request extension if you do not want to register the users by hand.

Importing past history

By default, YourSpotify will only retrieve data for the past 24 hours once registered. This is a technical limitation. However, you can import previous data by two ways.

The import process uses cache to limit requests to the Spotify API. By default, the cache size is unlimited, but you can limit is with the MAX_IMPORT_CACHE_SIZE env variable in the server.

Supported import methods

Privacy data

Takes a maximum of 5 days. Only gets you the last year of history.

  • Request your privacy data at Spotify to have access to your history for the past year here.
  • Head to the Settings page and choose the Account data method.
  • Input your files starting with StreamingHistoryX.json.
  • Start your import.

Takes a maximum of 30 days. Gets you the whole history since the creation of your account.

  • Request your Full privacy data to have access to your history data since the creation of the account here.
  • Head to the Settings page and choose the Extended streaming history method.
  • Input your files starting with Streaming_History_Audio_YYYY-YYYY_X.json.
  • Start your import.

Troubleshoot

An import can fail:

  • If the server reboots.
  • If a request fails 10 times in a row.

A failed import can be retried in the Settings page. Be sure to clean your failed imports if you do not want to retry it as it will remove the files used for it.

It is safer to import data at account creation. Though YourSpotify detects duplicates, some may still be inserted.

FAQ

How can I block new registrations?

From an admin account, go to the Settings page and hit the Disable new registrations button.

Songs don't seem to synchronize anymore.

This can happen if you revoked access on your Spotify account. To re-sync the songs, go to settings and hit the Relog to Spotify button.

The web application is telling me it cannot retrieve global preferences.

This means that your web application can't connect to the backend. Check that your API_ENDPOINT env variable is reachable from the device you're using the platform from.

A specific user does not use the application in the same timezone as the server, how can I set a specific timezone for him?

Any user can set his proper timezone in the settings, it will be used for any computed statistics. The timezone of the device will be used for everything else, such as song history.

External guides

Contributing

If you have any issue or any idea that could make the project better, feel free to open an issue. I'd love to hear about new ideas or bugs you are encountering.

Sponsoring

I work on this project on my spare time and try to fix issues as soon as I can. If you feel generous and think this project and my investment are worth a few cents, you can consider sponsoring it with the button on the right, many thanks.

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
n8n-io/n8n

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

212.9k
Dec 2, 2026
RepositoryJavaScript
louislam/uptime-kuma

A fancy self-hosted monitoring tool

95.1k
Nov 30, 2026
RepositoryTypeScript
usememos/memos

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

64.8k
Dec 1, 2026
RepositoryTypeScript
reactive-resume/reactive-resume

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

46.3k
Dec 1, 2026
RepositoryTypeScript
louislam/dockge

A fancy, easy-to-use and reactive self-hosted docker compose.yaml stack-oriented manager

24.9k
Oct 23, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryTypeScript
immich-app/immich

High performance self-hosted photo and video management solution.

120.6k
Dec 1, 2026
RepositoryTypeScript
koala73/worldmonitor

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

91.3k
Nov 29, 2026