-
Notifications
You must be signed in to change notification settings - Fork 2.9k
oEmbed
reddit supports oEmbed on individual comments, and likely link posts in the future.
The oEmbed endpoint is:
And provides JSON like:
{
"provider_url": "https://www.reddit.com/",
"version": "1.0",
"title": "h5f6jdh7b9vj0d3fhtnd's comment from discussion \"We should start keeping giraffes a secret from young children. Imagine discovering giraffes exist when you were like 15. \"Woah! Check out that long necked horse!\"\"",
"provider_name": "reddit",
"type": "rich",
"html": "<div class=\"reddit-embed\" data-embed-media=\"www.redditmedia.com\" data-embed-parent=\"false\" data-embed-live=\"false\" data-embed-created=\"2015-04-29T22:33:02.658202+00:00\"><a href=\"http://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/cno7zic\">Comment</a> from discussion <a href=\"http://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/\">h5f6jdh7b9vj0d3fhtnd's comment from discussion "We should start keeping giraffes a secret from young children. Imagine discovering giraffes exist when you were like 15. "Woah! Check out that long necked horse!""</a>.</div><script async src=\"https://www.redditstatic.com/comment-embed.js\"></script>",
"author_name": "h5f6jdh7b9vj0d3fhtnd"
}
When embedded, the embed will look like:
The oEmbed endpoint also accepts some non-standard parameters to help make better embeds:
-
parent - boolean - include the parent in the embed.
-
live - boolean - allow edits made to this comment to be showed immediately.
-
omitscript - boolean - when embedding, do not append the javascript necessary to load the embed (useful when loading multiple embeds)
More on embeds here: https://www.reddit.com/wiki/embeds
Presently, only permalinks to comments are available - requests for oEmbeds of other URLs will result in a 404 response. When we add support for post embeds, we'll also support them in oEmbed format.