Twitter Moment oEmbed API
Returns a simple embed HTML for a single Twitter Moment specified by a Moment URL, in an oEmbed-compatible JSON format.
The Moment markup is meant to be cached on your servers for up to the suggested cache lifetime specified by the cache_age
property.
Resource URL
https://publish.twitter.com/oembed.json
Resource Information
Response formats
JSON
Requires authentication?
No
Rate limited?
No
Query parameters
url required
The URL of the Twitter Moment to be embedded.
Example Values:
To embed the Moment at https://twitter.com/i/moments/650667182356082688
, use: https%3A%2F%2Ftwitter.com%2Fi%2Fmoments%650667182356082688
limit
Display up to N items, where N is a value between 1 and 20 inclusive.
Example Value: 6
maxwidth
Set the maximum width of the displayed embed in whole pixels. Minimum value: 220.
Example Value: 450
omit_script
Do not include Twitter’s widgets Javascript in the response.
Example Request
GET
https://publish.twitter.com/oembed.json?url=https%3A%2F%2Ftwitter.com%2Fi%2Fmoments%2F650667182356082688
Example Result
{ "url": "https://twitter.com/i/moments/650667182356082688", "title": "The Obamas' wedding anniversary", "html": "<a class=\"twitter-moment\" href=\"https://twitter.com/i/moments/650667182356082688\">The Obamas' wedding anniversary</a><script async src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>", "width": 500, "cache_age": 3153600000000, "provider_name": "Twitter", "provider_url": "https://twitter.com", "version": "1.0", "type": "rich" }