Official Python client for the Songstats Enterprise API.
📚 API Documentation: https://docs.songstats.com
🔑 API Key Access: Please contact api@songstats.com
- Python >= 3.10
Install from PyPI:
pip install songstats-sdk
For local development:
pip install -e ".[dev]"
from songstats_sdk import SongstatsClient
client = SongstatsClient(api_key="YOUR_API_KEY")
# API status
status = client.info.status()
# Track information
track = client.tracks.info(songstats_track_id="abcd1234")
# Artist statistics
artist_stats = client.artists.stats(
songstats_artist_id="abcd1234",
source="spotify",
)All requests include your API key in the apikey header.
You can generate an API key in your Songstats Enterprise dashboard.
We recommend storing your key securely in environment variables:
export SONGSTATS_API_KEY=your_key_here
client.infoclient.tracksclient.artistsclient.collaboratorsclient.labels
Info endpoints:
client.info.sources()->/sourcesclient.info.status()->/statusclient.info.definitions()->/definitions
from songstats_sdk import SongstatsAPIError, SongstatsTransportError
try:
client.tracks.info(songstats_track_id="invalid")
except SongstatsAPIError as exc:
print(f"API error: {exc}")
except SongstatsTransportError as exc:
print(f"Transport error: {exc}")To work on the SDK locally:
git clone https://github.com/songstats/songstats-python-sdk.git
cd songstats-python-sdk
pip install -e ".[dev]"
pytest
This SDK follows Semantic Versioning (SemVer).
MIT