img | ||
.gitignore | ||
LICENSE | ||
listenbrainz.el | ||
musicbrainz.el | ||
README.org |
MusicBrainz
MusicBrainz is a community-maintained open source encyclopedia of music information. The REST-based webservice API can be used for direct access to MusicBrainz data with output in XML and JSON.
This code provides a simple, incomplete yet possibly useful interface
to some of the MusicBrainz and ListenBrainz APIs from emacs for
exploratory use in org-mode
or behind the
scenes sending listening metadata.
MusicBrainz API
- Recording documentation: https://musicbrainz.org/doc/Recording
- Release documentation: https://musicbrainz.org/doc/Release
- Artist documentation: https://musicbrainz.org/doc/Artist
searching & browsing
Search supports the full Lucene search syntax.
some examples
The API docs provide an example search for “Autechre albums & eps” using the URL https://musicbrainz.org/ws/2/release-group?artist=410c9baf-5469-44f6-9852-826524b80c61&type=album|ep
The equivalent function (which returns a raw response as an alist) would be…
"release-group" "artist" "410c9baf-5469-44f6-9852-826524b80c61" "album|ep") (musicbrainz-browse
For slightly more legible output wrap with musicbrainz-format
"release-group" "artist" "410c9baf-5469-44f6-9852-826524b80c61" "album|ep")) (musicbrainz-format (musicbrainz-browse
A more interactive approach could start with (musicbrainz-search "artist" "Autechre")
or
(musicbrainz-search-artist "Autechre")
Which returns the MBID required for the lookup → 410c9baf-5469-44f6-9852-826524b80c61
The MBID can be checked if needed, with (musicbrainz-mbid-p "410c9baf-5469-44f6-9852-826524b80c61")
The MBID can then be used for specific lookups…
"artist" "410c9baf-5469-44f6-9852-826524b80c61" "releases") (musicbrainz-lookup
"410c9baf-5469-44f6-9852-826524b80c61") (musicbrainz-lookup-artist
Autechre | electronic music duo | Group | 410c9baf-5469-44f6-9852-826524b80c61 |
"410c9baf-5469-44f6-9852-826524b80c61") (musicbrainz-lookup-artist-releases
"410c9baf-5469-44f6-9852-826524b80c61") (musicbrainz-lookup-artist-recordings
"ec1ecfcc-f529-43d1-8aa6-2c7051ede00c") (musicbrainz-lookup-release
1990 | Autechre / Saw You | Cassette Case | ec1ecfcc-f529-43d1-8aa6-2c7051ede00c |
"83730176-89ec-41a5-a4b6-476998f6291c") (musicbrainz-lookup-recording
[untitled] | 83730176-89ec-41a5-a4b6-476998f6291c |
"Warp") (musicbrainz-search-label
"Music" 5) (musicbrainz-search-label
MBID
“One of MusicBrainz' aims is to be the universal lingua franca for music by providing a reliable and unambiguous form of music identification; this music identification is performed through the use of MusicBrainz Identifiers (MBIDs). An MBID is a 36 character Universally Unique Identifier that is permanently assigned to each entity in the database, i.e. artists, release groups, releases, recordings, works, labels, areas, places and URLs. MBIDs are also assigned to Tracks, though tracks do not share many other properties of entities.”
https://musicbrainz.org/doc/MusicBrainz_Identifier
"Autechre") (musicbrainz-artist-to-mbid
410c9baf-5469-44f6-9852-826524b80c61
"410c9baf-5469-44f6-9852-826524b80c61") (musicbrainz-mbid-p
ambiguity
from the docs…
John Williams, the soundtrack composer and conductor, has an artist MBID of 53b106e7-0cc6-42cc-ac95-ed8d30a3a98e
John Williams, the classical guitar player, has an artist MBID of 8b8a38a9-a290-4560-84f6-3d4466e8d791
"John Williams") (musicbrainz-disambiguate-artist
"Bad Seeds") (musicbrainz-artist-to-mbid
7feb02f2-51fa-422d-838e-2c14ecb4c7b8
→
Tomorrows Bad Seeds
"Bad Seeds" 7) (musicbrainz-disambiguate-artist
ListenBrainz
listening
examples
setq listenbrainz-api-token "000-000-000") (
(listenbrainz-validate-token listenbrainz-api-token)
"zzzkt") (listenbrainz-listens
"zzzkt" 33) (listenbrainz-listens
"Matthew Thomas" "Taema" "Architecture") (listenbrainz-submit-single-listen
"farmersmanual" "808808008088 (11)") (listenbrainz-submit-single-listen
"farmersmanual" "808808008088 (11)") (listenbrainz-submit-playing-now
"zzzkt") (listenbrainz-playing-now
"zzzkt") (listenbrainz-stats-artists
"zzzkt") (listenbrainz-stats-releases
"zzzkt" 13 "month") (listenbrainz-stats-recordings
incompleteness
Core API endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#core-api-endpoints
POST /1/submit-listens | listenbrainz-submit-listen |
listenbrainz-submit-single-listen | |
listenbrainz-submit-playing-now | |
GET /1/validate-token | listenbrainz-validate-token |
POST /1/delete-listen | - |
GET /1/user/(playlistusername)/playlists/collaborator | - |
GET /1/user/(playlistusername)/playlists/createdfor | - |
GET /1/users/(userlist)/recent-listens | - |
GET /1/user/(username)/similar-users | - |
GET /1/user/(username)/listen-count | - |
GET /1/user/(username)/playing-now | listenbrainz-playing-now |
GET /1/user/(username)/similar-to/(otherusername) | - |
GET /1/user/(playlistusername)/playlists | - |
GET /1/user/(username)/listens | listenbrainz-listens |
GET /1/latest-import | - |
POST /1/latest-import | - |
Feedback API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#feedback-api-endpoints
POST /1/feedback/recording-feedback | - |
GET /1/feedback/recording/(recordingmsid)/get-feedback | - |
GET /1/feedback/user/(username)/get-feedback-for-recordings | – |
GET /1/feedback/user/(username)/get-feedback | - |
Recording Recommendation API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#core-api-endpoints
GET /1/cf/recommendation/user/(username)/recording | - |
Recording Recommendation Feedback API Endpoints
POST /1/recommendation/feedback/submit | - |
POST /1/recommendation/feedback/delete | - |
GET /1/recommendation/feedback/user/(username)/recordings | - |
GET /1/recommendation/feedback/user/(username) | - |
Statistics API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#statistics-api-endpoints
GET /1/stats/sitewide/artists | - |
GET /1/stats/user/(username)/listening-activity | - |
GET /1/stats/user/(username)/daily-activity | - |
GET /1/stats/user/(username)/recordings | listenbrainz-stats-recordings |
GET /1/stats/user/(username)/artist-map | - |
GET /1/stats/user/(username)/releases | listenbrainz-stats-releases |
GET /1/stats/user/(username)/artists | listenbrainz-stats-artists |
Status API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#status-api-endpoints
GET /1/status/get-dump-info | - |
User Timeline API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#user-timeline-api-endpoints
POST /1/user/(username)/timeline-event/create/notification | - |
POST /1/user/(username)/timeline-event/create/recording | - |
POST /1/user/(username)/feed/events/delete | - |
GET /1/user/(username)/feed/events | - |
Social API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#social-api-endpoints
GET /1/user/(username)/followers | listenbrainz-followers |
GET /1/user/(username)/following | listenbrainz-following |
POST /1/user/(username)/unfollow | - |
POST /1/user/(username)/follow | - |
Pinned Recording API Endpoints
https://listenbrainz.readthedocs.io/en/production/dev/api/#pinned-recording-api-endpoints
POST /1/pin/unpin | - |
POST /1/pin | - |
POST /1/pin/delete/(rowid) | - |
GET /1/(username)/pins/following | - |
GET /1/(username)/pins | - |