---
updatedAt: 2025-05-21T20:28:40.000Z
agentTools:
  projectIndex: https://docs.embed.ly/llms.txt
---

# /1/oembed

oEmbed is Embedly’s basic offering, providing a simple API for embedding content from any URL. This method follows the oEmbed standard.

## Response Attributes

`type` (required)\
The resource type. Valid values, along with value-specific parameters are\
described below.

`version` (required)\
The oEmbed version number. This must be 1.0.

`title` (optional)\
A text title describing the resource.

`author_name` (optional)\
The name of the author/owner of the resource.

`author_url` (optional)\
A URL for the author/owner of the resource.

`provider_name` (optional)\
The name of the resource provider.

`provider_url` (optional)\
The url of the resource provider.

`cache_age` (optional)\
The suggested cache lifetime for this resource, in seconds. Consumers may\
choose to ignore this value.

`thumbnail_url` (optional)\
A URL to a thumbnail image representing the resource. The thumbnail must\
respect any maxwidth and maxheight parameters. If this parameter is present,\
thumbnail\_width and thumbnail\_height must also be present.

`thumbnail_width` (optional)\
The width of the optional thumbnail. If this parameter is present,\
thumbnail\_url and thumbnail\_height must also be present.

`thumbnail_height` (optional)\
The height of the optional thumbnail. If this parameter is present,\
thumbnail\_url and thumbnail\_width must also be present.

`description`\
We support and pass back a description for all oEmbed types.

### The photo type

This type is used for representing static photos. The following parameters are\
defined:

`url` (required)\
The source URL of the image. Consumers should be able to insert this URL\
into an `<img>` element. Only HTTP and HTTPS URLs are valid.

`width` (required)\
The width in pixels of the image specified in the `url` parameter.

`height` (required)\
The height in pixels of the image specified in the `url` parameter.

### The video type

This type is used for representing playable videos. The following parameters\
are defined:

`html` (required)\
The HTML required to embed a video player. The HTML should have no padding\
or margins. Consumers may wish to load the HTML in an off-domain iframe to\
avoid XSS vulnerabilities.

`width`\
The width in pixels required to display the HTML.

`height`\
The height in pixels required to display the HTML.

### The link type

Responses of this type allow a provider to return any generic embed data (such\
as title and author\_name), without providing either the url or html parameters.\
The consumer may then link to the resource, using the URL specified in the\
original request.

### The rich type

This type is used for rich HTML content that does not fall under one of the\
other categories. The following parameters are defined:

`html` (required)\
The HTML required to display the resource. The HTML should have no padding\
or margins. Consumers may wish to load the HTML in an off-domain iframe to\
avoid XSS vulnerabilities. The markup should be valid XHTML 1.0 Basic.

`width`\
The width in pixels required to display the HTML.

`height`\
The height in pixels required to display the HTML.

## Error Codes

### JSON or XML Requests

400 Bad Request

* Required "url" parameter is missing.
* Either "url" or "urls" parameter is required.
* Invalid URL format.
* Invalid "maxheight" parameter.
* Invalid "maxwidth" parameter.
* Invalid "urls" parameter, exceeded max count of 20.

401 Unauthorized

* Invalid key or oauth\_consumer\_key provided: \<key>, contact: <support@embed.ly>.
* The provided key does not support this endpoint: \<key>, contact: <support@embed.ly>.
* URL is private or restricted.

403 Forbidden

* This service requires an embedly key parameter, contact: <support@embed.ly> or sign up: <http://embed.ly/signup>.
* Invalid IP provided: \<ip>, contact: <support@embed.ly>.
* Invalid referrer provided: \<referrer>, contact: <support@embed.ly>.

404 Not Found\
URL Not Found or unable to be accessed by Embedly servers.

`Note`:  Error message will contain Upstream server response.

500 Server issues\
Embed.ly is having trouble with this url. Please try again or contact us, <support@embed.ly>.

501 Not Implemented\
Not implemented for format: acceptable values are `{json or xml}`.

503 Service Unavailable\
`Note`: This happens if our service is down, please contact us immediately: <support@embed.ly>.

### JSONP Requests

Format\
`callbackFunction({"url": "url with error", "error_code": "error code", "error_message": "error message", "type": "error"})`

Error Response\
`jsonp1273162787542({"url": "http://flickr.com/embedly", "error_code": 404, "error_message": "HTTP 404: Not Found", "type": "error"})`

> 🚧 Want to Try out the oEmbed API?
>
> Try out our handy [oEmbed API Explorer](http://embed.ly/docs/explore/oembed). It's awesome and will allow you to preview the response of any URL.
>
> Go to the [oEmbed API Explorer](http://embed.ly/docs/explore/oembed)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.embedly.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "key",
        "in": "query",
        "x-default": ""
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/1/oembed": {
      "get": {
        "summary": "/1/oembed",
        "description": "oEmbed is Embedly’s basic offering, providing a simple API for embedding content from any URL. This method follows the oEmbed standard.",
        "operationId": "oembed",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "The URL is to retrieve embedding information. This URL must be escaped to ensure that Embedly retrieves the correct link. For example, this Embedly URL.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "urls",
            "in": "query",
            "description": "A comma separated list of urls for Embedly to process. Each URL must be escaped, but commas separating URLS must NOT be URL encoded. urls accepts a maximum of 10 urls at a time. Embedly processes these urls in parallel, therefore, it’s quicker to use urls for batched processing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxwidth",
            "in": "query",
            "description": "This is the maximum width of the embed in pixels. maxwidth is used for scaling down embeds so they fit into a certain width. If the container for an embed is 500px you should pass maxwidth=500 in the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "maxheight",
            "in": "query",
            "description": "This is the maximum height of the embed in pixels. Functions the same as maxwidth, but for the height of the embed instead. It’s noteworthy that maxwidth is preferred over maxheight.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "width",
            "in": "query",
            "description": "Will scale embeds type rich and video to the exact width that a developer specifies in pixels. Embeds smaller than this width will be scaled up and embeds larger than this width will be scaled down. Note that using this may cause distortion when scaling up embeds.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "height",
            "in": "query",
            "description": "Will scale embeds type rich and video to the exact height that a developer specifies in pixels. Embeds smaller than this height will be scaled up and embeds larger than this height will be scaled down. Note that using this may cause distortion when scaling up embeds.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "The response format – Accepted values: (xml, json)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "wmode",
            "in": "query",
            "description": "Will append the wmode value to the flash object. Possible values include window, opaque and transparent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "callback",
            "in": "query",
            "description": "Returns a (jsonp) response format. The callback is the name of the javascript function to execute.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "allowscripts",
            "in": "query",
            "description": "By default Embedly does not return script embeds for jsonp requests. They just don’t work and cause lots of issues. In some cases, you may need the script tag for saving and displaying later. In order for Embedly to send the script embeds over jsonp add allowscripts=true. Use with care, and this option is only valid when a callback is supplied, otherwise, it is ignored.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "autoplay",
            "in": "query",
            "description": "This will tell the video/rich media to automatically play when the media is loaded. Accepted values: (true, false) Default: false",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "The words parameter works by trying to split the description at the closest sentence to that word count",
            "schema": {
              "type": "string",
              "default": "50"
            }
          },
          {
            "name": "chars",
            "in": "query",
            "description": "chars is much simpler than words. Embedly will blindly truncate a description to the number of characters you specify adding ... at the end when needed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "luxe",
            "in": "query",
            "description": "With luxe Embedly’s iframe is initially loaded with poster image and play button rather than loading the whole embed. When the user clicks play the embed is loaded and starts playing.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "secure",
            "in": "query",
            "description": "secure allows you to serve embeds with a SSL connection. You can also serve images over SSL with our Display product. You can enable this by adding secure=true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "scheme",
            "in": "query",
            "description": "scheme allows to set the protocol scheme explicity to http or https. By default embeds are sent back protocol-less so that they will work in any page. You can explicity set a protocol by adding scheme=https.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "title",
            "in": "query",
            "description": "With title Embedly will set the title response attribute to the open_graph, meta, or twitter title if available in the page. Accepted values: (og, twitter, meta)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "description",
            "in": "query",
            "description": "With description Embedly will set the description response attribute to the open_graph, meta, or twitter description if available in the page. Accepted values: (og, twitter, meta)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "meta_images",
            "in": "query",
            "description": "Will return only an image found in meta tags or an API response if set.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "a",
            "in": "query",
            "description": "Turns on/off player analytics",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "dnt",
            "in": "query",
            "description": "Turns on/off Do Not Track support within embed",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"type\": \"video\",\n  \"url\": \"http://www.youtube.com/watch?v=jofNR_WkoCE\",\n  \"provider_name\": \"YouTube\",\n  \"provider_url\": \"https://www.youtube.com/\", \n  \"title\": \"Ylvis - The Fox (What Does The Fox Say?) [Official music video HD]\",\n  \"description\": \"iTunes: http://smarturl.it/YlvisFox Fra I kveld med Y...\", \n  \"author_name\": \"TVNorge\",\n  \"author_url\": \"https://www.youtube.com/user/tvnorge\",\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjofNR_WkoCE%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjofNR_WkoCE&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjofNR_WkoCE%2Fhqdefault.jpg&key=internal&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\",\n  \"width\": 854,\n  \"height\": 480, \n  \"thumbnail_url\": \"https://i.ytimg.com/vi/jofNR_WkoCE/hqdefault.jpg\", \n  \"thumbnail_width\": 480,\n  \"thumbnail_height\": 360,\n  \"version\": \"1.0\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "example": "video"
                    },
                    "url": {
                      "type": "string",
                      "example": "http://www.youtube.com/watch?v=jofNR_WkoCE"
                    },
                    "provider_name": {
                      "type": "string",
                      "example": "YouTube"
                    },
                    "provider_url": {
                      "type": "string",
                      "example": "https://www.youtube.com/"
                    },
                    "title": {
                      "type": "string",
                      "example": "Ylvis - The Fox (What Does The Fox Say?) [Official music video HD]"
                    },
                    "description": {
                      "type": "string",
                      "example": "iTunes: http://smarturl.it/YlvisFox Fra I kveld med Y..."
                    },
                    "author_name": {
                      "type": "string",
                      "example": "TVNorge"
                    },
                    "author_url": {
                      "type": "string",
                      "example": "https://www.youtube.com/user/tvnorge"
                    },
                    "html": {
                      "type": "string",
                      "example": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjofNR_WkoCE%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjofNR_WkoCE&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjofNR_WkoCE%2Fhqdefault.jpg&key=internal&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>"
                    },
                    "width": {
                      "type": "integer",
                      "example": 854,
                      "default": 0
                    },
                    "height": {
                      "type": "integer",
                      "example": 480,
                      "default": 0
                    },
                    "thumbnail_url": {
                      "type": "string",
                      "example": "https://i.ytimg.com/vi/jofNR_WkoCE/hqdefault.jpg"
                    },
                    "thumbnail_width": {
                      "type": "integer",
                      "example": 480,
                      "default": 0
                    },
                    "thumbnail_height": {
                      "type": "integer",
                      "example": 360,
                      "default": 0
                    },
                    "version": {
                      "type": "string",
                      "example": "1.0"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "javascript",
              "code": "// jQuery\n$.getJSON('https://api.embedly.com/1/oembed?' + $.param({\n  url: 'https://www.youtube.com/watch?v=jofNR_WkoCE',\n  key: \":key\"\n}));\n\n// jQuery Embedly \n$.embedly.oembed('https://www.youtube.com/watch?v=jofNR_WkoCE', {key: \":key\"});"
            },
            {
              "language": "curl",
              "code": "curl \"http://api.embedly.com/1/oembed?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjofNR_WkoCE&key=:key\""
            },
            {
              "language": "python",
              "code": "import requests\n\n# Create the query\nquery = {\n  \"url\": \"https://www.youtube.com/watch?v=jofNR_WkoCE\",\n  \"key\": \":key\"\n}\n\n# Make the call.\nr = requests.get('https://api.embedly.com/1/oembed', params=query)\n\n# print the json result.\nprint r.json()\n"
            }
          ],
          "samples-languages": [
            "javascript",
            "curl",
            "python"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```