Google Search API Wrapper for Node.js

I am looking for a wrapper for the Google search API that will be used in Node.js, I searched but did not find something updated and completely baked. Can someone recommend something working? Thanks

+6
source share
4 answers

Why don't you use the node client library for the Google APIs? https://github.com/google/google-api-nodejs-client

var googleapis = require('googleapis'); googleapis.discover('customsearch', 'v1').execute(function(err, client) { // set api key client.withApiKey('...'); client.search.cse.list({ q: '...' }).execute(console.log); }); 
+6
source

I assume you do not mean the deprecated Google Web Search API ...

Custom Search APIs are RESTful APIs. This means that you can easily access it without a specialized shell.

There are several modules that make this easier. I usually use the request module, which makes it very easy to make HTTP requests.

+3
source

I just used node-google-images and it worked right away in less than 2 minutes:

https://github.com/vdemedes/node-google-images

Just call

 npm install google-images 

and then

 client = require( 'google-images' ); client.search( 'Chicken Teriyaki', function (err, images) { console.log(images) }); 

will return

[{width: '1920', height: '1280', url: ' http://www.springkitchenrestaurant.com/Chicken_Teriyaki.jpg ', writeTo: [Function]}]

(in fact, it will return 4 results, but stackoverflow will not allow me to send more than two links ... - you get the gist!)

+3
source

You can use the jsearch module. Install with:

 npm install jsearch 

Using:

 js.google('queryStringYouWant',10,function(response){ console.log(response) // for Google results }) 
+1
source

Source: https://habr.com/ru/post/913520/


All Articles