Skip to main content

My Spotify

version: "3"

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__
      - CORS=http://localhost:3000,http://localhost:3001 # all if you want to allow every origin
  mongo:
    container_name: mongo
    image: mongo:4.4.8
    volumes:
      - ./your_spotify_db:/data/db

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

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 a client ID.
  2. Fill out all the informations.
  3. Copy the public and the secret key into your docker-compose file under the name of SPOTIFY_PUBLIC and SPOTIFY_SECRET respectively.
  4. Add an authorized redirect URI corresponding to your server location on the internet adding the suffix /oauth/spotify/callback.
    1. use the EDIT SETTINGS button on the top right corner of the page.
    2. add your URI under the Redirect URIs section.
    • i.e: http://localhost:8080/oauth/spotify/callback or http://home.mydomain.com/your_spotify_backend/oauth/spotify/callback
    1. Do not forget to hit the save button at the bottom of the popup.

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

  • 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 privacy method.
  • Input your files starting with StreamingHistoryX.json.
  • Start your import.

Full privacy data

Full privacy data can be obtained by emailing privacy@spotify.com and requesting your data since the creation of the account.

  • Request your data by email.
  • Head to the Settings page and choose the full-privacy method.
  • Input your files starting with endsongX.json.
  • Start your import.