# Instagram Post embed code API (instagram.oembed)

- Canonical page: [https://everyinfra.com/en/instagram-api/oembed](https://everyinfra.com/en/instagram-api/oembed?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "oembed", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=instagram&action=oembed

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | A post or Reel link, such as https://www.instagram.com/p/<shortcode>/ or https://www.instagram.com/reel/<shortcode>/. |
| hidecaption | not declared | no | not declared | `true` hides the post caption in the embed. Defaults to `false`. |
| maxwidth | integer | no | not declared | Maximum embed width in pixels, an integer from 320 to 658. Defaults to 540. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| version | (oembed) oEmbed version, 1.0. |
| type | Record type; values depend on the capability (for example video / image / text). |
| title | Title. null when the platform has no titles (for example text-only posts). |
| author_name | Author's display name. |
| author_url | Link to the author's profile on the platform. |
| author_id | Author's unique ID on the platform. |
| media_id | The numeric post ID. oembed gives it as postID_authorID. |
| provider_name | (oembed) Always Instagram. |
| provider_url | (oembed) Always https://www.instagram.com. |
| width | Width of the original image or video, in pixels. |
| html | (oembed) Embed code: a blockquote plus Instagram's embed.js that shows the official embed card. |
| thumbnail_url | Thumbnail link, lower resolution than image_url. |
| thumbnail_width | (oembed) Thumbnail width in pixels. |
| thumbnail_height | (oembed) Thumbnail height in pixels. |
| shortcode | The post shortcode: the part of the post link after /p/ or /reel/. |
| url | Link to the record on the platform. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "instagram",
  "action": "oembed",
  "params": {
    "url": "https://www.instagram.com/p/DbYmqpplO_N/"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "instagram",
        "action": "oembed",
        "params": {
            "url": "https://www.instagram.com/p/DbYmqpplO_N/",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:18:47Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "instagram",
  "action": "oembed",
  "results": {
    "version": "1.0",
    "type": "rich",
    "title": "The Sun and Moon are coming together to put on a show for Earth, and we'll be sharing it with you. 😎\n\nOn Aug. 12, a total solar eclipse will pass over Earth, and we'll be broadcasting it live along the path of totality. Check our link in bio to learn how to watch along with us!\n\n…",
    "author_name": "n•••a",
    "author_url": "https://www.instagram.com/•••",
    "author_id": "•••",
    "media_id": "3952078729724096461_528817151",
    "provider_name": "Instagram",
    "provider_url": "https://www.instagram.com",
    "width": 540,
    "html": "<blockquote class=\"instagram-media\" data-instgrm-captioned data-instgrm-permalink=\"https://www.instagram.com/reel/DbYmqpplO_N/?utm_source=ig_embed&amp;utm_campaign=loading\" data-instgrm-version=\"14\" style=\" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0…",
    "thumbnail_url": "https://scontent-lax3-1.cdninstagram.com/v/t51.82787-15/760192799_18631809481049152_7782886010573196119_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=Mzk1MjA3ODcyOTcyNDA5NjQ2MTE4NjMxODA5NDc1MDQ5MTUy.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3…",
    "thumbnail_width": 1080,
    "thumbnail_height": 1920,
    "shortcode": "DbYmqpplO_N",
    "url": "https://www.instagram.com/reel/DbYmqpplO_N/",
    "platform": "instagram"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=instagram
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
