
oEmbed Parser
Spotlights
API Overview
Want to seamlessly integrate Tweets, YouTube videos, and more into your website? The oEmbed Parser API takes the legwork out of it! Just send it a URL, and it returns the rich oEmbed data you need to display beautiful and informative widgets. Boost user engagement and simplify content management - try the oEmbed Parser API today.
Extract oEmbed data from given URL.
oEmbed Parser API
oEmbed Parser API seamlessly extracts data from popular platforms like YouTube, Twitter, Vimeo, and many more.
Key Features
- Extract Rich Media Data: effortlessly retrieve oEmbed data from any webpage URL, enabling content embedding of images, videos, tweets, and more.
- Streamlined Workflow: eliminate the need for manual code or complex parsing solutions, oEmbed Parser delivers the data you need in a standardized format.
Authentication
Include the following headers in your requests:
X-RapidAPI-Key
: your unique RapidAPI key obtained upon registrationX-RapidAPI-Host
: set tooembed-parser.p.rapidapi.com
Request Parameters
url
(required): provide the URL of the webpage with the media embeddedlang
(optional): language of the embed, default toen
theme
(optional): color theme of the embed element, can be set todark
orlight
maxwidth
(optional): max width of the embed element, default to 600pxmaxheight
(optional): max height of the embed element, default to 400px
The effect of lang
, theme
, maxwidth
and maxheight
depends on the support of embed source provider.
Example
Request from Node.js server
We love native approach with build-in fetch
util:
import querystring from 'node:querystring'
export async function extract (url) {
try {
const queryString = querystring.stringify({
url,
lang: 'en',
theme: 'dark',
maxwidth: '600',
maxheight: '400'
})
const target = `https://oembed-parser.p.rapidapi.com/oembed/parse?${queryString}`
const res = await fetch(target, {
headers: {
'X-RapidAPI-Key': 'YOUR_OWN_RAPID_API_KEY',
'X-RapidAPI-Host': 'oembed-parser.p.rapidapi.com'
},
})
const json = await res.json()
return json
} catch (err) {
console.error(err)
return null
}
}
const data = await extract('https://www.slideshare.net/ericschmidt/trillion-dollar-coach-book-bill-campbell')
console.log(data)
Of course you can use axios
or other alternatives exist for sending requests:
import axios from 'axios'
const options = {
method: 'GET',
url: 'https://oembed-parser.p.rapidapi.com/oembed/parse',
params: {
url: 'https://www.slideshare.net/ericschmidt/trillion-dollar-coach-book-bill-campbell',
lang: 'en',
theme: 'dark',
maxwidth: '600',
maxheight: '400'
},
headers: {
'X-RapidAPI-Key': 'YOUR_OWN_RAPID_API_KEY',
'X-RapidAPI-Host': 'oembed-parser.p.rapidapi.com'
}
}
try {
const response = await axios.request(options);
console.log(response.data);
} catch (error) {
console.error(error);
}
Response in JSON format:
{
"error": 0,
"message": "oEmbed extraction success",
"data": {
"version": "1.0",
"type": "rich",
"title": "Trillion Dollar Coach Book (Bill Campbell)",
"author_name": "Eric Schmidt",
"author_url": "https://www.slideshare.net/ericschmidt",
"provider_name": "SlideShare",
"provider_url": "https://www.slideshare.net/",
"html": "<iframe src=\"https://www.slideshare.net/slideshow/embed_code/key/55xxfVqnqfzL6U\" width=\"427\" height=\"356\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;\" allowfullscreen> </iframe> <div> <strong> <a href title="\"Trillion" target="\"_blank\"">Trillion Dollar Coach Book (Bill Campbell)</a> </strong> from <strong><a href target="\"_blank\"">Eric Schmidt</a></strong> </div>\n",
"width": 425,
"height": 355,
"thumbnail": "https://cdn.slidesharecdn.com/ss_thumbnails/trilliondollarcoachslideshare-190415231411-thumbnail.jpg?width=320&height=320&fit=bounds",
"thumbnail_url": "https://cdn.slidesharecdn.com/ss_thumbnails/trilliondollarcoachslideshare-190415231411-thumbnail.jpg?width=320&height=320&fit=bounds",
"thumbnail_width": 170,
"thumbnail_height": 128,
"total_slides": 36,
"conversion_version": 2,
"slide_image_baseurl": "https://image.slidesharecdn.com/trilliondollarcoachslideshare-190415231411/85/slide-",
"slide_image_baseurl_suffix": "-638.jpg",
"version_no": "1664962315",
"slideshow_id": 140939671
}
}
If something wrong, the API will return:
{
"error": 1,
"message": "error description",
"data": null
}