Google News is a news aggregator service that provides comprehensive, up-to-date news coverage, aggregated from sources all over the world. Google News helps us stay updated so that we never miss any important updates.
In this article, we will learn how to scrape Google News articles and import Google News data to Google Sheets using Amigo, a data integration and automation tool. With Amigo, we can import all sorts of data to Google Sheets without any hassle and without coding. We can also automatically update the data at regular intervals. Just set it up once and let Amigo do the job.
Below is a snippet of articles scraped from Google Sheets and imported into Google Sheets using Google News API.
To scrape Google News articles to Google Sheets, we will follow the steps below:
Scrape and import Google News data to Google Sheets
Here’s the step-by-step guide to scraping Google News articles and importing Google News data to Google Sheets with Google News API.
Install the Amigo extension
Install the Amigo Google Sheets add-on from the Google Workspace Marketplace to scrape Google News data.
Alternatively, you can get it from Google Sheets.
- Open a new sheet
- Go to Extensions→Add-ons→Get add-ons
- Search for Amigo and install
Generate the API key
We’ll use a Google News API on RapidAPI, an API marketplace.
Sign up or log in to RapidAPI.
Choose a subscription plan from the Pricing menu to use the Google News API. We’ll choose the Basic plan, for now–you can always upgrade later.
On subscribing to the Google News API, an API key will be generated which will allow us to scrape Google News articles.
Click on Endpoints to go back to the Google News API documentation and scroll down a bit. You will find your API key under the Header Parameters.
Get the data endpoint
We can use the Get articles endpoint to scrape Google News articles for specific keywords for any period in multiple languages.
In the Required Parameters section, add your language preference. This way one can filter articles on the basis of language. For example, we will use EN code to scrape Google News articles in the English language.
In the q field under Optional Parameters, enter the search keyword for which you want to scrape articles from Google Sheets.
To filter the search result, one can enter the search query, from (start date) and to (end-date) parameters. For example, “stock” as the search query will fetch financial news articles related to the stock market.
Then (optionally) fill in the other parameters such as date, limit, properties, and so on to filter the results.
Click the Test Endpoint option to run the Google News API query.
The success message indicates that the API is functioning correctly.
The Google News API endpoint URL as well as the API headers are found under Code Snippets.
Change the language from (Node.js) Axios to Shell->cURL using the dropdown menu.
Copy the URL excluding the apostrophes and also note the headers. This is the endpoint URL for the keyword we want to scrape Google News articles and import the data to Google Sheets.
Import the data to Google Sheets
Go back to Google Sheets and launch the Amigo extension to import the Google News data to Google Sheets.
Select Custom API from the list of sources.
Enter the Google News API endpoint URL in the API URL field.
Expand the Details tab and enter the following as headers (as given in the Code Snippets):
Name: X-RapidAPI-Host, Value: google-news-api1.p.rapidapi.com
Name: X-RapidAPI-Key, Value: your_key
Replace your_key with your RapidAPI key.
Click the PREVIEW button to retrieve the Google News articles and preview them before import.
Flatten the nested datasets and then click IMPORT.
The Google News articles will be scraped and imported into Google Sheets in a moment. A snippet of the imported data is shown below.
We have learned how to import Google News data to Google Sheets. After the data have been imported, we can set a refresh schedule and the data will be updated automatically at regular intervals–weekly, daily, hourly, or on specific days. And, if we so wish, set an alert so the news is sent to us via email and/or Slack. Learn how to set a refresh schedule. This way you can track the development of a story from Google Sheets or keep track of certain keywords.
Amigo Data can connect Google Sheets to multiple sources and allows to import data automatically. It’s a convenient and versatile tool for importing and exporting data to Google Sheets. It can save a lot of time and effort. To learn more about other various kinds of data that can be imported to Google Sheets, visit our blog.
How do I scrape news headlines?
You can scrape news headlines for specific keywords with Google News API using Amigo Data. Enter the keyword in the query parameter and then retrieve the data. If you want to keep only the headlines, you can flatten the data sets and delete the information that you don’t want. Then import the news headlines to Google Sheets.
Can I scrape Google News automatically?
Yes, you can automatically scrape Google News results with Amigo Data. After you’ve scraped the news articles and imported the data into Google Sheets, set a refresh schedule. Amigo will automatically scrape and update the data at regular intervals-hourly, daily or according to the time and frequency of your choice.
Can I scrape Google Search results?
You can scrape Google Search results like you scrape Google News articles using Amigo. To scrape Google Search results, we use a different API. We have a separate article on how to scrape Google Search results. Read here.
Some related articles you may be interested in: