shazamlite
Identify any song from audio, with a pure-Python fingerprinting engine and live Shazam recognition — no API keys required.
shazamlite implements Shazam's legacy audio-signature algorithm in pure Python
- numpy (byte-identical to ShazamIO's
SignatureGenerator), sends the signature to Shazam's livediscovery/v5endpoint, and enriches results with iTunes metadata (artwork, album, previews).
Transparency: this project is a 50/50 collaboration between human creativity and AI implementation. The initial concept, requirements, and rough functionality were created by a human developer, then refined and polished by AI to ensure smooth functionality, proper error handling, and production-ready code quality.
Features
- Recognition — match audio against Shazam's live
discovery/v5endpoint. Long files are scanned across their loudest windows, so quiet intros or trailing silence never block a match. - Signature engine —
shazamlite.signatureis a dependency-free reimpl of the legacy Shazam algorithm; output is byte-identical to ShazamIO (data:audio/vnd.shazam.sig). - Metadata — search (iTunes Search), world + genre charts (official CSVs), related tracks, artist info and top songs, all enriched with 600×600 artwork.
- Optional extras — Chrome TLS impersonation (
curl_cffi), broad audio decoding (soundfile/miniaudio), live-mic capture (sounddevice), accurate timezone detection (tzlocal),pydubsupport. - Sync + async facades, JSON-serializable dataclasses, rich errors with status code + body + URL.
Only numpy is required. Everything else is optional.
Install
pip install shazamlite # + numpy
pip install "shazamlite[all]" # + curl_cffi, soundfile, miniaudio, tzlocal, sounddevice
| Extra | Provides |
|---|---|
curl-cffi |
Chrome TLS impersonation (JA3/JA4/HTTP2) |
soundfile |
Decode mp3 / flac / ogg / m4a files |
miniaudio |
Alternative universal decoder |
tzlocal |
Accurate local timezone detection |
mic |
Live microphone capture via sounddevice |
pydub |
Accept pydub.AudioSegment objects directly |
dev |
pytest + ShazamIO (byte-parity test) |
Quick start
import asyncio
from shazamlite import Shazam, ShazamAsync
shazam = Shazam(country="US")
track = shazam.recognize("song.mp3") # path, WAV bytes, numpy array, or pydub segment
print(track.title, "-", track.artist) # "Won't Bite (feat. Smino) - Doja Cat"
print(track.coverart) # 600x600 artwork URL
print(track.to_dict()) # JSON-serializable dict
# Async
async def main():
return await ShazamAsync().recognize("song.flac")
asyncio.run(main())
recognize() accepts a file path, raw WAV bytes, a numpy float array
(pass sample_rate= for anything other than 16 kHz), or a pydub.AudioSegment.
For recordings of speech or noise the server simply answers "no match".
CLI
shazamlite recognize song.mp3
shazamlite search "olivia rodrigo" --limit 5
shazamlite charts --world
shazamlite charts --country FR
shazamlite charts --country US --city "New York"
shazamlite charts --genre pop
shazamlite related 502331060
shazamlite artist 830588310 --top-songs
All output is JSON. Global flags: --country, --language, --timezone,
--endpoint, --no-enrich, --json.
Metadata
shazam.search("queen bohemian", limit=5)
shazam.top_world_charts(limit=10)
shazam.top_genre_charts("pop") # genre/world charts
shazam.top_country_charts("FR") # note: country CSVs are 404 server-side (2026-08)
shazam.top_city_charts("US", "New York")# note: city CSVs are 404 server-side (2026-08)
shazam.related_tracks("502331060")
shazam.artist_about("830588310") # -> {"artist_id", "name"}
shazam.artist_top_songs("830588310")
Errors
All errors derive from ShazamError.
| Error | Meaning |
|---|---|
NoMatch |
Server answered, but nothing matched |
BadData |
Not enough audio for a signature, or undecodable input |
FailedDecodeJson |
Response was not valid JSON |
HTTPStatusError |
Non-2xx (or persistent 429/5xx) — carries code, body, URL |
MaxRetriesExceeded |
Transport failure after all retry attempts |
429/5xx responses are retried with exponential backoff + jitter (default 3 attempts).
Development
pip install ".[dev]"
pytest # full suite (59 tests)
pytest tests/test_parity.py # byte-parity vs ShazamIO
License
MIT — see LICENSE.
© 2026 Daniel Richard Todd Back · dytuk.media/shazamlite
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 shazamlite-0.1.0.tar.gz.
File metadata
- Download URL: shazamlite-0.1.0.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a36614e9e2be9e5ed958534081de4052e25c040c49ad0ab633c26a038fc09ba1
|
|
| MD5 |
cfd547cd4d51483a4827920c4cfdd0a0
|
|
| BLAKE2b-256 |
8ad128efe3f651ef2bf11f7aef4177729ce4f37b14a9c4a05aa0d60210174100
|
Provenance
The following attestation bundles were made for shazamlite-0.1.0.tar.gz:
Publisher:
publish.yml on danielytuk/shazamlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shazamlite-0.1.0.tar.gz -
Subject digest:
a36614e9e2be9e5ed958534081de4052e25c040c49ad0ab633c26a038fc09ba1 - Sigstore transparency entry: 2386635531
- Sigstore integration time:
-
Permalink:
danielytuk/shazamlite@61e98d1fa5305f717aebba57a0d7ccf14cf9f332 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/danielytuk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61e98d1fa5305f717aebba57a0d7ccf14cf9f332 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shazamlite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: shazamlite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9359fd323271bd0e1a5cdf1becd3488f3213d2e6dfdb8abea95bf76cf55a9ae
|
|
| MD5 |
620234c78c84c9db3eb69d0cf859f6d4
|
|
| BLAKE2b-256 |
74946760e6b7e4f59c9153a15c7611c413f4cc27e22534a0684e9c86283d5f29
|
Provenance
The following attestation bundles were made for shazamlite-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on danielytuk/shazamlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shazamlite-0.1.0-py3-none-any.whl -
Subject digest:
b9359fd323271bd0e1a5cdf1becd3488f3213d2e6dfdb8abea95bf76cf55a9ae - Sigstore transparency entry: 2386635536
- Sigstore integration time:
-
Permalink:
danielytuk/shazamlite@61e98d1fa5305f717aebba57a0d7ccf14cf9f332 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/danielytuk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61e98d1fa5305f717aebba57a0d7ccf14cf9f332 -
Trigger Event:
push
-
Statement type: