# Embed

Schemas

Platforms' own embed code for public posts, videos, playlists and profiles: the HTML to paste, its iframe URL and size, and the title, author and thumbnail it shows.

## Endpoints

1 endpoint returns embeds on Instagram.

- [GETInstagram Embed API`/v1/instagram/embed`](https://socialtap.dev/docs/reference/instagram/embed/index.md)

## Schema

Every endpoint above returns this object as `data`. The standard [`meta`](https://socialtap.dev/docs/reference/index.md#meta) comes with every response.

| Field | Type | Description |
| --- | --- | --- |
| `platform` | `string` | Platform ID (instagram, youtube, tiktok, …). |
| `type` | `string` | What is embedded, named by its resource: post (any post: photo, carousel, video, reel), profile (an account), or playlist. New values may be added; treat unknown values as other.<br>One of `post`, `profile`, `playlist` |
| `id` | `string` | The ID the platform's embed is addressed by (as in embed_url): a post's ID (equals post.id), a playlist's ID, and for a profile the account's username on platforms whose profile embeds are addressed by it (Instagram, TikTok); the account's numeric ID, when known, is author.id. |
| `url` | `string` (uri) | Canonical public URL of what is embedded (post.url, profile.url): the link the embed opens. |
| `html` | `string` | The platform's embed code, ready to paste into an HTML page: its markup and, unless asked to leave it out, the script tag that turns it into the embedded post or profile. It loads the platform's script and content in the visitor's browser. |
| `embed_url` | `string` (uri) or `null` | The platform's embed page alone, for an iframe's src (what html's script loads); null when the platform has none. |
| `width` | `integer` or `null` | Width in pixels the embed is laid out for (its maximum when it is responsive); null when the platform does not say. |
| `height` | `integer` or `null` | Height in pixels; null when the embed sizes itself to its content (Instagram's always do). |
| `title` | `string` or `null` | The title the platform gives the embed: a post's caption or a video's title, a profile's page title; null when it has none. |
| `author` | `object` | The account the embedded item belongs to: the post's author, the playlist's owner, or for a profile the account itself. |
| `author.id` | `string` or `null` | Platform-native account ID; null when only the handle is known. |
| `author.username` | `string` or `null` | Handle without the @; null when the account has none. |
| `author.display_name` | `string` or `null` | Display name shown on the profile. |
| `author.url` | `string` (uri) or `null` | Canonical profile URL. |
| `author.avatar_url` | `string` (uri) or `null` | Profile picture URL. Platform CDN URLs can expire within hours. |
| `author.is_verified` | `boolean` or `null` | Platform verification badge; null where the platform has no badge. |
| `thumbnail_url` | `string` (uri) or `null` | Preview image URL the platform names for the embed (a post's image or cover, a profile's picture); platform CDN URLs can expire within hours. |
| `thumbnail_width` | `integer` or `null` | Width of thumbnail_url in pixels; null when unknown. |
| `thumbnail_height` | `integer` or `null` | Height of thumbnail_url in pixels; null when unknown. |
| `platform_specific` | `object` | Fields only this platform has, under its ID (platform_specific.\<platform>); each null when unknown. |

## Item errors

Besides the [request-level errors](https://socialtap.dev/docs/errors/index.md) every endpoint can return, embed endpoints return:

| Code | HTTP | Retry | Meaning | What to do |
| --- | --- | --- | --- | --- |
| `not_found` | 404 | No | The item does not exist or was deleted. On GET /v1/requests/{id}/response: the response was not kept (details.reason says why). | Check the link or ID. Do not retry. |
| `private_or_unavailable` | 403 | No | The item exists but is not public: it is private, age- or region-restricted, or needs a login to view. It shares 403 with forbidden (which is about the key), so branch on the code. | Only public items can be fetched. Do not retry. |

---

[HTML version](https://socialtap.dev/resources/embed/) · [Docs index for AI agents](https://socialtap.dev/llms.txt) · [All docs in one file](https://socialtap.dev/llms-full.txt)
