Elixir client for the ShazamKit API.
ShazamKit allows you to match audio signatures against Shazam's vast music catalog. Use it to:
- Identify songs from audio fingerprints
- Build custom audio recognition features
- Match user-generated audio against the Shazam database
Quick Start
# Match a pre-generated audio signature
ShazamKit.match_signature(signature_data)
# Search Shazam catalog by ISRC
ShazamKit.search_by_isrc("USUG12002836")Configuration
config :shazam_kit,
team_id: System.get_env("APPLE_TEAM_ID"),
key_id: System.get_env("SHAZAM_KEY_ID"),
private_key: System.get_env("SHAZAM_PRIVATE_KEY"),
base_url: "https://api.shazam.com"Audio Signatures
Audio signatures (fingerprints) must be generated on the client side using:
- iOS:
SHSignatureGeneratorfrom ShazamKit framework - Android: Shazam SDK
- Custom implementation following Shazam's signature format
The signature is a binary blob that ShazamKit uses to match against its catalog.
Summary
Functions
Get the Shazam chart (most popular tracks).
Get detailed information about a track by its Shazam ID.
List available chart cities.
Match an audio signature against the Shazam catalog.
Search the Shazam catalog by ISRC (International Standard Recording Code).
Search for tracks by artist and title.
Return a cached ShazamKit access token (after JWT generation).
Validate if a signature format is valid (basic validation).
Types
Functions
Get the Shazam chart (most popular tracks).
Parameters
opts::city_id- City ID for local charts (optional):limit- Maximum results (default 10)
Examples
ShazamKit.get_chart()
ShazamKit.get_chart(city_id: "12345", limit: 20)
Get detailed information about a track by its Shazam ID.
Parameters
track_id: Shazam track identifier
Examples
ShazamKit.get_track("548587123")
List available chart cities.
Examples
ShazamKit.list_cities()
Match an audio signature against the Shazam catalog.
Parameters
signature: Audio signature data (base64 encoded string or binary)opts::raw_audio- Set to true if signature is raw audio data (signature will be generated server-side):limit- Maximum results (default 1)
Returns
{:ok, %{"matches" => [%{"track" => track_data}]}}- Match found{:ok, %{"matches" => []}}- No match found{:error, %ShazamKit.Error{}}- API error
Examples
signature = "AQAsFU4eASQ..." # base64 encoded signature from iOS ShazamKit
ShazamKit.match_signature(signature)Notes
Audio signatures should be generated using Apple's ShazamKit framework on iOS, or the Shazam SDK on other platforms. The signature format is proprietary to Shazam.
Search the Shazam catalog by ISRC (International Standard Recording Code).
Parameters
isrc: ISRC code (e.g., "USUG12002836")
Examples
ShazamKit.search_by_isrc("USUG12002836")
Search for tracks by artist and title.
Parameters
query: Search query (artist name, track title, or both)opts::limit- Maximum results (1-50, default 10):offset- Pagination offset
Examples
ShazamKit.search_tracks("The Beatles Yesterday")
ShazamKit.search_tracks("Billie Eilish", limit: 5)
Return a cached ShazamKit access token (after JWT generation).
Validate if a signature format is valid (basic validation).
Examples
ShazamKit.valid_signature?("AQAsFU4eASQ...")