Advertisement
ArugaZ

Youtube Search Rest API | ArugaZ

Jan 12th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const axios = require('axios');
  2.  
  3. function YoutubeSearch(QUERY) {
  4.     return new Promise((resolve, reject) => {
  5.         axios
  6.             .get('https://arugaz.my.id/api/media/ytsearch?query=' + encodeURIComponent(QUERY))
  7.             .then(req => {
  8.                 resolve(req.data)
  9.             })
  10.             .catch(reject)
  11.     })
  12. }
  13.  
  14. YoutubeSearch('ArugaZ KocakZ')
  15.     .then(res => console.log(res))
  16.     .catch(err => console.log(err))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement