Improved JSON-LD extraction

Tags: #<Tag:0x00007f0509eac850> #<Tag:0x00007f0509eac6c0>


MetaBrainz pages include a JSON-LD script snippet to help define a 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.


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 -H "Accept: application/ld+json"

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