You can quickly grab embed code for any toot, by choosing the Embed option from the [...] menu on the Mastodon web interface underneath the toot.

Alternatively, you can use the oEmbed API to get the same iFrame code directly. For example, the embed below could be retrieved using

curl ""

The HTML is in the html property in the JSON reponse.
  "type": "rich",
  "version": "1.0",
  "author_name": "Andy Piper",
  "author_url": "",
  "provider_name": "",
  "provider_url": "",
  "cache_age": 86400,
  "html":"\u003ciframe src=\"\" class=\"mastodon-embed\" style=\"max-width: 100%; border: 0\" width=\"400\" allowfullscreen=\"allowfullscreen\"\u003e\u003c/iframe\u003e\u003cscript src=\"\" async=\"async\"\u003e\u003c/script\u003e"
  "width": 400,
  "height": null
This is what that looks like when rendered.