microlink logo

Turn youtube.com into structured data

Microlink SDK

Make your content attractive

Microlink SDK converts youtube.com links into beautiful previews, engaging better your links.

iframe

const mql = require('@microlink/mql')

module.exports = props => {

  const { status, data } = await mql('https://www.youtube.com/watch?v=9P6rdqiybaw', {
    video: true,
    audio:true,
    palette: true,
    iframe: true,
    ...props
  })
}

large

const mql = require('@microlink/mql')

module.exports = props => {

  const { status, data } = await mql('https://www.youtube.com/watch?v=9P6rdqiybaw', {
    video: true,
    audio:true,
    palette: true,
    iframe: true,
    ...props
  })
}

normal

const mql = require('@microlink/mql')

module.exports = props => {

  const { status, data } = await mql('https://www.youtube.com/watch?v=9P6rdqiybaw', {
    video: true,
    audio:true,
    palette: true,
    iframe: true,
    ...props
  })
}

small

const mql = require('@microlink/mql')

module.exports = props => {

  const { status, data } = await mql('https://www.youtube.com/watch?v=9P6rdqiybaw', {
    video: true,
    audio:true,
    palette: true,
    iframe: true,
    ...props
  })
}

Features

Capabilities under the hood.

  • Background Refresh
    Stale revalidation, keeping things fresh and always up to date via ttl, reflecting any change on the target URL.
  • Unified Metadata
    Normalized from Open Graph, JSON+LD or HTML markup, such as author, images, colors, dates, lang, etc.
  • Caching Level
    Using Microlink CDN to deliver a different resource each time the query string changes.
  • Color Detection
    Get predominant and complementary colors per every image detected.
  • Contextual Data
    Get more from any data, expanding it to get extra useful information.
  • Media Detection
    Get the original source of any image, video or audio.
  • Native Embeds
    Using oEmbed to get the embedded representation of any URL.
  • Prerender Ready
    Cloud based solution with superior operational performance.
  • Cloud Browsing
    Fast, scalable, and reliable browser automation.
  • Background Refresh
    Stale revalidation, keeping things fresh and always up to date via ttl, reflecting any change on the target URL.
  • Unified Metadata
    Normalized from Open Graph, JSON+LD or HTML markup, such as author, images, colors, dates, lang, etc.
  • Caching Level
    Using Microlink CDN to deliver a different resource each time the query string changes.
  • Color Detection
    Get predominant and complementary colors per every image detected.
  • Contextual Data
    Get more from any data, expanding it to get extra useful information.
  • Media Detection
    Get the original source of any image, video or audio.
  • Native Embeds
    Using oEmbed to get the embedded representation of any URL.
  • Prerender Ready
    Cloud based solution with superior operational performance.
  • Cloud Browsing
    Fast, scalable, and reliable browser automation.

Microlink API

Build APIs from websites

Microlink Query Language (MQL) is a programmatic way to getting content from any URL.

Using MQL (docs)

const mql = require('@microlink/mql')

module.exports = props => {

  const { status, data } = await mql('https://www.youtube.com/watch?v=9P6rdqiybaw', {
    video: true,
    audio:true,
    palette: true,
    iframe: true,
    ...props
  })
}

Using Microlink CLI (docs)

$ microlink-api https://www.youtube.com/watch?v=9P6rdqiybaw
{
  "title": "Wormholes Explained – Breaking Spacetime - YouTube",
  "description": "To support Kurzgesagt and learn more about Brilliant, go to https://www.brilliant.org/nutshell and sign up for free. The first 688 people that go to that link will get 20% off the annual Premium subscription. Are wormholes real or are they just magic disguised as physics and maths? And if they are …",
  "lang": "en",
  "author": "RealLifeLore • 17M views",
  "publisher": "YouTube",
  "image": {
    "url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/img.youtube.com!vi!9P6rdqiybaw!maxresdefault.jpg.jpg",
    "type": "jpg",
    "size": 120116,
    "height": 720,
    "width": 1280,
    "size_pretty": "120 kB",
    "palette": [
      "#C004F9",
      "#EEEEA7",
      "#25047C",
      "#740296",
      "#808018",
      "#2C0494"
    ],
    "background_color": "#EEEEA7",
    "color": "#AC04DF",
    "alternative_color": "#2C0494"
  },
  "audio": {
    "url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/r3---sn-h5q7dnld.googlevideo.com!videoplayback!c=WEB&clen=8935291&cms_redirect=yes&dur=552.054&ei=Pa",
    "type": "mp4",
    "duration": 552.054422,
    "size": 8935291,
    "duration_pretty": "9m",
    "size_pretty": "8.94 MB"
  },
  "url": "https://www.youtube.com/watch?v=9P6rdqiybaw",
  "iframe": {
    "html": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/9P6rdqiybaw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>",
    "scripts": []
  },
  "date": "2020-01-11T10:45:09.000Z",
  "logo": {
    "url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/s.ytimg.com!yts!img!favicon_144-vfliLAfaB.png.png",
    "type": "png",
    "size": 16275,
    "height": 144,
    "width": 144,
    "size_pretty": "16.3 kB",
    "palette": [
      "#FC0404",
      "#FC7474",
      "#830101",
      "#970101",
      "#950303",
      "#970101"
    ],
    "background_color": "#FC0404",
    "color": "#320000",
    "alternative_color": "#320101"
  },
  "video": {
    "url": "https://cdn.microlink.io/data/assets/youtube.com!watch!v=9P6rdqiybaw/r3---sn-h5q7dnld.googlevideo.com!videoplayback!c=WEB&cms_redirect=yes&dur=552.054&ei=PacZXpC4BqKDhAf",
    "type": "mp4",
    "duration": 552.007943,
    "size": 54633895,
    "height": 720,
    "width": 1280,
    "duration_pretty": "9m",
    "size_pretty": "54.6 MB"
  },
  "screenshot": {
    "url": "https://cdn.microlink.io/screenshot/youtube.png"
  }
}