Google Trends API

Programmatic real-time trending searches, search volume spikes, and breakout keywords.

What is this API?

Serqo’s Google Trends API provides clean, structured JSON access to real-time trending searches and breakout topics across 52 countries and 19 categories. Unlike fragile web scrapers that frequently fail due to Google layout changes, Serqo delivers predictable, parsed JSON payloads with normalized volume, growth rates, article counts, and related search queries.

Common use cases

  • Power trending topic widgets and real-time news aggregation dashboards.
  • Detect breakout keyword opportunities for SEO and content creation before competitors.
  • Analyze viral spikes and sudden search volume shifts across global markets.
  • Fuel algorithmic trading, sentiment analysis, and social listening workflows.
  • Automate social media trend monitoring and marketing campaign ideation.

Request example

POST https://serqo.io/v1/trends

Both POST (JSON body) and GET (query string parameters) are supported on /v1/trends.

Request headers

Create an API key and store it on your server. Send the API key in the x-api-key header.

HeaderValueDescription
Content-Typeapplication/jsonJSON request body (for POST).
x-api-keyYOUR_API_KEYAPI key used to authenticate the request.
bash (cURL)
export SERP_API_KEY='YOUR_API_KEY'

curl https://serqo.io/v1/trends \
  -H "x-api-key: $SERP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "geo": "US",
  "category": "Technology",
  "period": "24h",
  "sort": "search-volume",
  "limit": 10
}'

Available categories and geographies

Call GET /v1/trends/meta to fetch the active list of supported categories, country codes, time periods, and sort orders in both English and Chinese.

bash (Meta endpoint)
curl -H "x-api-key: $SERP_API_KEY" https://serqo.io/v1/trends/meta

Code examples

Use the same API key with a standard HTTP client. These examples require Node.js 22 or later, or Python 3.

JavaScript (Node.js)
const response = await fetch('https://serqo.io/v1/trends', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.SERP_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    geo: 'US',
    category: 'Technology',
    period: '24h',
    sort: 'search-volume',
    limit: 10,
  }),
});

const data = await response.json();
for (const item of data.data.trends) {
  console.log(`#${item.rank} ${item.keyword} (${item.searchVolume.toLocaleString()} searches, +${item.growth}%)`);
}
Python 3 (httpx / requests)
import os
import requests

response = requests.post(
    'https://serqo.io/v1/trends',
    headers={
        'x-api-key': os.environ['SERP_API_KEY'],
        'Content-Type': 'application/json',
    },
    json={
        'geo': 'US',
        'category': 'Technology',
        'period': '24h',
        'sort': 'search-volume',
        'limit': 10,
    },
    timeout=10,
)

payload = response.json()
for trend in payload['data']['trends']:
    print(f"Rank {trend['rank']}: {trend['keyword']} (Vol: {trend['searchVolume']}, Growth: +{trend['growth']}%)")

Parameters

ParameterTypeDefaultDescription
geostringUSTwo-letter ISO country code (e.g. US, GB, DE, JP).
categorystring | numberallCategory name or numeric ID (e.g. Technology or 18).
periodstring24hTime window for trending metrics: 4h, 24h, 48h, 7d.
sortstringsearch-volumeSorting criteria: search-volume, growth, recency, title.
limitnumber20Maximum number of trending topics to return (1 to 100).

Response schema

HTTP 200. A structured JSON envelope containing parsed trends, volume metrics, and related search queries:

JSON Response
{
  "success": true,
  "requestId": "req_f7dd5016-3ea6-470b-b952-a51bb73b63fe",
  "data": {
    "trends": [
      {
        "rank": 1,
        "keyword": "microsoft code red",
        "normalizedKeyword": "microsoft code red",
        "geo": "US",
        "searchVolume": 20000,
        "growth": 400,
        "startTimestamp": 1795538400,
        "startTime": "2026-11-24T16:40:00.000Z",
        "isNew": false,
        "categoryIds": [18],
        "categories": [
          { "id": 18, "name": "Technology", "nameZh": "科技" }
        ],
        "relatedQueries": [
          "microsoft code red",
          "microsoft outage code red",
          "cloud"
        ],
        "articleCount": 11,
        "articles": [
          { "id": "4952966199", "lang": "en", "geo": "US" }
        ]
      }
    ]
  },
  "meta": {
    "geo": "US",
    "countryName": "United States",
    "countryNameZh": "美国",
    "category": "Technology",
    "categoryId": 18,
    "period": "24h",
    "sort": "search-volume",
    "durationMs": 3023,
    "totalCandidates": 528,
    "totalResults": 1,
    "datasetFrom": "2026-11-24T01:20:00.000Z",
    "datasetTo": "2026-11-25T01:00:00.000Z",
    "credits": 1,
    "cache": "miss"
  }
}

Pricing and limits

Transparent credit deduction with zero charge on cache hits or failures:

Cache hits are free: Repetitive queries served from cache within the TTL consume 0 credits.

No charge on failure: Upstream timeouts and network errors automatically release credit reservations.

Singleflight aggregation: Concurrent identical requests are merged into a single upstream fetch without duplicate billing.

Frequently asked questions

How does billing work for Google Trends searches?

Each successful Google Trends request consumes exactly 1 credit. Identical queries served from the in-memory cache consume 0 credits. Upstream timeouts or errors release credit reservations without charge.

What categories and countries are supported?

We support 52 major countries (US, GB, DE, JP, IN, etc.) and 19 standard Google categories (Technology, Business, Entertainment, Sports, etc.). Query GET /v1/trends/meta at any time for the complete dictionary.

Start fetching real-time Google Trends data

Register now and get 500 free search credits. Zero credit card required.

Start free