Here are steps to get google search results in google sheets or excel

  1. Create a google sheet in your google drive.google search results in google sheets or excel
  2. Create a google custom search from here.
  3. Enable search the entire web.google search results in google sheets or excel
  4. Copy your google custom search engine id.google search results in google sheets or excel
  5. Get your google custom search api key from heregoogle search results in google sheets or excel
  6. Formulate your api key in this format.

    key is your API key, cx is your google custom search id.
  7. In your google sheets, go to tools-> script editor-> paste the following code->save the file as ImportJSON.gs

     
  8. Enter the cx, key, search query (q), API URL in different cells.
  9. Use the concatenate function to join all these 4 variables to get your final api url. For example

     
  10. Use the ImportJSON function to import the google search results. for example to get the title of the search results

     
  11. Here are the search results in google sheets and also a link to the sheet where you can see the search in work.

Articles you may like

Categories: Uncategorized

Muthali Ganesh

Reach out to muthali at muthaliganesh77 at gmail.com

5 Comments

Meera Sanghavi · April 29, 2019 at 6:33 am

Hi,

This is a very valuable piece of information. Thank you for it. However I am not able to implement it. Initially I got ‘Loading’ message for very long which I thought would be because there are too many results and second time I tried then I am getting reference error.

To give more details, I am basically trying to extract details like Name, Phone, Number and address from Google search or from specific website such as http://www.grotal.com into my excel/google sheet when I enter a query such as Karate Classes in Navi Mumbai. Can you please help me out here?

    Muthali Ganesh · April 30, 2019 at 2:03 am

    What you are looking to do is scraping and is not related to this article

Matej · April 30, 2019 at 7:09 pm

Thanks, your instructions are clear and solution works great. What I am still trying to figure out is where (in importJSON.gs) do I limit the number of results to 1?

    Muthali Ganesh · May 1, 2019 at 3:40 pm

    Hello Matej, Try using &num=1 in the google custom search api

Ludo · May 20, 2019 at 12:51 pm

Hi, thanx for info. To make it work for me I had to substitute “,” for “;” in all formulas. It works now, but I get only 10 results. Is there a way to show 100 lines of results? Thanx for answer.

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami