Google Search Console
Google Analytics 4
Bing Webmaster
A powerful Agent Skill and Python Automation Tool designed to provide a 360-degree view of your website's search performance. By seamlessly integrating the APIs of Google Search Console (GSC), Google Analytics 4 (GA4), and Bing Webmaster Tools, this project empowers your AI Agents (or CI/CD pipelines) to autonomously perform deep SEO automation, traffic diagnosis, and cross-platform keyword research.
Keywords: seo-agent, ai-seo, web-analytics, ga4, google-analytics, google-search-console, agent-skill, mcp-server
For most mainstream AI Agents (such as Cursor, Cline, Claude Code, Antigravity, etc.), the simplest and recommended way is to directly share this repository URL with the AI and let it autonomously read and mount this skill.
You can simply copy and paste this prompt to your AI assistant:
"Please read and install this AI Agent Skill: https://github.com/SeoToolkit/web-analytics-agent-skill . Read the
SKILL.mdfile carefully to understand how to use it."
Alternatively, if your AI assistant supports reading skills directly from the workspace, simply clone it into your project:
git clone https://github.com/SeoToolkit/web-analytics-agent-skill.git .skills/web-analytics-agent-skill| Google Search Console | Google Analytics 4 | Bing Webmaster Tools |
|---|---|---|
![]() |
![]() |
![]() |
- Google Search Console: Fetch indexing and keyword ranking data, clicks, and impressions.
- Google Analytics 4 (GA4): Track actual user sessions, bounce rates, and traffic sources.
- Bing Webmaster Tools: Pull search stats directly from Bing for cross-engine comparison.
- Clone the repository, create a virtual environment, and install dependencies:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt - Copy
.env.exampleto.envand proceed to configure the channels you need.
- Auth Method: API Key (Manual)
- Setup Steps:
- Go to Bing Webmaster Tools.
- Click the Gear icon (Settings) -> API Access -> API Key.
- Generate and copy the API key.
- Environment Variables (
.env):BING_API_KEY: Your copied API Key.BING_SITE_URL: Your Bing verified domain (e.g.,https://example.com).
- Auth Method: OAuth 2.0 (Manual
client_secret.json+ Auto Browser Prompt) - Setup Steps:
- Go to Google Cloud Console and create a project.
- Search for and enable the Google Search Console API.
- Configure the "OAuth consent screen" (External type, add your email as a test user).
- Go to "Credentials" -> "+ Create Credentials" -> "OAuth client ID".
- Select "Desktop app", create it, and click download JSON.
- Rename it to
client_secret.jsonand place it in the project root directory. - (Automated) The script will pop up a browser for you to log in on its first run.
💡 Important Note on Permissions: Make sure the Google account you log in with has read access to your GSC and GA4 properties. You must check the boxes to grant access to Search Console and Analytics data during the popup. If you get a 403 error later, the AI agent will usually catch it and remind you to check your permissions.
- Environment Variables (
.env):GSC_SITE_URL: Your exact GSC property URL (e.g.,sc-domain:example.comorhttps://example.com/).SITE_LAUNCH_DATE: (Optional) Your website's launch date for metrics (Format:YYYY-MM-DD).
- Auth Method: OAuth 2.0 (Uses the same
client_secret.json+ Auto Browser Prompt) - Setup Steps:
- In the same Google Cloud project, search for and enable the Google Analytics Data API.
- Ensure your
client_secret.jsonis in the project root. - (Automated) The script will pop up a browser for you to log in on its first run.
- Environment Variables (
.env):GA4_PROPERTIES: Your GA4 property ID and label (Format:PropertyID=Label, e.g.,123456789=MyWebsite).
Here are the required formats for the files you need to prepare:
Create this file in the project root:
# Bing Webmaster Tools
BING_API_KEY=your_bing_api_key_here
BING_SITE_URL=https://yourdomain.com
# Google Search Console
GSC_SITE_URL=sc-domain:yourdomain.com
SITE_LAUNCH_DATE=2024-01-01
# Google Analytics 4
GA4_PROPERTIES=123456789=yourdomain.comThis is the file downloaded directly from Google Cloud Console. It should look like this (do not change its structure):
{
"installed": {
"client_id": "YOUR_CLIENT_ID.apps.googleusercontent.com",
"project_id": "your-project-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "YOUR_CLIENT_SECRET",
"redirect_uris": ["http://localhost"]
}
}Instruct your AI agent to run the unified execution script. This script automatically handles virtual environment setup, dependencies, and runs all analysis tools sequentially:
./run_all.shOr you can run individual scripts manually:
scripts/auth_google.py: A dedicated script to handle Google OAuth 2.0 authorization. Running this explicitly generates thetoken.jsonfile. (Note: Other scripts will automatically call this flow if the token is missing, so running this manually is optional).scripts/analyze_gsc.py: Fetches Google Search Console data.scripts/ga4_both.py: Fetches Google Analytics 4 data.scripts/bing_webmaster.py: Fetches Bing Webmaster Tools data.
source .venv/bin/activate
python3 scripts/auth_google.pyBecause this skill is built as a standard CLI tool outputting structured text, it is supported out-of-the-box by any AI agent with shell execution capabilities:
- Claude Code (Anthropic's CLI agent)
- Antigravity (Google DeepMind's agent)
- Cursor & Windsurf (IDE-based agents)
- Open Interpreter
- Codex-based Agents & Copilot
- Any custom agent built with LangChain, AutoGen, or CrewAI
You can paste these directly into Claude, ChatGPT, or your custom Agent:
- "Run the unified analytics script
./run_all.shto check my Google Search Console and GA4 data for the last 7 days, then write a summary report." - "Execute the web analytics skill, compare my Bing search traffic with Google's, and tell me which keywords are performing better on Bing."


