Search code examples
instagraminstagram-api

Instagram: Get oEmbed using Media ID


Say, I have a media ID (eg. 1075297042445691366_195350057). How to get the Embed HTML using the oEmbed API?

This API accepts only shortcode (which is different from media ID).

Or How to get the shortcode of an media ID?


Solution

  • Any media object returned by the API has a field called 'link' that is the URL representation of the media. You can use this link as 'url' parameter of the oembed endpoint.