# Live Search Console Data

> Get live Google Search Console and GA4 data in your agent in 30 seconds. No Google Cloud project, no API keys, no OAuth setup. One sign-in, and your agent can query real GSC clicks, impressions, rankings, and GA4 sessions. Use when Codex needs authenticated access to live Google search and analytics data for any SEO analysis.

- **Type:** Skill
- **Install:** `agentstack add skill-marketingskills-seo-live-search-console-data`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [marketingskills](https://agentstack.voostack.com/s/marketingskills)
- **Installs:** 0
- **Category:** [Data & Analytics](https://agentstack.voostack.com/c/data-and-analytics)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [marketingskills](https://github.com/marketingskills)
- **Source:** https://github.com/marketingskills/seo/tree/main/skills/live-search-console-data
- **Website:** https://marketingskills.net

## Install

```sh
agentstack add skill-marketingskills-seo-live-search-console-data
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Live Search Console Data

## Overview

Get live Google Search Console and GA4 data in your agent in 30 seconds. No Google Cloud project to create, no API keys to request, no OAuth consent screen to configure. One Google sign-in and your agent can query real clicks, impressions, rankings, sessions, and conversions. Uses RefreshAgent as an authenticated proxy — keep secrets out of prompts and repositories. Prefer the bundled helper because it can authenticate, save, and reuse the user's local key without exposing it in chat.

## First-Use Login

Before doing any SEO analysis, check whether the user already has a saved RefreshAgent key by running exactly one lightweight helper command first. Expect this first command to open a browser login if `~/.config/refreshagent/.env` does not exist yet:

```bash
python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  GET /api/v1/clients --login
```

If the helper opens a browser, tell the user that RefreshAgent needs one Google sign-in on first use, then wait for the command to finish. Do not investigate missing output as a data/API problem while the login is pending. Do not start Search Console and GA4 discovery in parallel until this first command has completed and saved the key.

After the first command succeeds, continue with resource discovery (`/api/v1/sc/sites`, `/api/v1/ga4/properties`) and the user's requested analysis. Later runs should reuse the saved key and should not open a browser.

## Authentication

Send the API key in the `X-API-Key` header.

Do not save API keys in skill files, repositories, shell history, examples, or final answers. Prefer:

```bash
export REFRESHAGENT_API_KEY="..."
```

The helper also checks `~/.config/refreshagent/.env`. If no key exists, it opens `https://refreshagent.com/auth/cli` with a localhost callback, waits for Google login, saves the returned key to `~/.config/refreshagent/.env`, and then continues the original API request.

When running commands from an agent, use the helper directly. If it starts login, tell the user to complete the browser sign-in and return to the agent. Do not ask the user to manually paste a key unless browser login is unavailable.

## Quick Start

Use `scripts/refreshagent_api.py` for authenticated REST calls:

```bash
python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  GET /api/v1/sc/sites
```

To force setup without making an API request:

```bash
python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  GET /api/v1/clients --login
```

Examples:

```bash
python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  GET /api/v1/sc/summary --param site_url=https://example.com/

python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  GET /api/v1/sc/query --param site_url=sc-domain:example.com --param date_range=30d

python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  GET /api/v1/sc/keyword-position --param site_url=sc-domain:example.com --param keyword="example keyword"

python3 /home/dunc/.codex/skills/live-search-console-data/scripts/refreshagent_api.py \
  POST /api/v1/proposals/build/start --json '{"site":"https://example.com","audience":"agency"}'
```

Use `--base-url` only when targeting a non-production RefreshAgent host.

## Workflow

1. Run the first-use login/setup command above and wait for it to finish if no saved key is present.
2. Identify the metric source: Search Console (`/api/v1/sc/...`), GA4 (`/api/v1/ga4/...`), clients (`/api/v1/clients`), or proposals (`/api/v1/proposals/...`).
3. If the site or property identifier is unknown, list available resources first with `/api/v1/sc/sites`, `/api/v1/ga4/properties`, or `/api/v1/clients`.
4. Use explicit dates when the user asks for a time period. GSC data can lag by 2-3 days; mention that when interpreting "today" or very recent windows.
5. Inspect `cache.cached` and `cache.age_seconds` before presenting results as fresh.
6. Preserve raw metric meaning: GSC `position` is average search position where lower is better; `position_change` is positive when rank improved.
7. Summarize results in business language, but keep enough raw numbers for auditability.

## Common Endpoints

- `GET /api/v1/sc/sites`: list Search Console sites available to the API key.
- `GET /api/v1/sc/summary`: clicks and impressions for 30d/7d versus previous periods.
- `GET /api/v1/sc/query`: top queries, optional exact `keyword`, date range, and device filter.
- `GET /api/v1/sc/pages`: top pages by clicks.
- `GET /api/v1/sc/keyword-analysis`: top 50 queries for deeper analysis.
- `GET /api/v1/sc/keyword-position`: exact keyword current/previous metrics.
- `GET /api/v1/sc/cannibalization`: query+page conflict check.
- `GET /api/v1/sc/sitemaps`: submitted sitemap status and index counts.
- `GET /api/v1/ga4/properties`: list GA4 properties.
- `GET /api/v1/ga4/summary`: organic active users and sessions.
- `GET /api/v1/ga4/organic-sessions`: organic sessions with date and path filters.
- `GET /api/v1/ga4/landing-pages`: landing pages with conversions.
- `GET /api/v1/ga4/top-events`: top events with conversions.
- `GET/POST /api/v1/clients`: list or create client site mappings.
- `POST /api/v1/proposals/build/start`: start async proposal build; poll returned job URL.
- `POST /api/v1/proposals/build`: synchronous proposal build; prefer async for agents.

For full request/response schemas, read `references/openapi.yaml`.

## GraphQL

RefreshAgent also exposes GraphQL:

- Endpoint: `POST https://refreshagent.com/graphql`
- Header: `X-API-Key: `
- Schema: `GET https://refreshagent.com/graphql/schema`

Prefer REST unless the user specifically asks for GraphQL or a REST endpoint cannot express the needed query.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [marketingskills](https://github.com/marketingskills)
- **Source:** [marketingskills/seo](https://github.com/marketingskills/seo)
- **License:** MIT
- **Homepage:** https://marketingskills.net

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-marketingskills-seo-live-search-console-data
- Seller: https://agentstack.voostack.com/s/marketingskills
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
