{"id":541,"date":"2024-02-15T23:14:36","date_gmt":"2024-02-15T23:14:36","guid":{"rendered":"https:\/\/jazzgraphs.com\/wp2\/?p=541"},"modified":"2024-02-18T00:41:12","modified_gmt":"2024-02-18T00:41:12","slug":"checking-out-the-musicbrainz-api","status":"publish","type":"post","link":"https:\/\/jazzgraphs.com\/wp2\/2024\/02\/15\/checking-out-the-musicbrainz-api\/","title":{"rendered":"Checking Out the MusicBrainz API"},"content":{"rendered":"\n<p>For the last few year at JazzGraphs I&#8217;ve depended on the MusicBrainz database to draw data that populates many of the network graphs and other visualizations on the site. It&#8217;s an immense dataset that can be downloaded (as I&#8217;ve previously done) or accessed via the MusicBrainz API (Application Programming Interface). For upcoming visualizations, I&#8217;ve elected to go the API route, but simply as a means to access data, not to use in traditional API fashion. This approach allows for querying the topics I choose &#8211; specific artists, genres, recordings, etc. and pull down only the data needed to create a visualization.<\/p>\n\n\n\n<p>Let&#8217;s walk through a simple example for how the API can be used, stopping short of building any networks or charts for now. We&#8217;ll start with a screenshot of the API page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"419\" src=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1024x419.png\" alt=\"\" class=\"wp-image-542\" srcset=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1024x419.png 1024w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-300x123.png 300w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-768x314.png 768w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1536x629.png 1536w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image.png 1845w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">MusicBrainz API page<\/figcaption><\/figure>\n\n\n\n<p>Notice in the upper right the Search box and a dropdown list of categories. This is where we can start retrieving data. Let&#8217;s do a quick search on John Coltrane by entering his name in the search box and selecting the Artist category. Here are the results:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"529\" src=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1-1024x529.png\" alt=\"\" class=\"wp-image-543\" srcset=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1-1024x529.png 1024w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1-300x155.png 300w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1-768x397.png 768w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1-1536x794.png 1536w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-1.png 1836w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">John Coltrane search results<\/figcaption><\/figure>\n\n\n\n<p>This query yielded more than 22,000 results. Let&#8217;s narrow the results by selecting the John Coltrane Quartet from the results. We now have a much smaller set of results:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"575\" src=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-2-1024x575.png\" alt=\"\" class=\"wp-image-544\" srcset=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-2-1024x575.png 1024w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-2-300x169.png 300w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-2-768x431.png 768w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-2-1536x863.png 1536w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-2.png 1602w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">John Coltrane Quartet search results<\/figcaption><\/figure>\n\n\n\n<p>Note that we are seeing an Overview of the results; we can also select any of the other tabs to further refine the results. We&#8217;ll choose Recordings:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"641\" src=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-3-1024x641.png\" alt=\"\" class=\"wp-image-546\" srcset=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-3-1024x641.png 1024w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-3-300x188.png 300w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-3-768x481.png 768w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-3.png 1516w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">John Coltrane Quartet recordings<\/figcaption><\/figure>\n\n\n\n<p>We now have a detailed listing of all songs recorded by the quartet, along with some related information such as song length and release groups. Next, let&#8217;s explore the Relationships tab, and see what we find:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"461\" src=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-4-1024x461.png\" alt=\"\" class=\"wp-image-547\" srcset=\"https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-4-1024x461.png 1024w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-4-300x135.png 300w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-4-768x346.png 768w, https:\/\/jazzgraphs.com\/wp2\/wp-content\/uploads\/2024\/02\/image-4.png 1495w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">John Coltrane Quartet relationships<\/figcaption><\/figure>\n\n\n\n<p>Now we see all the band members who played in the quartet, as well as entries at other sites such as Allmusic and Discogs. It&#8217;s pretty powerful information all knit together via the API. I&#8217;m excited to start taking this type of data and pulling it together in a variety of data visualizations; network graphs are an obvious choice (connecting artists to recordings to labels, etc.) but there are many other possibilities.<\/p>\n\n\n\n<p>Stay tuned for some upcoming examples I&#8217;ll pull together.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the last few year at JazzGraphs I&#8217;ve depended on the MusicBrainz database to draw data that populates many of the network graphs and other visualizations on the site. It&#8217;s an immense dataset that can be downloaded (as I&#8217;ve previously done) or accessed via the MusicBrainz API (Application Programming Interface). For upcoming visualizations, I&#8217;ve elected to go the API route, but simply as a means to access data, not to use in traditional API fashion. This approach allows for querying the topics I choose &#8211; specific artists, genres, recordings, etc. and pull down only the data needed to create a visualization.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[38,15,26],"class_list":["post-541","post","type-post","status-publish","format-standard","hentry","category-jazz","category-network-graph","tag-api","tag-john-coltrane","tag-musicbrainz"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/posts\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":4,"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"predecessor-version":[{"id":550,"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/posts\/541\/revisions\/550"}],"wp:attachment":[{"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jazzgraphs.com\/wp2\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}