OpenGraph.io

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_ID

Parameters

Path Parameters

ParameterTypeDescription
encoded_urlstringRequired. URL-encoded target URL

Query Parameters

ParameterTypeDefaultDescription
app_idstring-Required. Your API key
orientationstringverticalFrame orientation: vertical (800x600) or horizontal (400x150)
always_og_framebooleanfalseForce 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

FieldDescription
typeThe oEmbed type (usually "hybridEmbed")
versionoEmbed version (1.0)
provider_nameName of the content provider
widthWidth of the embed in pixels
heightHeight of the embed in pixels
htmlHTML 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

Related