HasData Google Trends — Claude Code MCP server: setup guide
Fetches Google Trends timeline metrics and regional interest distributions as JSON without browser automation or Google credentials.
claude mcp add google-trends -e HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/google-trends-mcpWhat HasData Google Trends does
The hasdata_google_trends_search_getTrendsData tool lets an AI agent inspect Google Trends records directly. It delivers historical interest charts and geo-targeted breakdowns. You can compare multiple search terms inside a single timeseries call instead of making repetitive requests.
Communication runs over remote HTTP or via a lightweight stdio bridge using the @hasdata/google-trends-mcp npm package or its PyPI build. Configuration relies on passing HASDATA_API_KEY through headers or process environment flags.
Without a valid HasData token, requests fail immediately. The free tier grants 1,000 monthly credits with no payment card on file, where each tool execution spends 10 credits.
What it helps with
- evaluate historical interest curves across multiple search terms
- identify emerging search queries and breakout industry topics
- inspect query popularity across specific geographic regions
- fetch structured trends JSON without maintaining scraping scripts
Example prompts for the agent
- Compare search interest between cold brew and iced coffee across the globe over the last five years.
- Retrieve US query volume for sunscreen broken down by state for the past 90 days.
- List rising search queries for cold brew coffee in the US and highlight breakout items.
How to install HasData Google Trends
1Platform CLI
claude mcp add google-trends -e HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/google-trends-mcpReplace <…> with your own values
2Platform CLI: remote server
claude mcp add --transport http hasdata-google-trends 'https://mcp.hasdata.com/mcp?apis=google_trends'1Platform CLI: remote server
codex mcp add hasdata-google-trends --url 'https://mcp.hasdata.com/mcp?apis=google_trends'2Platform CLI
codex mcp add hasdata-google-trends --env HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/google-trends-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"hasdata-google-trends": {
"url": "https://mcp.hasdata.com/mcp?apis=google_trends"
}
}
}{
"mcpServers": {
"hasdata-google-trends": {
"command": "npx",
"args": [
"-y",
"@hasdata/google-trends-mcp"
],
"env": {
"HASDATA_API_KEY": "<HASDATA_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"hasdata-google-trends": {
"type": "http",
"url": "https://mcp.hasdata.com/mcp?apis=google_trends"
}
}
}{
"servers": {
"hasdata-google-trends": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@hasdata/google-trends-mcp"
],
"env": {
"HASDATA_API_KEY": "<HASDATA_API_KEY>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http hasdata-google-trends 'https://mcp.hasdata.com/mcp?apis=google_trends'2Platform CLI
gemini mcp add -e HASDATA_API_KEY=<HASDATA_API_KEY> hasdata-google-trends npx -y @hasdata/google-trends-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about HasData Google Trends
How do I install HasData Google Trends in Claude Code?
Run this command in your terminal: claude mcp add google-trends -e HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/google-trends-mcp.
How many requests does the free tier provide?
HasData includes 1,000 free credits each month without asking for card details. Since each query uses 10 credits, that allowance covers around 100 calls.
Is a Google account necessary to fetch trends?
No Google credentials or proxy pools are needed. The MCP server fetches trend details through HasData endpoints directly.