Search videos on YouTube without API key in ionic apps
Table of contents:
Quickstart
Installing the library
ionic cordova plugin add cordova-plugin-advanced-http
npm install ionic-youtube-search --save
Using the library
import * as yt from 'ionic-youtube-search';
const videos = await yt.search('y5kIrbG2gRc');
console.log('Videos:');
console.log(videos);
[
{
"id":{
"videoId":"y5kIrbG2gRc"
},
"snippet":{
"url":"https://www.youtube.com/watch?v=y5kIrbG2gRc",
"publishedAt":"3 months ago",
"thumbnails":{
"default":{
"url":"https://i.ytimg.com/vi/y5kIrbG2gRc/default.jpg",
"width":120,
"height":90
},
"high":{
"url":"https://i.ytimg.com/vi/y5kIrbG2gRc/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLC9c-4JI285aXTlg99bne9V224hVw",
"width":686,
"height":386
}
},
"duration":{
"runs":[
{
"text":"2:01"
}
],
"accessibility":{
"accessibilityData":{
"label":"2 minutes, 1 second"
}
}
},
"title":"How to Download Free Music On Your iPhone (OFFLINE) 2020",
"views":{
"runs":[
{
"text":"51 views"
}
]
}
}
}
]
const yt = require('ionic-youtube-search');
const video = await yt.info('My Search Query');
console.log('Videos:');
console.log(videos);
Supported Node.js Versions
Our client libraries follow the Node.js release schedule.
Libraries are compatible with all current active and maintenance versions of
Node.js.
License
Apache Version 2.0
See LICENSE