Export SoundCloud Data
A Python script to export your SoundCloud data including likes, playlists, and albums.
Setup
Before running the export, you need to authenticate with SoundCloud using OAuth and set up your environment.
Getting SoundCloud API Access
- Visit the SoundCloud Developers Page
- Sign up or log in to your account
- Create a new app to obtain your Client ID and Secret
- Note down your Client ID and Client Secret
- Set your redirect URI to
http://localhost:8080/callback
Environment Variables
Create a .env file in the project root with the following variables:
SOUNDCLOUD_CLIENT_ID=your_client_id_here
SOUNDCLOUD_CLIENT_SECRET=your_client_secret_here
SOUNDCLOUD_REDIRECT_URI=http://localhost:8080/callback
Replace:
your_client_id_herewith the Client ID you obtained from SoundCloud Developer Portalyour_client_secret_herewith the Client Secret you obtained from SoundCloud Developer Portal
Authentication
Before exporting data, you need to authenticate with SoundCloud using OAuth:
./task auth
This will guide you through the OAuth flow to generate an access token, which will be saved to oauth-token.txt for use with the export command.
Usage
After authentication, run the export script using the task runner:
./task export-data
The script will fetch all your tracks and save them to data.json:
- Liked tracks (with cover link, artist, title, and creation date)
- Tracks from playlists (with cover link, artist, title, and creation date)
- Tracks from albums (with cover link, artist, title, and creation date)
Note: The script consolidates all track data into a single data.json file, eliminating the need for separate files.
To process the exported data into markdown tables:
./task process-data
This creates three markdown files in the output/ directory:
output/albums.md- Table of all album tracksoutput/playlists.md- Table of all playlist tracksoutput/likes.md- Table of all liked tracks
Only the data.json file is required to generate these tables.