/youtube-metadata-from-url

Simple module to get a video metadata from url

Primary LanguageJavaScriptMIT LicenseMIT

youtube-metadata-from-url

Simple module to get a video metadata from url

Node.js Package

youtube-metadata-from-url is a simple module to get a youtube metadata passing just the video url.

Install

Install from the command line

$ npm i youtube-metadata-from-url

Install via github package

Example

Try it here

const youtube = require('youtube-metadata-from-url');
const url = 'https://youtu.be/TRqiFPpw2fY';

youtube.metadata(url).then(function(json) {
	console.log(json);
}, function(err){
	console.log(err);
});

Response

{
  title: 'Foo Fighters - The Sky Is A Neighborhood (Official Music Video)',
  author_name: 'foofightersVEVO',
  author_url: 'https://www.youtube.com/user/foofightersVEVO',
  type: 'video',
  height: 113,
  width: 200,
  version: '1.0',
  provider_name: 'YouTube',
  provider_url: 'https://www.youtube.com/',
  thumbnail_height: 360,
  thumbnail_width: 480,
  thumbnail_url: 'https://i.ytimg.com/vi/TRqiFPpw2fY/hqdefault.jpg',
  html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/TRqiFPpw2fY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
}

License

This project is provided for educational purposes only. It is not affiliated with and has not been approved by Youtube.