Introduction
You don't need to look further than news.google.com if you're searching for an extensive collection of news articles covering vast amounts of topics. However, the number of articles that Google News aggregates can make navigating through them a daunting task. Fortunately, Google News provides all the necessary tools for narrowing down search results and getting the information that you're interested in. In this article, we'll explore how we can use these tools with SerpApi's Google News API.
Search Operators
Google News' support for advanced search operators allows for powerful filtering capabilities. The search operators are added directly in the search query - q
parameter. Using these parameters we can filter for results that contain or exclude specific keywords or exact phrases, retrieve articles from specific websites, and specify a timeframe for when the news was published.
If you're familiar with some of the advanced search operators in the actual Google Search engine, you'll probably feel right at home, as Google News offers similar capabilities.
Exact phrase
Sometimes, we're interested in news articles that contain an exact phrase rather than specific keywords. Similarly to Google Search, you can enclose your search phrase in double quotes to retrieve precise match results for it:
Has words
The result from a search with different keywords separated by spaces will contain articles that include any of the keywords specified. This is probably the most flexible option. This way, Google's powerful algorithms will try to find the most relevant articles based on the combination of these keywords, their context, and more.
This type of search is ideal when you want to get the most relevant results based on broader criteria.
Exclude words
To exclude a specific keyword from your search results, you can just add a minus sign before it. For example, to retrieve news articles related to the NBA Playoffs but exclude results related to the Boston Celtics at the same time, we can use a NBA Playoffs -Celtics
search query:
No results related to the Boston Celtics appear in the results above.
Website
If you want to analyze what a specific website is publishing articles about, it will be useful to filter for results only from this website. Using the site:
operator in your search query provides exactly this functionality.
Date
Staying up to date on a specific topic by getting the latest news can be essential. Google News offers a search operator called when:
that allows us to limit the results to news articles published within a specific time frame in the past:
This helps us control the "freshness" of the news articles.
Past hour
Past 24 hours
Past week
Past year
Combining Search Operators
Using all of the above operators, or a combination of them, can drastically narrow down the news articles returned in the response. This is especially useful when you have very specific search criteria.
You can separate the different search operators by a space inside your search query:
Apple site:pcmag.com when:1d -Meta -Microsoft -Google
Advanced search parameters
One of the key features provided by Google News is the grouping of news articles. In addition to the filtering options discussed earlier, we can use advanced search parameters with the Google News API to filter the results by Topic, Publisher, Section, and Story.
You can retrieve the available values for the advanced search parameters listed below from the Google News API response or from the actual Google News URL after accessing the respective Topic, Publisher, Section, or Story in the platform.
topic_token
The topic_token
filters the results for a specific topic, like "Business" and "Technology", for example. Using this parameter in your requests has the same effect as selecting a topic from the navigation menu in Google News:
"Technology" Topic news articles
publication_token
The publication_token
allows you to filter news articles from a specific publisher, like PCMag or Forbes.
section_token
The topics and publisher pages in Google News have subsections as well. You can access them by using the section_token
parameter. One thing to note about this parameter is that it can only be used in combination with the topic_token
or publication_token
parameters.
Technology (Topic) - Artificial intelligence (Subsection) news articles
Forbes (Publisher) - Business (Subsection) news articles
story_token
Google news also groups results that share a similar story. You can further expand on the specific story by clicking on the Full Coverage button on their platform:
The same can be achieved in the Google News API by using the story_token
parameter in your request:
"Samsung Galaxy Unpacked event" story news results
so
By default, Google News results are sorted by relevance. You can use the so
parameter to sort the results by date instead:
"Samsung Galaxy Unpacked event" story news results sorted by date
This parameter is used in combination with the story_token
parameter and the results are sorted in a descending order. This is useful when you want to get the latest news, instead of the most relevant ones.
Conclusion
Filtering results on news.google.com is an essential skill for anyone looking to stay informed without being overwhelmed by the sheer volume of information available. By leveraging Google News API's search operators and advanced parameters, you can tailor the news results to better suit your needs.
You can always reach out to our team at contact@serpapi.com if you have any questions!