Looking for a lightweight and efficient way to fetch YouTube search results? Look no further!
Our @hssoftvn/yt-search-api is designed specifically for NodeJS developers who need a reliable and fast solution.
Whether you’re building a new app or enhancing an existing one, this API will streamline your YouTube data retrieval process.
Dive in now and see how it can transform your projects!
Feel free to tweak it as needed!
Project Overview
The youtube-search-api is an API for retrieving YouTube search results.
Installation
- Via npm with
npm install @hssoftvn/yt-search-api
. - Via github: TinySonhh/youtube-search-api: youtube-search-api (github.com)
Docs
Core Functions
The API includes functions like SearchVideosByKeyword
, FetchWhatToWatchByYouTube
, FetchTrending
, and GetVideoDetailsWithSuggestion
.
Examples
Install module:
- npm install @hssoftvn/yt-search-api
Create a test.js file, with content below
const ytSearchApi = require("@hssoftvn/yt-search-api");
ytSearchApi.SearchVideosByKeyword("Hello").then((result) => {
console.log(result.items[0], result.nextPage);
});
ytSearchApi.FetchWhatToWatchByYouTube().then((result) => {
console.log(result);
});
ytSearchApi.FetchTrending("0").then((result) => {
console.log(result.items && result.items[0], result.nextPage);
});
ytSearchApi.GetVideoDetailsWithSuggestion("oQl9XjVKdQ4").then((result) => {
console.log(result);
});
Run and enjoy:
- node test.js
Contributing:
Contributions are welcome, and users can submit pull requests or open issues for discussion.