The endpoints documented on this page were deprecated on October 24, 2020 and now return an error code 400
. Please use the new Instagram oEmbed endpoint instead.
You can get a public Instagram photo or video post’s embed HTML code and use it to embed the post in other websites. Embedded posts automatically resize to fit their container, so they will look great on both desktop and mobile websites.
People own their Instagram content, so each embedded post gives proper attribution by displaying the post owner’s username and linking to the post owner’s profile.
The GET /oembed
and GET /p/{post-url}/media
endpoints are only meant to be used for embedding Instagram content on websites and apps. They are not to be used for any other purpose. Using metadata and media content (or their derivations) from the APIs for any purpose other than providing a front-end view of the media content is strictly prohibited. This prohibition encompasses consuming, manipulating, extracting, or persisting the metadata and media content, including but not limited to deriving information about posts from the metadata for analytics purposes.
Returns a JSON object containing the post’s embed HTML code along with additional data about the post and post owner. Use the embed HTML code to embed the post in a website.
No access tokens or permissions are required.
GET https://api.instagram.com/oembed
Key | Value Description |
---|---|
| The post's URL. |
| A JSON callback to be invoked. |
| If set to |
| Maximum width of returned media. Must be greater than |
| If set to |
| Set to |
A JSON object containing the the post’s embed HTML code and additional data about the post and post owner. The embed HTML code will be assigned to the html
property.
https://api.instagram.com/oembed?url=https://www.instagram.com/p/fA9uwTtkSN/
{ "version": "1.0", "title": "Wii Gato (Lipe Sleep)", "author_name": "diegoquinteiro", "author_url": "https://www.instagram.com/diegoquinteiro", "author_id": 9538472, "media_id": "558717847597368461_9538472", "provider_name": "Instagram", "provider_url": "https://www.instagram.com", "type": "rich", "width": 658, "height": null, "html": "<blockquote class=\"instagram-med... ", "thumbnail_url": "https://scontent-sjc3-1.cdni...", "thumbnail_width": 640, "thumbnail_height": 640 }
Embed HTML code contains post HTML and a reference to the Instagram embed.js JavaScript library. When the library loads, it scans the page for the post HTML and generates the fully rendered post. If you want to load the library separately, include the omitscript
query string parameter in your request. To manually initialize the embed code, call the instgrm.Embeds.process()
function after loading the library
The embedded post is responsive and will adapt to the size of its container. This means that the height will vary depending on the container width and the length of the caption. You can set the maximum width by including the maxwidth query string parameter in your request.
Redirects to one of three versions of the post’s image file. If loading the embed code is not an option and you embed an Instagram image this way, you must provide clear attribution next to the image, including attribution to the original author and to Instagram, and a link to the Instagram media page. Use the GET /oembed
endpoint to determine author information.
No access tokens or permissions are required.
GET /p/{post-url}/media
Placeholder | Value Description |
---|---|
| The post's URL. |
Key | Value Description |
---|---|
| The size of the post image you want returned. Supported values are |
| Set to |
The post’s image file (JPG).
https://instagram.com/p/fA9uwTtkSN/media/?size=t
https://scontent-sjc3-1.cdninstagram.com/v/t51.2885-15/e15/s150x150/11358196_1472850273007829_614249870_n.jpg?_nc_ht=scontent-sjc3-1.cdninstagram.com&_nc_cat=105&_nc_ohc=FpsdQMVbM6AAX8zwNvs&oh=b42d2a9cc8d08acce945b675ef4e952f&oe=5E6BFACA