npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

Readme

Share Liked Songs on Spotify

npm version npm downloads GitHub release License

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-liked

From source

# Clone or download the project
cd spotify-share-liked

# Install dependencies
npm install

# Build the project
npm run build

Configuration

  1. Go to Spotify Developer Dashboard
  2. Create a new app
  3. Add http://127.0.0.1:8888/callback to the Redirect URIs
  4. Copy your Client ID

Create a .env file in the project root:

SPOTIFY_CLIENT_ID=your_client_id_here

You can also copy the example file:

cp .env.example .env

Optional if you want to use a different callback URL and port:

SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback

If you set SPOTIFY_REDIRECT_URI, register that exact same URI in the Spotify Developer Dashboard.

The CLI requests these Spotify scopes:

  • user-library-read
  • playlist-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 dev

Production mode

spotify-share-liked

Common 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 --help

Run from source

npm start

Run tests

npm test

Global installation

npm link
spotify-share-liked

How It Works

  1. Authentication: Opens your browser to authenticate with Spotify
  2. Reading: Fetches all your liked songs using pagination (50 per request)
  3. Creating: Creates a new playlist called "share liked songs spotify"
  4. Visibility: Sets public: false so the playlist is hidden from profile and search
  5. Uploading: Adds tracks in batches of 100 (Spotify API limit)
  6. 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-After header 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