Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
youtube-search-api
Advanced tools
Node.js easy to get Youtube results with playlist by provided keywords, no Login or API key required!
Youtube Search API is an API for getting Youtube search results.
npm install youtube-search-api
const youtubesearchapi = require("youtube-search-api");
youtubesearchapi.GetListByKeyword("<keywords>",[playlist boolean],[limit number],[options JSONArray])
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.
Options added, this version only support return result type, e.g. [{type:'video'}]
.
Parameter | Type | Value |
---|---|---|
keywords | String | up to you |
playlist | boolean | true/false |
limit | number | integer |
options | JSON Array | [{type:"video/channel/playlist/movie"}] |
youtubesearchapi.NextPage(<nextPage from GetListByKeywords result>,[playlist boolean],[limit number])
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>,[limit number])
Playlist Result
{items:[],metadata:{}}
youtubesearchapi.GetSuggestData([limit number])
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.
GetVideoDetails
youtubesearchapi.GetVideoDetails(<video ID>)
Get Video Details Results
{
id:"",
title: "",
thumbnail:[],
isLive: [true/false],
channel: "",
channelId:"",
description: "",
keywords:[],
suggestion: [
{id: "",
type: 'video',
thumbnail: [],
title: "",
channelTitle: "",
shortBylineText: "",
length: [Object],
isLive: [true/false]
} ...
]
}
Will return video details in Json format.
Only return short video from suggestion.
GetShortVideo
youtubesearchapi.GetShortVideo()
Get Short Video List Results
[
{
id: "",
type: "reel",
thumbnail: {
url: '',
width: 405, //only return 405
height: 720 //only return 720
},
title: '',
inlinePlaybackEndpoint: {} //may not return all the time
}
]
Will return Short Video list in Json 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.
FAQs
Node.js easy to get Youtube results with playlist by provided keywords, no Login or API key required!
We found that youtube-search-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.