100 free credits — no credit card required.Start building
Logo
Developer tutorial

How to scrape Google Trends data with Python (2026)

This tutorial shows how to scrape Google Trends data in Python using the SocialCrawl API. You get interest-over-time and related rising queries for one or more keywords, since Google publishes no official Trends API from one GET request, with no Google Trends developer account, proxies, or HTML parsing. The code below is runnable as-is, and the response underneath it is a real, unedited call.

How it works

  1. 1
    Get a free API keyCreate a SocialCrawl account and copy your API key from the dashboard. Every new account starts with free credits.
  2. 2
    Set up PythonInstall the requests library with `pip install requests`.
  3. 3
    Call the Google Trends Explore endpointSend a GET request to /v1/google_trends/explore with your API key in the x-api-key header and the `keywords` and `timeframe` parameters.
  4. 4
    Read the responseParse the JSON. SocialCrawl returns interest-over-time and related rising queries for one or more keywords, since Google publishes no official Trends API in one normalized schema, so you write no HTML parsing or proxy code.

The code

A real, unedited response from the request above.

import requests

response = requests.get(
    "https://www.socialcrawl.dev/v1/google_trends/explore",
    headers={"x-api-key": "YOUR_API_KEY"},
    params={"keywords": "uv index", "timeframe": "past_90_days"},
)
data = response.json()
print(data)
[ RESPONSE ]
{
  "success": true,
  "platform": "google_trends",
  "endpoint": "/v1/google_trends/explore",
  "data": {
    "series": [
      {
        "keyword": "uv index",
        "points": [
          {
            "date": "2026-04-20",
            "datetime": "2026-04-20T00:00:00.000Z",
            "value": 30
          },
          {
            "date": "2026-04-21",
            "datetime": "2026-04-21T00:00:00.000Z",
            "value": 37
          }
        ]
      }
    ],
    "averages": [
      {
        "keyword": "uv index",
        "value": 55
      }
    ]
  },
  "credits_used": 5,
  "credits_remaining": 9999,
  "request_id": "req_example000000",
  "cached": false
}
API reference for this endpoint

Prefer another language?

FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
Do I need a Google Trends developer account to scrape Google Trends data?
No. SocialCrawl handles authentication and proxies upstream, so you never register a Google Trends app, manage OAuth tokens, or run your own scrapers. One API key returns Google Trends data directly.
What does the Google Trends Explore endpoint return?
It returns interest-over-time and related rising queries for one or more keywords, since Google publishes no official Trends API. The response is normalized into SocialCrawl's unified schema, identical in shape across every platform.
How much does it cost to scrape Google Trends data?
Each call costs a small number of credits, and new accounts start with free credits. There are no monthly minimums, so you pay only for the calls you make.
Can I use this Python code in production?
Yes. The snippet on this page is the real request against the live API. For production, add error handling and follow the response cursor to paginate through large result sets.

Ask AI about SocialCrawl