How to Track Search Trends with Claude Code and Google Trends

Claude Code spends a lot of time helping with content, documentation, and planning — tasks where understanding search interest is actually useful. With AgentPatch connected, it can pull Google Trends data directly during a session, without you leaving the terminal to check manually.

Why This Matters

When you’re writing documentation, planning content, or evaluating a product direction, trend data adds useful signal. Is the term you’re planning to target growing or declining? How does your primary keyword compare to alternatives? That research usually gets skipped because it requires switching context.

With the Google Trends tool available through AgentPatch, Claude Code can answer those questions inline. You ask, it fetches the data, and you keep moving.

Setup

Install the AgentPatch CLI (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Then use it:

ap search "web search"
ap run agentpatch google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Run this command to add AgentPatch as an MCP server:

claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard. Claude Code discovers all AgentPatch tools automatically.

Example

You’re working on the landing page for a developer tool and want to make sure you’re using the right terminology. You ask Claude Code:

“Before we finalize the copy, check Google Trends for ‘AI coding assistant’ vs ‘AI coding agent’ vs ‘AI pair programmer’. Which has the most search interest over the past 6 months?”

Claude Code calls the Google Trends tool for each term, compares the data, and tells you which phrase has the strongest momentum. You use that to inform the copy without leaving the session.

Later, while working on a blog post strategy, you ask:

“What’s the trend for ‘local LLM’ searches over the past year? Is interest still growing?”

Claude Code fetches the data and gives you a clear picture. That informs whether a post on local models is worth prioritizing right now or if the topic is past its peak.

Wrapping Up

One AgentPatch connection gives Claude Code access to Google Trends alongside web search, news, email, and every other tool on the marketplace. Add the MCP config once and it’s all available. Get started at agentpatch.ai.