# Support for JSON-LD in onebox

**URL:** https://meta.discourse.org/t/support-for-json-ld-in-onebox/129839
**Category:** Feature
**Tags:** onebox
**Created:** [September 30, 2019, 8:22am UTC](https://meta.discourse.org/t/support-for-json-ld-in-onebox/129839 "2019-09-30T08:22:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 30, 2019, 8:22am UTC](https://meta.discourse.org/t/support-for-json-ld-in-onebox/129839/1 "2019-09-30T08:22:38Z")

</div>

Continuing the discussion from [Rich link previews with Onebox](https://meta.discourse.org/t/rich-link-previews-with-onebox/98088/34):

@Anatolia made a request for a richer onebox for Imdb that includes ratings. I think it is a great request but there is a bunch of missing info in the standard embedding meta tags.

On deeper analysis it looks like imdb supports:

> **[JSON-LD](https://en.wikipedia.org/wiki/JSON-LD)**
>
> JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding linked data using JSON and of serializing data similarly to traditional JSON. It is meant to be simple to create by modifying JSON documents. JSON-LD is a World Wide Web Consortium Recommendation initially developed by the JSON for Linking Data Community Group, transferred to the RDF Working Group for review, improvement and standardization, and now maintained by the JSON-LD Working Group.
> JSON-LD is based on the concep...

In particular:

[https://m.imdb.com/title/tt0253474/](https://m.imdb.com/title/tt0253474/)

Ships:

```plaintext
<script type="application/ld+json">{
  "@context": "http://schema.org",
  "@type": "Movie",
  "url": "/title/tt0253474/",
  "name": "The Pianist",
  "image": "https://m.media-amazon.com/images/M/MV5BOWRiZDIxZjktMTA1NC00MDQ2LWEzMjUtMTliZmY3NjQ3ODJiXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_.jpg",
  "genre": [
    "Biography",
    "Drama",
    "Music",
    "War"
  ],
  "contentRating": "R",
  "actor": [
    {
      "@type": "Person",
      "url": "/name/nm0004778/",
      "name": "Adrien Brody"
    },
    {
      "@type": "Person",
      "url": "/name/nm0470981/",
      "name": "Thomas Kretschmann"
    },
    {
      "@type": "Person",
      "url": "/name/nm0277975/",
      "name": "Frank Finlay"
    },
    {
      "@type": "Person",
      "url": "/name/nm0288976/",
      "name": "Emilia Fox"
    }
  ],
  "director": {
    "@type": "Person",
    "url": "/name/nm0000591/",
    "name": "Roman Polanski"
  },
  "creator": [
    {
      "@type": "Person",
      "url": "/name/nm0367838/",
      "name": "Ronald Harwood"
    },
    {
      "@type": "Person",
      "url": "/name/nm0844262/",
      "name": "Wladyslaw Szpilman"
    },
    {
      "@type": "Organization",
      "url": "/company/co0024473/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0030304/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0053177/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0104170/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0028557/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0047476/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0024879/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0043688/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0049230/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0086499/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0086504/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0074041/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0002254/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0058058/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0031772/"
    },
    {
      "@type": "Organization",
      "url": "/company/co0078675/"
    }
  ],
  "description": "The Pianist is a movie starring Adrien Brody, Thomas Kretschmann, and Frank Finlay. A Polish Jewish musician struggles to survive the destruction of the Warsaw ghetto of World War II.",
  "datePublished": "2002-09-25",
  "keywords": "pianist,holocaust,jewish,survival,poland",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingCount": 658161,
    "bestRating": "10.0",
    "worstRating": "1.0",
    "ratingValue": "8.5"
  },
  "review": {
    "@type": "Review",
    "itemReviewed": {
      "@type": "CreativeWork",
      "url": "/title/tt0253474/"
    },
    "author": {
      "@type": "Person",
      "name": "Fella_shibby"
    },
    "dateCreated": "2013-09-09",
    "inLanguage": "English",
    "name": "A Masterpiece. Awesome acting by Brody.",
    "reviewBody": "This is a truly heart-wrenching story of one man whose family gets perished in the Holocaust and about his survival over solitude, deprivation, starvation and terror while in hiding during the Nazi occupation. In my opinion it is one of the finest depictions of the holocaust. This movie came close to Schindlers list in depicting the horrors of Holocaust. Brody puts in a marvelous and utterly touching performance. The story depicts the emotional and cultural breakdown of persecuted Jewish community as Nazi policy tightens around them. Excellent acting by Brody.",
    "reviewRating": {
      "@type": "Rating",
      "worstRating": "1",
      "bestRating": "10",
      "ratingValue": "10"
    }
  },
  "duration": "PT2H30M",
  "trailer": {
    "@type": "VideoObject",
    "name": "The Pianist",
    "embedUrl": "/video/imdb/vi988938521",
    "thumbnail": {
      "@type": "ImageObject",
      "contentUrl": "https://m.media-amazon.com/images/M/MV5BMmQ4MWQzNDEtYmI4Zi00NmY0LWEwYTEtZTg4MmQ3MDM2YmJlXkEyXkFqcGdeQXVyNzU1NzE3NTg@._V1_.jpg"
    },
    "thumbnailUrl": "https://m.media-amazon.com/images/M/MV5BMmQ4MWQzNDEtYmI4Zi00NmY0LWEwYTEtZTg4MmQ3MDM2YmJlXkEyXkFqcGdeQXVyNzU1NzE3NTg@._V1_.jpg",
    "description": "Theatrical Trailer from Focus Features",
    "uploadDate": "2008-04-11T16:41:43Z"
  }
}</script>

```

I wonder if we should teach onebox to support JSON LD for cases like this?

---

<div class="post-metadata">

### Author: ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)
#### Post date: [May 28, 2021, 9:54am UTC](https://meta.discourse.org/t/support-for-json-ld-in-onebox/129839/2 "2021-05-28T09:54:58Z")

</div>

That would be great for videos too, in case no oembed but JSON LD is available:

> [@Rumble.com onebox for videos not working / Video object JSON LD](https://meta.discourse.org/t/rumble-com-outbox-for-videos-not-working-video-object-json/191902):
>
> Many users share videos from [rumble.com](http://rumble.com) in our community. However, onebox does not create proper video embeds for this ever-growing video platform: However, the website provides the necessary data for the embed via Json video object scheme (like many other video websites): [ { "@context": "http://schema.org", "@type": "VideoObject", "name": "Puppy Hilariously Thinks He's An Actual \"Mountain Bike\"", "playerType": "HTML5", "description": "Gus the Cockapoo loves all out…

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 13, 2022, 3:53pm UTC](https://meta.discourse.org/t/support-for-json-ld-in-onebox/129839/3 "2022-06-13T15:53:23Z")

</div>

We got this PR merged 🎉

[https://github.com/discourse/discourse/commit/f0c6dd56825d96dce337e709c71d41740cbbca99](https://github.com/discourse/discourse/commit/f0c6dd56825d96dce337e709c71d41740cbbca99)
