oEmbed API
Get embeddable representations of URLs following the oEmbed specification. Generate iframe embeds and rich content previews for any URL.
Endpoint
HTTP
GET https://opengraph.io/api/1.1/oembed/{encoded_url}?app_id=YOUR_APP_IDParameters
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| encoded_url | string | Required. URL-encoded target URL |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| app_id | string | - | Required. Your API key |
| orientation | string | vertical | Frame orientation: vertical (800x600) or horizontal (400x150) |
| always_og_frame | boolean | false | Force OG frame generation even if native oEmbed exists |
Note: Embed dimensions are fixed based on orientation. Vertical mode produces 800x600 embeds, horizontal mode produces 400x150 embeds.
Example Request
curl "https://opengraph.io/api/1.1/oembed/https%3A%2F%2Fyoutube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ?app_id=YOUR_APP_ID"Example Response
Response
{
"type": "hybridEmbed",
"version": "1.0",
"provider_name": "Example Site",
"width": 800,
"height": 600,
"html": "<iframe src=\"...\" width=\"800\" height=\"600\"></iframe>"
}Response Fields
| Field | Description |
|---|---|
| type | The oEmbed type (usually "hybridEmbed") |
| version | oEmbed version (1.0) |
| provider_name | Name of the content provider |
| width | Width of the embed in pixels |
| height | Height of the embed in pixels |
| html | HTML snippet to embed the content (usually an iframe) |
Note: The html field contains ready-to-use HTML that can be directly inserted into your page.
Use Cases
- Embedding rich content previews in CMS platforms
- Creating link preview cards with interactive elements
- Building content aggregation tools
- Social media management dashboards