Improved JSON-LD extraction

MetaBrainz pages include a JSON-LD script snippet to help define a schema.org microdata. This snippet would be quite useful to place other site pages. eg. a performer who sells a CD could add the release JSON-LD snippet on their site, to help search engines link the pages.

But getting the existing JSON-LD snippet is not easy, you have look at the page HTML source code, and find the snippet, which is not formatted very well.

It would be nice to have an option that simply extracts the JSON-LS snippet and either displays it in a text box for copying, or copies the snippet directly into the clipboard.

1 Like

The JSON-LD Playground lets you provide the page URL, and it provides a formatted JSON-LD snippet, it just excludes the <script type="application/ld+json"> .. </script> tags.

You can get the pure JSON-LD by sending a request with Accept: application/ld+json, for example via curl:

curl https://musicbrainz.org/artist/22a1f4d7-81ff-4216-ac06-3387da6bc118 -H "Accept: application/ld+json"

Based on MBS-8698, that’s also what the JSON-LD Playground does.

3 Likes