Skip to content
Back to skills

Spotify

ASecurity

> **⚠️ CRITICAL: Spotify is READ-ONLY. This phase only READS data — it never writes, modifies, or deletes anything on Spotify. Do not attempt to create playlists, add tracks, follow artists, or make any changes to the Spotify account. The Spotify app used here has zero write scopes.** Exports the user's entire Spotify library to a structured JSON file.

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 6, 2026
ai-agentspythonbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add aalzubidy/spotify-to-tidal --skill spotify --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spotify?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Spotify
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aalzubidy-spotify/badge)](https://www.skillsdirectory.com/skills/aalzubidy-spotify)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Spotify Export Phase

> **⚠️ CRITICAL: Spotify is READ-ONLY. This phase only READS data — it never writes, modifies, or deletes anything on Spotify. Do not attempt to create playlists, add tracks, follow artists, or make any changes to the Spotify account. The Spotify app used here has zero write scopes.**

Exports the user's entire Spotify library to a structured JSON file.

## Prerequisites

- Python 3.8+
- The `spotify-to-tidal.env` file with valid `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET`
- Internet connection and a web browser

## Step 1 — Load Credentials

Set the working directory (the directory containing `spotify-to-tidal.env`):

```bash
WORK_DIR="/path/to/spotify-tidal-working-directory"
source "$WORK_DIR/spotify-to-tidal.env"
```

Verify the variables are set:
```bash
echo "Client ID: ${SPOTIFY_CLIENT_ID:0:8}..."
```

## Step 2 — Start Auth Server

Run the authorization server:

```bash
cd .agents/skills/spotify-to-tidal/spotify
mkdir -p "$WORK_DIR"
PYTHONDONTWRITEBYTECODE=1 python3 helpers/auth-server.py "$SPOTIFY_CLIENT_ID" "$SPOTIFY_CLIENT_SECRET" "$WORK_DIR"
```

This starts an HTTP server on `http://127.0.0.1:3030`.

It will print a URL. Open that URL in your browser, log in with Spotify,
and approve the requested scopes. You'll be redirected back to `127.0.0.1`,
the server captures the authorization code, exchanges it for tokens,
and saves them to `$WORK_DIR/spotify-tokens.json`.

The server shuts down after successful auth.

Scopes requested:
- `user-library-read` — liked tracks, saved albums/episodes/shows/audiobooks
- `playlist-read-private` — private playlists
- `playlist-read-collaborative` — collaborative playlists
- `user-follow-read` — followed artists
- `user-top-read` — top artists and tracks
- `user-read-recently-played` — recently played

## Step 3 — Fetch All Data

Once tokens are saved, run the fetcher:

```bash
cd .agents/skills/spotify-to-tidal/spotify
WORK_DIR="/path/to/spotify-tidal-working-directory"
PYTHONDONTWRITEBYTECODE=1 python3 helpers/fetch-all.py "$WORK_DIR/spotify-tokens.json" "$WORK_DIR/spotify-export.json"
```

This pulls all data using the Spotify Web API:

| Endpoint | Section |
|---|---|
| `GET /me/tracks` | `liked_tracks` |
| `GET /me/albums` | `saved_albums` |
| `GET /me/episodes` | `saved_episodes` |
| `GET /me/shows` | `saved_shows` |
| `GET /me/audiobooks` | `saved_audiobooks` |
| `GET /me/playlists` + per-playlist `GET /playlists/{id}/tracks` | `playlists` |
| `GET /me/following?type=artist` | `followed_artists` |
| `GET /me/top/artists` (long_term) | `top_artists` |
| `GET /me/top/tracks` (long_term) | `top_tracks` |
| `GET /me/player/recently-played` | `recently_played` |

All endpoints are paginated — the fetcher follows `next` links automatically.
Rate limiting is handled with `Retry-After` header support.

## Step 4 — Verify Output

```bash
WORK_DIR="/path/to/spotify-tidal-working-directory"
python3 -c "
import json
with open('$WORK_DIR/spotify-export.json') as f:
    d = json.load(f)
print(f'Tracks: {len(d[\"liked_tracks\"])}')
print(f'Albums: {len(d[\"saved_albums\"])}')
print(f'Playlists: {len(d[\"playlists\"])}')
print(f'Artists: {len(d[\"followed_artists\"])}')
"
```

## Step 5 — Generate Report (Optional)

See the master `SKILL.md` report section.

```bash
cd .agents/skills/spotify-to-tidal
WORK_DIR="/path/to/spotify-tidal-working-directory"
PYTHONDONTWRITEBYTECODE=1 python3 reports/generate.py --type export \
  --input "$WORK_DIR/spotify-export.json" \
  --output "$WORK_DIR/spotify-report.html"
```

Files in this skill

  • SKILL.md3.5 KB
  • helpers/auth-server.py8.4 KB
  • helpers/fetch-all.py15.2 KB
  • templates/authorize.html3 KB
  • templates/callback.html2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.