Converting a URL into an iframe

Last updated:

"Iframely" is a way one piece of content from a site gets moved to another site. It is both technical and trust intermediary between consumers and providers of rich media.

While we support over 2000 providers, Iframely doesn't wrap entire pages into iframes. Our platform is designed to retrieve rich media players for videos, slideshows, or other interactive content. Moreover, you don't need Iframely to build a basic iframe. You can do so entirely on your side and you need very little help with that (see below). Our focus is to ensure our customers get the right embed codes for rich media content they can trust.

Here's more about how Iframely works:

  • Content parsing: when you input a URL, Iframely parses the webpage and tries to detect recognized protocols and embed codes. For example, if you link to a YouTube video, Iframely will find the appropriate player embed code provided by YouTube itself.
  • Supported embeds: if the publisher has rich media embeds (like video players, slideshows, or maps), Iframely will retrieve the necessary code and render it within an iframe so the content appears in your application.
  • Fallback to URL summary cards: if no embed code is available, Iframely generates a summary card with a preview of the URL. This is similar to how platforms like Twitter or Facebook display URL previews.

Many websites have restrictive policies that prevent their pages from being embedded in this way. Additionally, wrapping entire web pages can lead to inconsistent and lackluster user experience, layout issues, and poor performance.

However, if you do need to wrap a page into an iframe for your app, here's how to verify that a publisher permits it.

  • Reach out to us to let us know you need it. We'll add a feature flag for it to your account with us.
  • The feature will provide values of X-Frame-Options and Content-Security-Policy (CSP) headers for the given URL if any restrictive policies are set by the publisher. These headers regulate whether a URL can be embedded as an iframe.
  • You will get the value of those headers in the `meta` section of Iframely API JSON as `xframe` and `csp` fields respectively. Please check the values to see if you can build an iframe for your URL. For simplicity, we recommend handling any returned values of those headers as an indication that you should not embed the URL of that provider as an iframe.