# Free Google Trending Searches Monitor — RSS Alerts (`marcuslee/google-trending-searches-monitor`) Actor

Track Google Trending Searches by country and send signed webhook alerts for new trends.

- **URL**: https://apify.com/marcuslee/google-trending-searches-monitor.md
- **Developed by:** [Marcus Lee](https://apify.com/marcuslee) (community)
- **Categories:** SEO tools, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Google Trending Searches Monitor

See what is rising in Google Trends for the countries you care about, keep a
small per-Task memory of previously observed titles, and optionally send only
new trends to an HTTPS webhook. It is useful for lightweight dashboards,
editorial watchlists, and automation that needs a current signal rather than a
historical archive.

### Store quick start

Choose one to ten uppercase country codes and optionally add case-insensitive
keywords. This is a copy-paste input that runs without a webhook:

```json
{
  "geos": ["AU", "US"],
  "keywords": ["ai", "weather"]
}
````

To enable alerts, add both fields. The endpoint must be HTTPS on port 443 and
the secret is used only to create the HMAC signature:

```json
{
  "geos": ["AU"],
  "keywords": ["space"],
  "webhook_url": "https://your.example/alerts",
  "webhook_secret": "replace-with-a-long-random-secret"
}
```

### OUTPUT

The dataset contains one row per currently matching trend. Every row has this
shape, including direct previews and Task runs:

```json
{
  "geo": "AU",
  "trend_id": "AU:sha256-of-normalized-title",
  "title": "Example Headline",
  "link": "https://example.test/story",
  "description": "A short trend description.",
  "pubDate": "Mon, 01 Jan 2024 00:00:00 GMT",
  "approx_traffic": "100K+",
  "picture": "https://example.test/image.jpg",
  "picture_source": "Example Source",
  "news_items": [
    {
      "news_item_title": "Related story",
      "news_item_snippet": "Related story summary.",
      "news_item_url": "https://example.test/related",
      "news_item_source": "Example News"
    }
  ],
  "is_new": false
}
```

The run mode changes the meaning of `is_new` and alerting:

- **Preview** — a direct run has no `actor_task_id`; it emits the current
  matching rows with `is_new: false`, does not write Task state, and never
  sends a webhook.
- **Baseline** — the first run of a Task emits its current rows with
  `is_new: false`, stores their IDs in a KVS named for that Task, and sends no
  alert. This prevents a first run from being a burst of notifications.
- **Delta** — later runs emit the current rows and mark newly observed IDs with
  `is_new: true`. If a webhook is configured, it receives a signed payload of
  the new rows only:

  ```json
  {"task_id":"task-id","items":[{"geo":"AU","trend_id":"AU:...","is_new":true}]}
  ```

  State is committed only after webhook delivery succeeds. If delivery fails,
  the run does not commit the new state, so a later retry can deliver the same
  alert again: webhook delivery is at-least-once.

Every run also writes this sanitized summary shape to the default key-value
store record `OUTPUT`; `run_mode` is `preview`, `baseline`, or `delta`:

```json
{
  "run_mode": "delta",
  "task_id": "task-id",
  "geos": ["AU"],
  "rows_output": 1,
  "rows_by_geo": {"AU": 1},
  "new_rows": 1,
  "baseline": false,
  "state_store": "google-trending-searches-monitor-state-task-id",
  "webhook_configured": true
}
```

Preview summaries use `task_id: null` and `state_store: null`; baseline
summaries report `baseline: true` and `new_rows: 0`. Secrets and webhook URLs
are never included in the summary.

Each geo is capped at 100 parsed, filtered, output, and remembered rows. This
keeps the state and observation window aligned, so the state limit cannot make
the same 101st row alert forever.

### Limits and security

The actor reads the public Google Trends RSS feed. Feed availability, country
coverage, item ordering, freshness, rate limits, and field shape are external
limits; the feed is not a historical archive. It supports at most ten geos and
requires an RSS channel containing at least one usable item. A title is the
stable identity, so a title returning after it falls outside the bounded
window can be observed as new again.

Webhook delivery accepts only HTTPS port 443. Every literal or DNS-resolved
address must be globally public IPv4/IPv6; private, loopback, link-local,
multicast, reserved, unspecified, and other non-global addresses are rejected.
The connection dials the validated IP while retaining the original hostname
for TLS SNI and the `Host` header. Redirects are not followed and delivery is
limited to three attempts. The body is signed with
`X-Hub-Signature-256: sha256=<hex>`; the secret is never written to output.

This Actor is free; users pay only normal Apify platform compute/storage/network usage.

If this actor is useful, bookmark it in the Store and leave an honest review
after trying it. The project is independent and is not affiliated with,
endorsed by, or sponsored by Google or Apify.

### Local development

```sh
pip install -r requirements-dev.txt
pytest
```

The Docker image uses Python 3.12 and the pinned `apify==1.7.2` SDK. A live
feed probe and deployment review remain outside the deterministic test suite.

# Actor input Schema

## `geos` (type: `array`):

One to ten uppercase ISO alpha-2 country codes.

## `keywords` (type: `array`):

Optional case-insensitive substrings matched against item and news text; up to 50 keywords.

## `webhook_url` (type: `string`):

Optional HTTPS endpoint. DNS and IP SSRF checks run before delivery.

## `webhook_secret` (type: `string`):

At least 16 characters; used for the HMAC-SHA256 signature header.

## Actor input object example

```json
{
  "geos": [
    "AU"
  ],
  "keywords": []
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("marcuslee/google-trending-searches-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("marcuslee/google-trending-searches-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call marcuslee/google-trending-searches-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=marcuslee/google-trending-searches-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Free Google Trending Searches Monitor — RSS Alerts",
        "description": "Track Google Trending Searches by country and send signed webhook alerts for new trends.",
        "version": "0.1",
        "x-build-id": "MrnBsWRx2WhjH3gmt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/marcuslee~google-trending-searches-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-marcuslee-google-trending-searches-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/marcuslee~google-trending-searches-monitor/runs": {
            "post": {
                "operationId": "runs-sync-marcuslee-google-trending-searches-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/marcuslee~google-trending-searches-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-marcuslee-google-trending-searches-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "geos": {
                        "title": "Country codes",
                        "minItems": 1,
                        "maxItems": 10,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "One to ten uppercase ISO alpha-2 country codes.",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                        },
                        "default": [
                            "AU"
                        ]
                    },
                    "keywords": {
                        "title": "Keywords",
                        "maxItems": 50,
                        "type": "array",
                        "description": "Optional case-insensitive substrings matched against item and news text; up to 50 keywords.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        },
                        "default": []
                    },
                    "webhook_url": {
                        "title": "Webhook URL",
                        "type": "string",
                        "description": "Optional HTTPS endpoint. DNS and IP SSRF checks run before delivery."
                    },
                    "webhook_secret": {
                        "title": "Webhook secret",
                        "type": "string",
                        "description": "At least 16 characters; used for the HMAC-SHA256 signature header."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
