Retrieve Instagram video embed URL from API
According to Instagram's API site a GET /media/media-id request for a video object returns a JSON object with the information you need in "data.videos.low_resolution.url".
I successfully embedded the video returned by their sample request into a web page with the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Video Embed Test</title>
</head>
<body>
<video width="480" height="480" controls>
<source src="http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4"
type="video/mp4"/>
</video>
</body>
</html>
I was not able to find a way to retrieve the embed URL, however upon examining the embeds that Instagram provides, I was able to determine how to generate it based on the information provided by the Media API endpoint. Basically, you just need to append /embed/
to the end of the short url for the piece of media. So it would look something like this in a Django template:
<iframe src="{{ media.short_link }}embed/" width="612" height="710" frameborder="0" scrolling="no" allowtransparency="true"></iframe>
As an interesting side note, I also discovered that you can change the width and height in the embed code, and it works without any problem (at least when you just halve the dimensions, I didn't try anything else).