How to scrape Google Trends data without an API!

Manpreet Singh
4 min readFeb 23, 2021

Google Trends is a great tool for market research, finding out what people are searching for can be super beneficial to you, so let’s go ahead and scrape some data from Google Trends!

Basic introduction you could probably skip that I copied from my other article

First things first, we will need to have Python installed, read my article here to make sure you have Python and some IDE installed. Next, I wrote a article on using Selenium in Python, Selenium is a web scraping package that allows us to mimic a web browser using Python, it might be best to read that article for more of an understanding on web scraping, but it’s not a necessity, you can read that article here.

Let’s get started!

Now that we have Python & an IDE / Selenium installed, let’s go ahead and run some code! First off, let’s go ahead and setup our web scraper, we do so by using the following code:

#IMPORT THESE PACKAGES
import selenium
from selenium import webdriver
#OPTIONAL PACKAGE, BUY MAYBE NEEDED
from webdriver_manager.chrome import ChromeDriverManager

As I stated in my previous articles, we are using the Google Chrome browser as our GUI, but you can use other browsers within Selenium, if you’de like to use a different browser go for it! Make sure to have the specific browser installed on your machine.

Within Selenium we need to define our web browser, so let’s do so by using the following line of code:

#THIS INITIALIZES THE DRIVER (AKA THE WEB BROWSER)
driver = webdriver.Chrome(ChromeDriverManager().install())

I would recommend running all of the code you just typed out and see if a blank Google Chrome window opens up, if so, you’re doing great 👍 !

Next up, we want to get the URL of the specific Google Trends search page, in this case we’ll use the search term “cars”. let’s go ahead and make our way to Google Trends and search cars:

As you can see theres tons of data on this page, let’s say we wanted to take the most popular related search term on Google Trends:

--

--