Official Python client for the Songstats Enterprise API.
📚 API Documentation: https://developers.stats.company/songstats
🔑 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]"
fromsongstats_sdkimportSongstatsClientclient=SongstatsClient(api_key="YOUR_API_KEY")
# API statusstatus=client.info.status()
# Track informationtrack=client.tracks.info(songstats_track_id="abcd1234")
# Artist statisticsartist_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
fromsongstats_sdkimportSongstatsAPIError, SongstatsTransportErrortry:
client.tracks.info(songstats_track_id="invalid")
exceptSongstatsAPIErrorasexc:
print(f"API error: {exc}")
exceptSongstatsTransportErrorasexc:
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