The first step is to sign up for an API key. Starting in April 2012, we will refuse API queries without a valid API key.
Free Music Archive provides a basic API to access artist, album, track, genre and curator data, in XML, JSON or JSONP format.
You can access all the data by formatting URLs like so:
... will return a list of FMA curators in XML format.
API Demo - apidemo.freemusicarchive.org
a basic demo to create static playlists using FMA + Echo Nest
FMA Radio - fma.jsawruk.com
advanced static playlists using FMA + Echo Nest searches for similar artists, mood, style, license
Unity3D Playlists - http://wiki.musichackday.org/index.php?title=Unity-echonest
A Unity3D plugin that dynamically generates soundtracks based on FMA + Echo Nest
Certain parameters can be passed via query string to your request to sort, paginate, and filter the resulting dataset.
Pagination & Sorting
All results are paginated and set to a limit of 20 per page by default. This can be set directly via a 'limit' query string parameter, with a maximum allowed value of 50, like so:
You can also page a 'page' query string parameter to navigate to specific result pages of the dataset:
Each dataset indicates the total number of records ('total'), the total number of pages ('pages'), the current page ('page'), and the current record limit per page ('limit').
Each dataset can also be sorted by any field that is returned, using 'sort_by' and 'sort_dir' (sort direction) query string parameters. The 'sort_by' parameter can be any field returned in the set (listed below) and 'sort_dir' can be set to 'asc' (ascending) or 'desc' (descending).
Certain datasets can also take extra query string parameters to filter results. For example, albums can be filtered by an artist's 'artist_id' value, like so:
All records accessible via the api have corresponding "handles", which are unique string identifiers for each record. You can can find handles at the end of the URLs throughout the site, and use them instead of ids. For instance, WFMU's curator page is here:
'wfmu' is the "curator_handle", which you can use to query all of WFMU's albums:
Specific filter options are listed per dataset below.
(string) include album with album handle
(integer) include albums with artist id
(string) include albums with artist handle
(string) include albums with genre handle
(string) include albums with curator handle
(string) include albums with album url
(string) include albums with album title
(string) include albums with album handle
(integer) include only track with track id
(integer) include tracks with artist id
(integer) include tracks with album id
(integer) include tracks with genre id
(string) include tracks with genre handle
(string) include tracks with artist handle
(string) include tracks with curator handle
(string) include tracks with album url
(string) include tracks with album title
(string) include tracks with album handle
(boolean) include tracks where permitted use for commercial purposes
(boolean) include tracks where permitted to remix
(boolean) include tracks where permitted to add to podcast
(boolean) include tracks where permitted to sync with video
(boolean) include tracks added in the last week
(boolean) include tracks added in the last month
(boolean) include only instrumental tracks
(boolean) include only radio safe tracks
(time) include tracks at leasts as long as (must be in 'HH:MM:SS' format)
(time) include tracks no longer than (must be in 'HH:MM:SS' format)
Make an effort to avoid excessive queries. Cache responses to avoid duplicating queries. If you expect a large volume of traffic (more than 10000 per day), please contact us (firstname.lastname@example.org) to discuss.