Get autocomplete search queries for YouTube without API keys!
-
Install module using
npm i youtube-autocomplete
-
Require the module
const AutoComplete = require('youtube-autocomplete');
-
AutoComplete(query, callback)
- function-
query
- String : Search query for which you want suggestions -
callback(err, queries)
- function : Callback functionerr
- Error : Error message if an error occurs,null
if successfulqueries
- Object : Suggestion queries in JSON format
-
-
Example code:
const AutoComplete = require('youtube-autocomplete');
AutoComplete('quer', (err, queries) => {
if (err) throw err;
console.log(queries);
});
MIT Copyright © 2018 Akash Rajendra