Turn any URL into structured metadata and ready-to-use embed HTML with a single request. All endpoints are served under https://iframe.2yu.dev/api/v1.
Every request needs an API key. Create one in your dashboard. Keys look like ifr_live_…. Pass it as a Bearer token:
curl "https://iframe.2yu.dev/api/v1/extract?url=https://youtu.be/dQw4w9WgXcQ" \ -H "Authorization: Bearer ifr_live_xxxxxxxxxxxx"
/api/v1/extractFetches a URL and returns structured metadata plus responsive embed HTML.
urlmaxwidthmaxheightomit_scripttrue, strips <script> from widget embeds (Twitter/X, Instagram, TikTok).omit_attributionthemecardstylebuttoncta/compact-cta Amazon cards./api/v1/oembedA standard oEmbed 1.0 response — a drop-in for editors/CMSs that already speak oEmbed (CKEditor, TipTap, …). Accepts url (required), maxwidth, and maxheight.
/api/v1/extract/batchExtract up to 20 URLs in one call. Requires the Pro plan or higher. Each URL counts as one request against your rate limit. Partial failure is normal — the response is always 200 with per-URL status.
curl -X POST "https://iframe.2yu.dev/api/v1/extract/batch" \
-H "Authorization: Bearer ifr_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"urls":["https://youtu.be/abc","https://vimeo.com/123"]}'
# → { "results": [ { "url": "...", "status": "ok", "data": { ... } },
# { "url": "...", "status": "error", "error": "url_not_found" } ],
# "meta": { "total": 2, "succeeded": 1, "failed": 1 } }The type field tells you how to render: video/rich (use the responsive iframe html), widget (blockquote + provider script), photo, or card (generic — prefer rendering your own from meta + thumbnails).
{
"url": "https://www.youtube.com/watch?v=...",
"original_url": "https://youtu.be/...",
"type": "video",
"html": "<div style=...><iframe src=\"https://www.youtube.com/embed/...\"></iframe></div>",
"meta": { "title": "...", "description": "...", "published": "...", "cache_age": 21600 },
"provider": { "name": "YouTube", "url": "https://www.youtube.com", "display": "youtube.com", "favicon": "..." },
"authors": [ { "name": "...", "url": "..." } ],
"media": { "width": null, "height": null, "aspect_ratio": 1.7778, "type": "text/html" },
"thumbnails": [ { "url": "...", "width": 1280, "height": 720 } ]
}Limits are per API key, per rolling hour, by plan (see pricing). Every response includes:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-ResetX-CacheHIT or MISS — whether the result came from cache.Errors return a JSON body { "error": "code", "message": "..." } with an appropriate status.
url_requiredurl parameter is missing.invalid_urlinvalid_api_keyplan_requiredblocked_urlurl_not_foundupstream_timeoutrate_limit_exceededX-RateLimit-* headers.extraction_failed