ilhamdev commited on
Commit
5dee7f1
·
verified ·
1 Parent(s): f21cdcf

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +17 -3
index.js CHANGED
@@ -461,6 +461,11 @@ const app = express()
461
  method: "GET",
462
  example: `${host}/fb?url=`
463
  },
 
 
 
 
 
464
  {
465
  title: "Instagram Downloader",
466
  method: "GET",
@@ -505,7 +510,7 @@ const app = express()
505
  title: "Youtube Search",
506
  method: "GET",
507
  example: `${host}/ytsearch?q=`
508
- }
509
  ]
510
  })})
511
 
@@ -795,8 +800,17 @@ console.log(e);
795
  return res.json({ message: e.message });
796
  }
797
  })
798
-
799
-
 
 
 
 
 
 
 
 
 
800
  .get('/mega', async (req, res) => {
801
  try {
802
  let { url } = req.query;
 
461
  method: "GET",
462
  example: `${host}/fb?url=`
463
  },
464
+ {
465
+ title: "Google Search",
466
+ method: "GET",
467
+ example: `${host}/googleSearch?q=`
468
+ },
469
  {
470
  title: "Instagram Downloader",
471
  method: "GET",
 
510
  title: "Youtube Search",
511
  method: "GET",
512
  example: `${host}/ytsearch?q=`
513
+ },
514
  ]
515
  })})
516
 
 
800
  return res.json({ message: e.message });
801
  }
802
  })
803
+ .get('/googleSearch', async (req, res) => {
804
+ try {
805
+ let q = req.query.q || req.query.query;
806
+ if (!q) return res.json({ message: 'Input parameter q' });
807
+ let get = await (require("google-it"))({"query": q})
808
+ return res.json(get)
809
+ } catch (e) {
810
+ console.log(e);
811
+ return res.json({ message: e.message });
812
+ }
813
+ })
814
  .get('/mega', async (req, res) => {
815
  try {
816
  let { url } = req.query;