An asynchronous framework for the reverse engineered Shazam API, written in Python with asyncio and aiohttp.
Actively maintained. Last release 5 weeks ago, commits in 12 of the last 26 weeks. A safe choice.
pip install shazamio
🎵 Is a FREE asynchronous library from reverse engineered Shazam API written in Python 3.10+ with asyncio and aiohttp. Recognizes a song from a file or from bytes, reads a track, and returns every chart Shazam publishes.
💿 Installation
💲 pip install shazamio
💻 Example
🔎🎵 Recognize track
Recognize a track from a file, a pathlib.Path, or the bytes of one. The
sample below ships with the repository, in examples/data/. The signature
covers 12 s of the audio, the window Shazam clients send;
segment_duration_seconds still takes another one and warns, and from 15 s up
Shazam finds nothing at all
import asyncio
from shazamio import Serialize, Shazam
async def main():
async with Shazam() as shazam:
out = await shazam.recognize("Gloria.ogg")
print(out) # dict
print(Serialize.full_track(out).track.title) # I Will Survive
asyncio.run(main())
🎵📄 About track
Get track information
https://www.shazam.com/track/552406075/ale-jazz
import asyncio
from shazamio import Serialize, Shazam
async def main():
async with Shazam() as shazam:
about_track = await shazam.track_about(track_id=552406075)
print(about_track) # dict
print(Serialize.track(data=about_track)) # pydantic model
asyncio.run(main())