Iframely unique content identifiers

For content management systems, Iframely can generate short ID for each unique URL. Use it to source iFrames in HTML embed codes, edit URL options, for batch URL refreshes or to request different formats such as AMP.

Content IDs are unique within your account and are linked to your API settings. The feature is available on subscription plans that support it or during initial trial period.

Content IDs are a permanent source of Iframely iFrames in HTML codes and URL data and survive the termination: we keep maintaining the embed codes and refresh related media content even if you no longer have an active subscription with us.

Because of this commitment, URLs with associated IDs are stored permanently on Iframely network, unlike regular URLs that get cleaned up after a period of inactivity according to our privacy policy.

How to get content IDs

There are three scopes you can request to generate content IDs for:

iFrames only

Configure this as default for iFrame srcs in your iFrames settings.

When Iframely needs to generate an iFrame helper based on publisher's data or according to your other API settings, the html field for such embed codes will link to permanent public short URL address:

<iframe src="//cdn.iframe.ly/ABCDEFG" ...></iframe>

By default, and on plans that don't support content IDs, our iFrame codes link to the hashed API key instead:

src="//cdn.iframe.ly/api/iframe?url=...&key=..." ...

id=1
To activate IDs for all URLs, wheather we wrap HTML embed code into our iFrame helper or not, make you API call with &id=1 query-string parameter in oEmbed or Iframely formats. You'll get content id field in response JSON even when Iframely returns the native embed code from publisher without our iFrame helper.
id=0

This query-string parameter overrides your iFrames settings, and forces iFrame helpers, if any, to link to your hashed API key instead.

Iframely Content IDs are case-sensitive.

API calls with content IDs instead of URLs

When content ID is available, it will be returned as id field in the JSON response. You can use it for subsequent API calls to Iframely. Such API calls don't require your API key and are a good fit for public facing implementations.

Fetch single content by ID

If you have received short id for your previous API call, your repeat calls may go directly to:

Such API calls do not require api_key and are publicly available (yet are still linked to your account).

You may add any optional API parameters to such anonymous calls. For example, quickly get an AMP-formated iFrame with &iframe=amp.

If you fetch JSON data from users' browser, please use CDN: cdn.iframe.ly/{ID}.json (or your own domain if you're on "bring your own CDN")

Batch request up to 100 IDs

Instead of making a hundred API calls, we suggest you combine it into one. Simply generate an endpoint address this way: IDs delimited with - hyphen. For example,

Again, you can use any of the optional API parameters.

The response will contain Iframely or oEmbed JSONs as values, with IDs as the root level keys:

    {
        "ID1": {
                ...
            },
        "ID1": {
                ...
            },

        ...

        "IDn": {
                ...
            }        
    }

In other words, body.IDn from response of such batch calls will be the same JSON object as if you called iframe.ly/IDn.json or iframe.ly/IDn.oembed for a single ID.

The order of IDs in response may not match the order from request. We fill the data based on latency of an individual ID.

Previous article: Lazy-loading
Next article: URL Options