AudD® is music recognition API.
For the audio streams live music recognition, see docs for audio streams (it might be helpful for creating radio charts, now playing widgets or bots for YouTube and Twitch streams, etc.). We also have an endpoint that accepts large audio files (could be hours-long mixes or days-long recordings) and recognizes all the tracks in them: see docs for the enterprise endpoint.
You can send all the requests and all the parameters by GET and POST, in a query or a request body.
api_token— the auth token. It's required for all your requests. You can get one from the API Dashboard.
Please note that the api.audd.io endpoint has methods for audio streams and methods that aren't published on this page. See the docs for audio streams or work with your AudD contact to coordinate access to the docs.
recognize is the default API method. It's for the usual music recognition that works like Shazam. A file is required: see #Sending files or the Code examples tab below.
- Code examples
return parameter is for comma-separated identifiers of the additional metadata you want to be returned. The identifiers you can send:
musicbrainz – MusicBrainz metadata;
napster – Apple Music, Spotify, Deezer, Napster data and links respectively;
lyrics – lyrics and additional metadata (sometimes not accurate). Example:
You can also send GET requests, even though it's better to send the parameters in the POST body. Here's an example:
Just don't forget to url-encode the parameters.
recognizeWithOffset is the method for recognition by humming/singing. The file is required. We can't guarantee any accuracy for this method.
- Code examples
recognizeWithOffset API methods, you have to send a file for recognition. There are three ways to send files to our API:
- Provide an HTTP URL for the file to be recognized. Our server will download the file and identify the music. Send the URL in the
urlparameter as a string. The parameter can be sent either in the request body or query parameters, by GET or POST. We highly recommend sending files this way. If the file is available by URL, it's the easiest way to send it.
- Post the file using multipart/form-data in the usual way browsers upload files. Send the file in the
fileparameter, by POST. We recommend sending a file this way when the file is not available by a URL (for example, if they are recorded locally or are not on a server).
- Send a base64 encoded file in the
audioparameter, as a string, by POST. We discourage using this parameter and even don't list it on this page in the method descriptions, but we still support it as it can be useful in some frontend applications.
The API also supports async WebSockets: connect to
wss://api.audd.io/ws/?api_token=[token] and send multiple requests (with files in binary form) without waiting for the server's responses/results.
By default, the API responses are in JSON format.
All the responses contain the
status field that equals either "success" if the request was successfully processed or "error" if there's been an error. In case of success, the server always returns the
If the server has successfully processed the request, but there are no matches, the
result field could be
null or an empty array, depending on the method.
If there are matches,
recognize method will return a
result that's a structure that always contains
song_link fields. Additionally, it has the data requested in the
return parameter in fields corresponding to the identifiers.
And just in case:
timecode is the time in the recognized song when the fragment you sent is played;
song_link links to a lis.tn song page like lis.tn/Warriors. Please let us know if you need album pages instead of song pages.
To send requests, receive a token from the Dashboard. If you want to send >100 000 requests and don't want to use our Dashboard or create a Telegram account, we can manually issue a token. In this case contact us: email@example.com, +1(302)283-9101, t.me/AudDhelp.
- There are the Code example tabs in each of the request descriptions. You can use them for reference.
- You can search for code examples on GitHub.
- We have a Chrome extension written in JS that recognizes music from the opened tab of your browser. Source code: github.com/AudDMusic/audd-chrome-extension.
- We've published an example Discord bot source code in Golang that recognizes music from a voice channel: github.com/AudDMusic/discord-bot.
We have about 40 different error codes. The API returns the errors with an explanation of what happened. The common errors:
- #901 — No api_token passed, and the limit was reached (you need to obtain an
- #900 — Wrong API token (check the
- #600 — Incorrect audio url.
- #700 — You haven't sent a file for recognition (or we didn't receive it). If you use the POST HTTP method, check the Content-Type header: it should be
multipart/form-data; also check the URL you're sending requests to: it should start with https:// (http:// requests get redirected and we don't receive any data from you when your code follows the redirect).
- #500 — Incorrect audio file.
- #400 — Too big audio file. 10M or 25 seconds is the maximum. We recommend recording no more than 20 seconds (usually, it takes less than one megabyte). If you need to recognize larger audio files, use the enterprise endpoint instead, it supports even days-long files.
- #300 — Fingerprinting error: there was a problem with audio decoding or with the neural network. Possibly, the audio file is too small.
- #100 — An unknown error. Contact us in this case.