Here are steps to get google search results in google sheets or excel. You can also purchase this google sheet with the complete setup from the link below from here.
- Create a google sheet in your google drive.
- Create a google custom search from here.
- Enable search the entire web.
- Copy your google custom search engine id.
- Get your google custom search api key from here
- Formulate your api key in this format.
https://www.googleapis.com/customsearch/v1?key={YOUR_API_KEY}&cx={CUSTOM_SEARCH_ENGINE_ID}&q={KEYWORD}
key is your API key, cx is your google custom search id.
- In your google sheets, go to tools-> script editor-> paste the following code->save the file as ImportJSON.gs. The ImportJSON.gs can be downloaded from here https://www.aozata.com/importjson-gs/
- Enter the cx, key, search query (q), API URL in different cells.
- Use the concatenate function to join all these 4 variables to get your final API URL. For example
=concatenate(D4,D2,"&cx=",D1,"&q=",D3)
- Use the ImportJSON function to import the google search results. for example to get the title of the search results
=ImportJSON($D$5,"/items/title","noHeaders")
- Here are the search results in google sheets and also a link to the sheet where you can see the search in work.
You can also buy this sheet from our website for $9 per month.