bandcamp-explorer
A terminal browser and Python library for Bandcamp.
Search for artists and albums, discover releases by genre and location, browse artist/label profiles and discographies, all from the command line.
Install
Requires Python 3.12+.
Terminal CLI
uv tool install bandcamp-explorer
# or
pip install bandcamp-explorer
Discord bot
uv tool install bandcamp-explorer[discord]
# or
pip install bandcamp-explorer[discord]
Create a bot application at the Discord Developer Portal,
enable the bot scope with Send Messages and Use Slash Commands permissions,
then invite it to your server with the generated OAuth2 URL.
Set your bot token and run:
export DISCORD_TOKEN=your-bot-token
bandcamp-discord
# or with a .env file in the current directory
bandcamp-discord
Use --guild GUILD_ID to sync slash commands instantly to a specific server
(global sync can take up to an hour).
Slash commands (all under /bandcamp):
| Command | Description |
|---|---|
/bandcamp search <query> |
Search everything |
/bandcamp album <query> |
Search albums |
/bandcamp artist <query> |
Search artists/labels |
/bandcamp track <query> |
Search tracks |
/bandcamp discover <tag> |
Browse releases by tag (with optional slice and location filters) |
Development
git clone https://github.com/gabriel-jung/bandcamp-explorer.git
cd bandcamp-explorer
uv sync
CLI
Search
bandcamp "caladan brood" # search everything
bandcamp "erang" --artist # artists/labels only
bandcamp "echoes of battle" --album # albums only
bandcamp "a forest whisper" --track # tracks only
Browse by tag
bandcamp --tag dungeon-synth # newest arrivals (default)
bandcamp --tag black-metal --top # best-selling
bandcamp --tag dungeon-synth --rand # surprise me
bandcamp --tag dungeon-synth --location france
bandcamp --tag dungeon-synth --location paris
bandcamp --tag dungeon-synth black-metal # multi-tag
Slices: --new (default), --top, --rand.
Locations are resolved to geoname IDs via Bandcamp's autocomplete and
cached locally; force a refresh with --refresh-location.
Direct URLs
bandcamp https://erang.bandcamp.com/album/tome-iv
bandcamp https://erang.bandcamp.com
Interactive navigation
After selecting a result, you enter an interactive browser:
- Artists: view bio, browse discography, select an album to see its tracklist, select a track to view its page, navigate to the label.
- Albums: header with tracklist, description, and lyrics; navigate to the artist/host page or select a track.
Press 0 to go back, Ctrl+C to quit.
Output modes
bandcamp "erang" --artist --json # output as JSON
bandcamp "erang" --limit 10 # cap results
bandcamp --tag dungeon-synth --json --limit 100 # cap tag dump
bandcamp https://erang.bandcamp.com/album/tome-iv --json
bandcamp https://erang.bandcamp.com/album/tome-iv --full # all sections at once
bandcamp -v ... # enable debug logging
Terminal images
Album covers and artist images render inline on terminals that support the iTerm2 or Kitty image protocol (iTerm2, Kitty, WezTerm, Mintty).
Library
The core module has no terminal dependencies; use it in scripts,
pipelines, or other tools. All data is returned as plain dicts with a
_type discriminator key.
from bandcamp_explorer.core import (
BandcampClient, AlbumAPI, ArtistAPI, DiscoverWebAPI, SearchAPI,
NotFoundError, resolve_geoname,
)
with BandcampClient() as client:
# Search (one call returns the whole result set)
results = SearchAPI(client).search("caladan brood", item_type="album")
# Discover releases by tag (new discover_web endpoint)
discover = DiscoverWebAPI(client)
releases, cursor, total = discover.discover(tags=["dungeon-synth"], slice_="new")
all_releases = discover.discover_all(tags=["dungeon-synth"], max_pages=3)
# Fetch album details (skip cover-art bytes with fetch_art=False)
album = AlbumAPI(client).get("https://erang.bandcamp.com/album/tome-iv")
for track in album["tracks"]:
print(f" {track['position']}. {track['title']} ({track['duration']})")
# Fetch artist/label profile
artist = ArtistAPI(client).get("https://erang.bandcamp.com")
for item in artist["discography"]:
print(f" {item['title']}")
# Location filtering (geoname-based)
geoname_id = resolve_geoname(client, "paris")
releases, _, _ = discover.discover(tags=["dungeon-synth"], geoname_id=geoname_id)
# Download images
client.download_image(album.get("image_url"), output_dir="./images/")
Errors
AlbumAPI.get and ArtistAPI.get raise NotFoundError when a page 404s, so
callers can tell a deleted release from a failed fetch. Every other transport
failure returns None. If Bandcamp answers with its bot-defence interstitial
(HTTP 200 with no content in it), the client raises ChallengeError and then
fails fast for two minutes rather than hammering a blocked endpoint. Never
treat a ChallengeError as a missing resource; it means "ask again later".
from bandcamp_explorer.core import ChallengeError, NotFoundError
try:
album = AlbumAPI(client).get(url)
except NotFoundError:
... # gone for good, stop retrying
except ChallengeError:
... # blocked for now, retry later
Bandcamp removed the
dig_deeperhub endpoint, soDiscoverAPIwas dropped in 0.6.0; useDiscoverWebAPI.resolve_locationwent with it: it resolved Bandcamp's internal location tag ids, which only that endpoint accepted.DiscoverWebAPIfilters bygeoname_id, soresolve_geonameis the one you want.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bandcamp_explorer-0.6.0.tar.gz.
File metadata
- Download URL: bandcamp_explorer-0.6.0.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf9b563e5b1a926672c4a3ac7afa78859014e0c5e4ae5937d37a09886d37978b
|
|
| MD5 |
ca99cfe667ed9bf399c3a7f334d84dd2
|
|
| BLAKE2b-256 |
1480414aa69444dcaf91828a5cd074722e5b1a67b21d649f8b3fd8eb7f4389bb
|
Provenance
The following attestation bundles were made for bandcamp_explorer-0.6.0.tar.gz:
Publisher:
publish.yml on gabriel-jung/bandcamp-explorer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bandcamp_explorer-0.6.0.tar.gz -
Subject digest:
bf9b563e5b1a926672c4a3ac7afa78859014e0c5e4ae5937d37a09886d37978b - Sigstore transparency entry: 2256317814
- Sigstore integration time:
-
Permalink:
gabriel-jung/bandcamp-explorer@3e8e35028b25b90a8bb62a912bd1a30a8692e97e -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/gabriel-jung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e8e35028b25b90a8bb62a912bd1a30a8692e97e -
Trigger Event:
push
-
Statement type:
File details
Details for the file bandcamp_explorer-0.6.0-py3-none-any.whl.
File metadata
- Download URL: bandcamp_explorer-0.6.0-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
579891cc1ddd6a8c56b266154994b4927f99f54f2d3497ccea05b770c1df3460
|
|
| MD5 |
200ac2db0073600c7fdaaf906782ad51
|
|
| BLAKE2b-256 |
c022b55ad3853ea41f4a044d9193d9a3cd3aecb9fc3334b4334f0e23538e496d
|
Provenance
The following attestation bundles were made for bandcamp_explorer-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on gabriel-jung/bandcamp-explorer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bandcamp_explorer-0.6.0-py3-none-any.whl -
Subject digest:
579891cc1ddd6a8c56b266154994b4927f99f54f2d3497ccea05b770c1df3460 - Sigstore transparency entry: 2256317829
- Sigstore integration time:
-
Permalink:
gabriel-jung/bandcamp-explorer@3e8e35028b25b90a8bb62a912bd1a30a8692e97e -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/gabriel-jung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e8e35028b25b90a8bb62a912bd1a30a8692e97e -
Trigger Event:
push
-
Statement type: