Scrape Bing search into sheets

In this article, we will see how o scrape Bing search results using Google sheets. The IMPORTJSON is a much more sophisticated function that the IMPORTXML function. This involves creating a custom search engine using google.

scrape bing search results using Google sheets

  1. Create a google custom search engine.
  2. Under sites to search, enter
  3. Copy your search engine ID.
  4. Create a Google sheet.
  5. Go to tools-> script editor and paste the following code from
  6. Get a google custom search API Key from here.
  7. Formulate your api key in this format.
  8. Enter the cx ID, API 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
  10. Use the IMPORTJSON function to get the search results into the sheet.
    1. For title- =ImportJSON($D$9,“/items/title”,“noHeaders”)
    2. For URL- =ImportJSON($D$9,“/items/link”,“noHeaders”)
    3. FOr snippet- =ImportJSON($D$9,“/items/snippet”,“noHeaders”)
    4. For Image- =ImportJSON($D$9,“/items/pagemap/cse_image/src”,“noHeaders”)
    5. For meta description =IF(ISERROR(importxml(D12,“//meta[@name=’description’]/@content”)),“”,importxml(D12,“//meta[@name=’description’]/@content”))
  11. Here is a sample sheet that does this.

By Muthali Ganesh

I am an engineer wih a masters in business administration from Chennai, India. I love discovering and sharing hacks.