Instruction how to get information from MusicBrainz database. Script above shows how to get basic information about entered artist. Script returns list of albums with release date, title, and url to front and back cover (if exits) Tutorial for MusicBrain is https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2%|%here%|% First of all we need to check artist id ====== http://www.musicbrainz.org/ws/2/artist/?query= ====== Next we can get xml contains release-list using following link: ====== http://www.musicbrainz.org/ws/2/release?artist= ====== According to the http://wiki.musicbrainz.org/%|%wiki.musicbrainz.org%|%: cover arts are available via http://coverartarchive.org%|%coverartarchive.org%|% ====== http://coverartarchive.org ====== <>Discussion [bll] 2018-11-8: To get information on a known recording, I am using: ====== http://musicbrainz.org/ws/2/recording/2409871f-6cde-42a1-a017-722b86f87e68?inc=artists%20releases%20media%20artist-credits ====== <> Let's try to get some basic info: ====== package require http package require tdom proc ___returnArtistID {artist} { set r [::http::geturl http://www.musicbrainz.org/ws/2/artist/?query=$artist] set data [::http::data $r] ::http::cleanup $r set doc [dom parse $data] set root [$doc documentElement] set ns {xmlns http://musicbrainz.org/ns/mmd-2.0#} set nodesList [$root selectNodes -namespaces $ns //xmlns:artist-list//xmlns:artist] return [[lindex $nodesList 0] getAttribute id] } proc ___coverURL {type id} { return "http://coverartarchive.org/release/$id/$type" } proc ___returnReleases {artistID} { set r [::http::geturl http://www.musicbrainz.org/ws/2/release?artist=$artistID] set data [::http::data $r] ::http::cleanup $r set doc [dom parse $data] set root [$doc documentElement] set ns {xmlns http://musicbrainz.org/ns/mmd-2.0#} set nodesList [$root selectNodes -namespaces $ns //xmlns:release-list//xmlns:release] #id used in the second query foreach node $nodesList { set date "" set id [$node getAttribute id] lappend ids $id set titleNode [$node selectNodes -namespaces $ns //xmlns:release-list//xmlns:release\[@id='$id'\]//xmlns:title] set dateNodes [$node selectNodes -namespaces $ns //xmlns:release-list//xmlns:release\[@id='$id'\]//xmlns:date] set coverFrontNode [$node selectNodes -namespaces $ns //xmlns:release-list//xmlns:release\[@id='$id'\]//xmlns:cover-art-archive//xmlns:front] set coverBackNode [$node selectNodes -namespaces $ns //xmlns:release-list//xmlns:release\[@id='$id'\]//xmlns:cover-art-archive//xmlns:back] set frontC [expr {[$coverFrontNode text] eq "true" ? [___coverURL "front" $id] : "false" }] set backC [expr {[$coverFrontNode text] eq "true" ? [___coverURL "back" $id] : "false" }] puts "##### Title: [$titleNode text] #####" puts "date: [[lindex $dateNodes 0] text]" puts "cover front: $frontC" puts "cover back: $backC" puts "##### #####" } return $ids } set artistID [___returnArtistID "portishead"] set releaseIDs [___returnReleases $artistID] puts [___returnArtistID "portishead"] ====== [DG]: I'm trying the [JSON] interface and prefer it so far. The code is much easier to get inside the data, IMO. https://musicbrainz.org/doc/Development/JSON_Web_Service%|%JSON Web Service%|% ====== package require http package require uri ;# in tcllib package require json http::config -useragent {example wiki.tcl-lang.org} proc fetchJSON {uri {recurse_limit 4}} { http::config -accept "application/json" set token [http::geturl $uri] upvar #0 $token state if {[http::status $token] ne "ok" || [http::ncode $token] != 200} { # was the error a redirect? If so, do it.. if {[http::ncode $token] == 302 && [incr recurse_limit -1] > 0} { array set meta $state(meta) set result [fetchJSON $meta(Location) $recurse_limit] http::cleanup $token return $result } set err [http::code $token] http::cleanup $token return -code error $err } set json [http::data $token] http::cleanup $token return [json::json2dict $json] } proc mblookup {entity mbid {inc {}} {method json}} { array set uri [list scheme http host musicbrainz.org path ws/2] set uri(path) [file join $uri(path) $entity] set uri(path) [file join $uri(path) $mbid] if {$inc ne ""} { set uri(query) "inc=$inc" } switch $method { json { return [fetchJSON [uri::join {*}[array get uri]]] } xml { return [[fetchXML [uri::join {*}[array get uri]]] documentElement] } } } proc test2 {mbid} { array set recInfo [list] set query [mblookup release $mbid {place-rels+release-groups} json] set status [dict get $query status] set secondaries [dict get $query release-group secondary-types] # first check that this is a live, bootleg, single show recoding if {$status eq "Bootleg" && \ [lsearch secondaries "Live"] && \ [lsearch secondaries "Compilation"] == -1 } { set placerel [lindex [dict get $query relations] 0] set recInfo(date) [dict get $placerel begin] set recInfo(title) [dict get $query title] set recInfo(place) [dict get $placerel place name] } return [array get recInfo] } % test2 817bfcee-a4ee-4afb-9314-9ae0e2885f57 place {Dallas Memorial Auditorium} title {Chasing the Dragon} date 1975-03-05 ====== <>Music|Internet