New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

oembed-spec

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oembed-spec

A parser for oEmbed specification

latest
Source
npmnpm
Version
1.4.0
Version published
Maintainers
1
Created
Source
microlink logo microlink logo

Last version Coverage Status NPM Status

A parser for oEmbed specification.

Features

  • Always on sync with oEmbed providers (updated weekly via GitHub Actions).
  • Handle http/https & www/non-www URLs variations.
  • Ability to pass extra oEmbed parameters.
  • Built for speed (see benchmarks).

Install

$ npm install oembed-spec --save

Usage

const oEmbed = require('oembed-spec')

// Just pass the URL
oEmbed('https://youtu.be/I8u2NdWuaYs')
// {
//   provider_name: 'YouTube',
//   author_url: 'https://www.youtube.com/user/mirandaskiss'
//   html: '<iframe width="480" height="270" src="https://www.youtube.com/embed/I8u2NdWuaYs?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
// }

// http/https and www/non-www are handled
oEmbed('http://www.youtu.be/I8u2NdWuaYs')
// {
//   provider_name: 'YouTube',
//   author_url: 'https://www.youtube.com/user/mirandaskiss'
//   html: '<iframe width="480" height="270" src="https://www.youtube.com/embed/I8u2NdWuaYs?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
// }

// Pass specific oEmbed options as second parameter
oEmbed('http://www.youtu.be/I8u2NdWuaYs', { maxheight: 612 })
// {
//   provider_name: 'YouTube',
//   author_url: 'https://www.youtube.com/user/mirandaskiss'
//   html: '<iframe width="480" height="270" src="https://www.youtube.com/embed/I8u2NdWuaYs?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
// }

API

oEmbed(input, [options], [gotOpts])

input

Required
Type: string

A valid WHATWG URL.

options

Any option present will be passed against the consumer request (see oembed.com section 2.2).

gotOpts

Any option present will be passed to got.

.findProvider(url)

Standalone method for finding a provider.

.fetchProvider(provider, url, [opts], [gotOpts])

Standalone method for fetching an specific provider.

License

oembed-spec © microlink.io, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

microlink.io · GitHub microlink.io · X @microlinkhq

Keywords

oembed

FAQs

Package last updated on 04 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts