spotify-share-liked
v0.1.1
Published
Share liked songs on Spotify by copying your Spotify Liked Songs into a playlist with the official Web API
Maintainers
Readme
Share Liked Songs on Spotify
spotify-share-liked is a zero-cost local CLI that copies your Spotify "Liked Songs" into a playlist you can share with a link, using the official Spotify Web API.
It is built for people searching for ways to share Spotify liked songs, export Spotify liked songs to a playlist, or turn Spotify liked songs into a shareable playlist without using a hosted third-party service.
Features
- Zero-cost: Runs entirely on your local machine
- High-privacy: No data sent to external servers, uses official Spotify API only
- OAuth 2.0: Secure authentication with PKCE
- Rate-limit resilient: Automatic retry with exponential backoff
- Batch processing: Efficiently handles large libraries (tested with 469+ tracks)
- Profile-hidden output: Hides the generated playlist from your public profile and search
Why Use It
- Share Spotify liked songs with one link: Copy your library into a standard playlist and send the playlist URL
- Export liked songs without a backend: Everything runs locally on your machine
- Use the official Spotify Web API only: No scraping, no private endpoints, no hosted token storage
- Handle large libraries: Fetches all liked songs with pagination and uploads in 100-track batches
Prerequisites
- Node.js LTS (v18 or higher)
- Spotify account
- Spotify Developer App credentials
Installation
From npm
npm install -g spotify-share-likedFrom source
# Clone or download the project
cd spotify-share-liked
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
- Go to Spotify Developer Dashboard
- Create a new app
- Add
http://127.0.0.1:8888/callbackto the Redirect URIs - Copy your Client ID
Create a .env file in the project root:
SPOTIFY_CLIENT_ID=your_client_id_hereYou can also copy the example file:
cp .env.example .envOptional if you want to use a different callback URL and port:
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callbackIf you set SPOTIFY_REDIRECT_URI, register that exact same URI in the Spotify Developer Dashboard.
The CLI requests these Spotify scopes:
user-library-readplaylist-modify-private
Important: Spotify's official Web API cannot make a playlist link-access private. The CLI can only set public: false, which hides the playlist from your public profile and from Spotify search results.
If you need true link-private access, update the playlist privacy manually in the Spotify desktop client after creation.
Usage
Development mode
npm run devProduction mode
spotify-share-likedCommon options
spotify-share-liked --name "My Liked Songs"
spotify-share-liked --description "Songs I want to share"
spotify-share-liked --no-open
spotify-share-liked --helpRun from source
npm startRun tests
npm testGlobal installation
npm link
spotify-share-likedHow It Works
- Authentication: Opens your browser to authenticate with Spotify
- Reading: Fetches all your liked songs using pagination (50 per request)
- Creating: Creates a new playlist called "share liked songs spotify"
- Visibility: Sets
public: falseso the playlist is hidden from profile and search - Uploading: Adds tracks in batches of 100 (Spotify API limit)
- Result: Prints the shareable playlist URL
FAQ
Can I share Spotify liked songs with a playlist link?
Yes. This tool copies your Spotify liked songs into a playlist in your own account and prints the playlist URL.
Can I choose the playlist name?
Yes. Use --name "Your Playlist Name" to override the default playlist title.
What if the browser does not open?
Run spotify-share-liked --no-open and the CLI will print the Spotify authorization URL for you to open manually.
Can this make the playlist fully private?
No. Spotify's official Web API can hide the playlist from your profile and search, but anyone with the direct link can still open it.
Does this use the official Spotify API?
Yes. The CLI uses Spotify OAuth and the official Spotify Web API only.
Rate Limiting
The tool implements automatic retry with exponential backoff:
- Waits for
Retry-Afterheader when receiving HTTP 429 - Falls back to exponential backoff: 1s, 2s, 4s
- Retries up to 3 times before failing
Privacy & Security
- All credentials stay on your local machine
- Uses official Spotify Web API only
- No external servers or databases
- PKCE flow for secure authentication
- Spotify's Web API cannot create a link-private playlist; anyone with the URL can still access it
License
MIT
