node-google icon indicating copy to clipboard operation
node-google copied to clipboard

(READ THIS FIRST) - Correct Way to get Google Search Results

Open knoxcard opened this issue 6 years ago • 2 comments

The proper way to get Google results is to use an API key. With this module, you'll quickly run into the Google captcha issue (Google will detect an unusual amount of traffic from an IP), without using an API key.

You want to query Google directly using an API key... https://www.googleapis.com/customsearch/v1?key=<YOUR_GOOGLE_SEARCH_API_KEY>&q=Node JS

Get your Google Search API Key here: https://developers.google.com/custom-search/json-api/v1/overview

This is wayyyy faster too, you get raw JSON results directly from their server in one HTTP call. No time wasted on parsing HTML and if Google changes their HTML structure you are not dead in the water. Also, one less NPM repo in your codebase, better security.

knoxcard avatar Oct 04 '18 18:10 knoxcard

Thank you :+1:

BeauBouchard avatar Mar 02 '19 20:03 BeauBouchard

i don't agree. Using the API provides a bias about your API key in the results that you receive. Yes it is faster, but is isn't the same results... There are workarounds for the IP request limits that will ban you. I don't think that one way is "correct" over another. Google wants us to use the API? then they shouldn't skew the results from said API. This is just spreading false information...

tpickett avatar May 08 '19 21:05 tpickett