Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APIGoogle Trends

    google.trends

    Search interest over time for up to five keywords on Google Trends, with each keyword's top and rising related queries.

    Id
    google.trends
    Version
    1
    Billed per
    request — 1 unit for a charged run
    Runs
    within one request

    Start it with POST /v1/scrapers/google.trends/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.

    Inputs

    The fields of input. A field that is not listed here is refused.

    Inputs of google.trends
    FieldTypeDescription
    keywordsrequiredarray of stringOne to five search terms to compare, e.g. ["bitcoin"] or ["python", "javascript"]. Compared terms share one scale.
    geostringWhere: a two-letter country code (US, GB) or a region of one as Trends writes it (US-CA). Empty: worldwide.Default: "".
    time_rangestringThe period, as Trends writes it: now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, all (since 2004), or two dates 2025-01-01 2025-06-30.Default: "today 12-m".
    search_type"web" | "images" | "news" | "youtube" | "shopping"Which searches are counted: web search, image search, news search, YouTube search or shopping search.Default: "web".
    related_queriesbooleanAlso return each keyword's related queries (top and rising).Default: true.
    languagestringLanguage of the labels Trends writes (en-US, de, pt-BR).Default: "en-US".
    • One run is one comparison: keywords holds one to five search terms, and the run returns one record per term.
    • The values are the index Google Trends publishes, 0 to 100, not search counts: 100 is the highest point of the comparison in the period and place asked for. Terms sent in one run share that scale; average is given only then.
    • geo is a country (US) or a region of one (US-CA); left out, the data is worldwide. time_range is a period as Google Trends writes it (now 7-d, today 12-m, today 5-y, all) or two dates (2025-01-01 2025-06-30).
    • resolution is the length of one interval, chosen by Google Trends for the period: minute, hour, day, week or month. time is the interval's start in UTC; label is the interval as Google Trends writes it, in the language asked for.
    • The last interval of a period that reaches today is usually partial: it is not over, and its value will change. A value is null where there was too little data for the interval.
    • A term with too little search volume ends ok with an empty interest_over_time.
    • related_queries_top are scored 0 to 100. In related_queries_rising, value is the growth in percent and label the way Google Trends words it (+250%, Breakout). An empty list means there are none; null means they were not asked for or could not be read.
    • When the related queries of a term cannot be read the run ends partial with related_queries_missing — see the reasons of this family. Interest by region and related topics are not returned.

    Record fields

    Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.

    Record fields of google.trends
    FieldTypeNotes
    keywordstringThe search term, as asked.
    geostring or nullThe place asked for (US, US-CA); null for worldwide.
    time_rangestringThe period asked for, as Trends writes it.
    search_typestringWhich searches were counted: web, images, news, youtube or shopping.
    compared_witharray of stringThe other keywords of the same run. All of them share one scale: 100 is the highest point of any.
    resolutionstring or nullThe length of one interval of the timeline: hour, day, week, month, …, as Trends chose it for the period.
    averageinteger or nullThe keyword's average over the period on the shared scale. Trends gives it only when several keywords are compared.
    interest_over_timearray of objectThe timeline, oldest interval first. Empty when Trends has too little data for the keyword.
    time (in interest_over_time[])string (date-time)The start of the interval, in UTC.
    label (in interest_over_time[])string or nullThe interval as Trends writes it, e.g. Nov 16 – 22, 2025.
    value (in interest_over_time[])integer or nullSearch interest in the interval, 0 to 100, relative to the highest point of the whole comparison. Null when Trends had too little data for the interval.
    partial (in interest_over_time[])booleanTrue for an interval that was not over when it was read: its value will still change.Default: false.
    related_queries_toparray of object or nullThe most common queries of people who searched for the keyword, most common first. Null when they were not asked for or could not be read; an empty list when Trends has none.
    query (in related_queries_top[])stringThe related search query.
    value (in related_queries_top[])integer or nullFor a top query: its popularity, 0 to 100, relative to the most common one. For a rising query: its growth over the previous period, in percent.
    label (in related_queries_top[])string or nullThe value as Trends shows it: the score for a top query, the growth with a plus sign and a percent sign for a rising one, or Trends' word for growth too large for a figure (Breakout in English).
    url (in related_queries_top[])string or nullThe query's own page on Google Trends, for the same place and period.
    related_queries_risingarray of object or nullThe related queries that grew most over the previous period, the largest growth first. Null and empty as for the top queries.
    query (in related_queries_rising[])stringThe related search query.
    value (in related_queries_rising[])integer or nullFor a top query: its popularity, 0 to 100, relative to the most common one. For a rising query: its growth over the previous period, in percent.
    label (in related_queries_rising[])string or nullThe value as Trends shows it: the score for a top query, the growth with a plus sign and a percent sign for a rising one, or Trends' word for growth too large for a figure (Breakout in English).
    url (in related_queries_rising[])string or nullThe query's own page on Google Trends, for the same place and period.
    urlstringThe comparison's page on Google Trends.
    fetched_atstring (date-time)When the data was read, in UTC.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    curl -X POST "https://api.enrichednow.com/v1/scrapers/google.trends/runs?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"input":{"keywords":["bitcoin"],"geo":"US","time_range":"today 12-m"}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("google.trends", {
        "keywords": ["bitcoin"],
        "geo": "US",
        "time_range": "today 12-m",
    })
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("google.trends", {
      keywords: ["bitcoin"],
      geo: "US",
      time_range: "today 12-m",
    });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "google.trends", map[string]any{"keywords": []any{"bitcoin"}, "geo": "US", "time_range": "today 12-m"})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.List;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("google.trends", Map.of("keywords", List.of("bitcoin"), "geo", "US", "time_range", "today 12-m"));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run google.trends --input-json '{"keywords":["bitcoin"],"geo":"US","time_range":"today 12-m"}'

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "input": {
        "keywords": [
          "bitcoin"
        ],
        "geo": "US",
        "time_range": "today 12-m"
      }
    }

    Example response

    The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.

    JSON
    {
      "id": "run_841742f37553189ff9c27ba1",
      "scraper_id": "google.trends",
      "scraper_version": 1,
      "status": "ok",
      "reason": null,
      "input": {
        "keywords": [
          "bitcoin"
        ],
        "geo": "US",
        "time_range": "today 12-m"
      },
      "record_count": 1,
      "units": 1,
      "units_per_request": 1,
      "units_per_record": null,
      "units_per_page": null,
      "diagnostics": {
        "requests": 1,
        "bytes": 259214,
        "wall_ms": 885,
        "facts": {}
      },
      "created_at": "2026-11-16T22:37:50.170950Z",
      "started_at": "2026-11-16T22:37:50.178331Z",
      "finished_at": "2026-11-16T22:37:51.066313Z"
    }

    Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.

    JSON
    {
      "records": [
        {
          "keyword": "bitcoin",
          "geo": "US",
          "time_range": "today 12-m",
          "search_type": "web",
          "compared_with": [],
          "resolution": "week",
          "average": null,
          "interest_over_time": [
            {
              "time": "2025-11-16T00:00:00Z",
              "label": "Nov 16 – 22, 2025",
              "value": 66,
              "partial": false
            },
            {
              "time": "2025-11-23T00:00:00Z",
              "label": "Nov 23 – 29, 2025",
              "value": 47,
              "partial": false
            }
          ],
          "related_queries_top": [
            {
              "query": "bitcoin price",
              "value": 100,
              "label": "100",
              "url": "https://trends.google.com/trends/explore?q=bitcoin+price&date=today+12-m&geo=US"
            },
            {
              "query": "bitcoin stock",
              "value": 19,
              "label": "19",
              "url": "https://trends.google.com/trends/explore?q=bitcoin+stock&date=today+12-m&geo=US"
            }
          ],
          "related_queries_rising": [
            {
              "query": "spcx stock",
              "value": 18400,
              "label": "Breakout",
              "url": "https://trends.google.com/trends/explore?q=spcx+stock&date=today+12-m&geo=US"
            },
            {
              "query": "how to buy bitcoin safely",
              "value": 8100,
              "label": "Breakout",
              "url": "https://trends.google.com/trends/explore?q=how+to+buy+bitcoin+safely&date=today+12-m&geo=US"
            }
          ],
          "url": "https://trends.google.com/trends/explore?q=bitcoin&date=today%2012-m&geo=US",
          "fetched_at": "2026-11-19T18:07:40.737440Z"
        }
      ],
      "next_cursor": null
    }

    What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].

    • Shortened: interest_over_time: 53 items, the first 2 shown.
    • Shortened: related_queries_top: 25 items, the first 2 shown.
    • Shortened: related_queries_rising: 25 items, the first 2 shown.

    A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Google Trends scrapers are in their own section there.