Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Learn step-by-step how to scrape Google Trends data and make a result comparison using Python and Oxylabs SERP API. Extract keywords, their popularity, breakdown by region, related queries, and more.
| Date | Stars |
|---|---|
| 2026-07-24 | 2728 |
| 2026-07-25 | 2731 |
| 2026-07-28 | 2747 |
| 2026-07-30 | 2761 |
| 2026-08-06 | 2766 |
Today
+5 stars today
This week
+5 stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.18%/day
# How to Scrape Google Trends Data With Python
[](https://oxylabs.io/products/scraper-api/serp/google?utm_source=877&utm_medium=affiliate&groupid=877&utm_content=how-to-scrape-google-trends-github&transaction_id=102c8d36f7f0d0e5797b8f26152160)
[](https://discord.gg/Pds3gBmKMH) [](https://www.youtube.com/@oxylabs)
- [Why scrape Google Trends data?](#why-scrape-google-trends-data)
- [1. Install libraries](#1-install-libraries)
- [2. Send a request](#2-send-a-request)
- [3. Save results to CSV](#3-save-results-to-csv)
- [4. Create a result comparison](#4-create-a-result-comparison)
This article provides step-by-step instructions on how to get Google Trends data with Python and [SERP Scraper API](https://developers.oxylabs.io/scraper-apis/web-scraper-api) (a part of Web Scraper API), which requires a **paid subscription** or a **free trial**.
## Why scrape Google Trends data?
Here are some of the uses for scraped Google Trends data:
- **Keyword research:** Google Trends is widely used among SEO specialists and content marketers. Since it provides insights into the past and present popularity of search terms, these professionals can tailor their marketing strategies to gain more website traffic.
- **Market research:** Google Trends data can be used for market research, helping businesses understand consumer interests and preferences over time. For example, e-commerce businesses can use Google Trends search insights for product development.
- **Societal research:** Google Trends website is a valuable resource for journalists and researchers, offering a glimpse into societal trends and public interest in specific topics.
These are just a few examples. Google Trends data can also help with investment decisions, brand reputation monitoring, and other cases.
## 1. Install libraries
For this guide, you'll need the following:
- Credentials for [SERP Scraper API](https://oxylabs.io/products/scraper-api/serp) – you can claim a **7-day free trial** by registering on the [dashboard](https://dashboard.oxylabs.io/en/);
- [Python](https://www.python.org/downloads/);
- [Requests](https://requests.readthedocs.io/en/latest/) library to make requests;
- [Pandas](https://pandas.pydata.org/docs/index.html) library to manipulate received data.
Open your terminal and run the following `pip` command:
```bash
pip install requests pandas
```
Then, import these libraries in a new Python file:
```python
import requests
import pandas as pd
```
## 2. Send a request
Let’s begin with building an initial request to the API:
```python
import requests
from pprint import pprint
USERNAME = "YourUsername"
PASSWORD = "YourPassword"
query = "persian cat"
print(f"Getting data from Google Trends for {query} keyword..")
url = "https://realtime.oxylabs.io/v1/queries"
auth = (USERNAME, PASSWORD)
payload = {
"source": "google_trends_explore",
"query": query,
}
try:
response = requests.request("POST", url, auth=auth, json=payload, timeout=180)
except requests.exceptions.RequestException as e:
print("Caught exception while getting trend data")
raise e
data = response.json()
content = data["results"][0]["content"]
pprint(content)
```
For more information about possible parameters, check our [documentation](https://developers.oxylabs.io/scraper-apis/web-scraper-api/google/trends-explore).
If everything’s in order, when you run the code, you should see the raw results of the query in the terminal window like this:

## 3. Save results to CSV
Now that you have the results, adjust the formatting and save in the CSV format – this way, it’ll be easier to analyze the data. AExcerpt of 15,441 characters
Read on GitHub14
5
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:6c3f83be0d640921, topic:web-scraping, name:scrape, desc:scrape