node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Build Status

Embed Url

A small library that allows to embed and extract content from third party providers url. This module manage:

  • Dailymotion video urls
  • Flickr photo urls
  • Instagram post urls
  • Pinterest board and pin urls
  • Tumblr post urls
  • Twitter urls (Tweets)
  • Vimeo video urls
  • Youtube video urls


Node.js - Version >=4.3.2


Use npm:

$ npm install embed-url --save

Or you can clone and install HEAD:

git clone
cd embed-url
npm install

Getting Started

For some providers, credentials configurations are mandatory. To start using the embed-url module with Flickr, Instagram, Tumblr, Twitter, Youtube Urls, don't forget to update the credentials concerned in the "provider-config/credentialsConfig.js" file.

How to get the credentials:

This module utilizes ES6 Promises to handle the API calls.


const embedurl = require('embed-url');

To extract datas from a single url use the following...

    .then(result => {
    	// do stuff
    	console.log("Embed url", result)
    .catch(error => {
    	// errors will bubble up through the reject method of the promise.
        // you'll want to console.log them otherwise it'll fail silently
        console.log("Error", error)

The result returned in from the promise will be a Result object.

Returned Data

The API returns an object. Below is an example

{ mediaId: '1552321983961937074_25998477',
  title: 'Sem Photoshop, é rosa mesmo! 😉👍🏼 #lascoloradas #yucatán #mexico #roadtrip',
  embedUrl: '',
  thumbnail: '',
  provider: 'instagram',
  url: '',
  typeMedia: 'photo',
  instagram:  {
  //Here the original object returned from the provider API if you need more data than the ones above


npm test

Some tests will return "ERROR" due to missing api key


In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.


Copyright © 2017 Tekdreams. MIT Licensed.