Youtube Search API is an API for getting Youtube search results.
npm install youtube-search-api
var youtubesearchapi=require('youtube-search-api');
youtubesearchapi.GetListByKeyword("<keywords>",[playlist boolean])
GetListByKeywords Result
{items:[],nextPage:{nextPageToken:"xxxxxxxx",nextPageContext:{}}}
"items" is the array from youtube, "nextPage" needs to pass when going to the next page. If playlist arg is true, will return type:'playlist'
but the videos:[]
property will not return the whole videos in the list, need to call GetPlaylistData
to get real playlist's videos. Item with Video type will return isLive=[true/false]
to identify live video or not.
youtubesearchapi.NextPage(<nextPage from GetListByKeywords result>,[playlist boolean])
NextPage Result
{items:[],nextPage:{nextPageToken:"xxxxxxxx",nextPageContext:{}}}
Item with Video type will return isLive=[true/false]
to identify live video or not.
youtubesearchapi.GetPlaylistData(<Playlist Id>)
Playlist Result
{items:[],metadata:{}}
youtubesearchapi.GetSuggestData()
Suggest Data Result
{items:[]}
Item with Video type will return isLive=[true/false]
to identify live video or not.
youtubesearchapi.GetChannelById(<channel ID>)
Channel Data Results
[
[ { title: '[title]', content: [Object] } ]
]
Will return tabs in array format.
If you want to work with me to fix bug or implement new idea. You are available to send me some new idea of this project.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- Support front-end (Vue, React) (On going)
This version 1.0.10 may fix the issue of live video detect, report by user.