# AI SEO agents can run the numbers and still get them wrong

- Episode: P3E05 (Part 3: AI SEO)
- YouTube: https://www.youtube.com/watch?v=Nv6aBvw14kc
- Page: https://irongoo.com/videos/ai-seo-agents
- Duration: 13:53
- Published: 2026-11-18T15:00:00+05:00

Learn how to use Claude Code to analyse Search Console data and server logs with checks you can repeat. See why accurate sums can undercount clicks and convincing bot names can inflate your AI traffic reports.

## What this episode covers

- Connecting your own data with read-only access, keeping credentials outside chat, and fixing common API setup problems.
- Finding striking distance keywords, grouping them by page, and checking three rows against Search Console before making changes.
- Getting site totals without summing query rows, separating brand demand, and comparing equal reporting periods.
- Verifying claimed AI bots against published IP ranges and separating training crawlers, search crawlers and user-triggered fetches.
- Saving the rules in a reusable instructions file so your agent can apply them on the next run.

## Key moments

- [00:00 Intro](https://irongoo.com/videos/ai-seo-agents?t=0)
- [00:52 The workbench](https://irongoo.com/videos/ai-seo-agents?t=52)
- [02:35 Search Console through the API](https://irongoo.com/videos/ai-seo-agents?t=155)
- [04:25 Demo: striking distance](https://irongoo.com/videos/ai-seo-agents?t=265)
- [07:18 The total that was a third](https://irongoo.com/videos/ai-seo-agents?t=438)
- [08:37 Demo: who is really reading your site](https://irongoo.com/videos/ai-seo-agents?t=517)
- [11:10 Two verdicts](https://irongoo.com/videos/ai-seo-agents?t=670)
- [12:52 Your starter kit and wrap up](https://irongoo.com/videos/ai-seo-agents?t=772)

## Transcript

### Intro

We asked an agent for four weeks of a dental clinic's Search Console clicks. It added up every query row and came back with a clean, confident total. The total was about a third of the real number. Nothing crashed, nothing errored, and the agent was very sure of itself.

That is the whole episode in one example. An AI model is a fast junior with no memory of your site and no access to the truth. It's brilliant at writing a script and running it. It has no idea whether the answer makes sense. That part stays with you.

So today we build the workbench: an agent that pulls your own Search Console and log data and produces analyses you can check. Then two real analyses, both spot-checked on camera, and the starter scripts are free on the episode page.


### The workbench

Our default is Claude Code, Anthropic's agentic coding tool. It reads your files, runs commands and scripts, and connects to outside data through the Model Context Protocol, or MCP. It runs in a terminal, in your code editor, in a desktop app and in the browser. Other agentic coding tools work in a similar way, so if your team uses one, everything here still applies.

The chat window is the least important part. What matters is that the agent can call an API, read a log file and write a CSV, and that you can read every step it took. Some sources already have MCP servers. Google publishes an experimental, read-only one for Google Analytics. For Search Console, the simplest route is a short script against the official API that the agent runs for you.

MCP or a plain script? MCP is handy when a server already exists and you want the agent to poke around. A script wins when you'll run the same analysis every week: the logic is written down, you can read it, and it gives the same answer twice. For everything in this episode, the agent writes the script once and then reuses it.

What you need to start is short. Access to the Search Console property. A Google Cloud project with the Search Console API switched on. Read-only permission, which Google offers as its own scope. And a copy of your web server's access logs. That's the whole shopping list.

One rule before any data moves: never paste an access token into a chat. Keep credentials in a local secrets file outside your project folder, and let the agent call the script, not the secret. On screen, every token, property name and client domain is blurred.


### Search Console through the API

Search Console's API returns up to twenty five thousand rows per request, and Google caps exports at fifty thousand rows per day, per site, per search type. The agent happily pages through all of that. The two problems that will eat your afternoon aren't in the data at all. They're in the setup.

Trap one. If your Google Cloud app is left in testing status, Google expires your authorization seven days after consent, refresh token included. Your script works perfectly for a week, then dies with what looks like a random error. Publish the app to production and the problem goes away for good.

Trap two. A domain property and a URL prefix property are different things, and the ID must match exactly, trailing slash included. Ask for a property string that doesn't exist, and the API tells you that you don't have sufficient permission. So you go hunting for an access problem that isn't there. Copy the IDs from the API's own site list instead of typing them.

That second one is our field work, not something Google documents. We've hit it more than once across the properties we manage. The fix costs nothing: list your sites through the API first, then copy and paste.

One small API detail catches people on fresh data. By default, the API returns only finalised data, so the last few days can look strangely empty. You can ask for fresh, unfinished data with a setting called dataState. For weekly reports, leave the default and end your date range a few days back.

How you ask matters as much as what you connect. A good request names the property, the exact date range, the thresholds and the output file, and it says how totals must be calculated. Vague requests get plausible answers. Plausible is the dangerous kind, because it doesn't look wrong.


### Demo: striking distance

Now the first real analysis, on a dental clinic that treats international patients. We ask Claude Code to pull twenty eight days of query data, the nineteenth of September to the sixteenth of October 2026, find the queries sitting between positions eight and twenty with at least fifty impressions, group them by page, and write a CSV.

It comes back in seconds. Seventy seven queries are already knocking on page one, with eight thousand six hundred and four impressions between them in four weeks. That's demand the clinic is already close to. The biggest group belongs to one guide about all on four implants, with eleven queries sitting near the top.

Before anyone touches a title tag, we check three rows by hand. This is the lesson of the episode. An agent saying done is a claim. The CSV is a claim. Three rows checked against the source is the minimum before you act on it.

In the Search Console interface, same property, same dates, we filter for each query exactly. Dental crown procedure: four hundred and fifty impressions, position twelve and a half. Veneers turkey: two hundred and eighty one impressions, position about fifteen. Onlay: two hundred and fifty six impressions, position eight and a half. All three match the CSV.

Pick the three rows on purpose. One from the top of the list, one from the middle, and one sitting near a threshold, like onlay at position eight and a half, just inside our band. If the edge row matches, the filter does what you asked. If you only ever check the biggest row, you never test the logic.

Now the CSV is something you can act on. For a dental clinic, the next move on each group is a human one: does the page answer what these people searched, and does the title say so? The agent found the rows. Deciding what to change still needs someone who knows the clinic and its patients.

The agent is useful again for the next step, as long as it stays a draft. Ask it to put each page's current title next to the queries in its group, so a person can see the mismatch at a glance. The agent lays out the evidence. The person who knows the clinic decides what the title should promise.

The same pull feeds a click-through gap scan: queries in the top five that deserve more clicks. On this clinic, three queries cleared two hundred impressions in the top five, and two of them were the clinic's own name. So the first line of that brief writes itself: separate brand queries before you hunt for gaps.

Decay scans need the same human eye. A language home page moves with brand demand, not with your content, so a page that dips there isn't decaying, it's following the calendar. Tell the agent which pages are which before it calls anything a decline, and compare equal periods, never a month against a few days.


### The total that was a third

Back to the number from the start. Add up the query rows for those four weeks and you get three hundred and fifty seven clicks. Search Console's own total for the site is one thousand and nine. There's no arithmetic mistake. The sum answered a different question from the one we asked.

Google filters out what it calls anonymized queries, ones not searched by more than a few dozen people over two or three months, to protect privacy. Those clicks count in the site total but never show up as rows. On the dental clinic, the visible rows held thirty five percent of clicks. On an electronics spare-parts store we work with, same dates, they held seventeen percent.

A store selling very specific spare parts lives on a long tail of rare searches, so most of its clicks hide behind that privacy filter. Build its monthly report from summed rows and you'd undercount clicks by roughly six times. The fix is one sentence in your brief: always take totals from a request with no query dimension.

Same family of trap: the half-finished month. Compare the first few days of a month with a whole previous month and you get a collapse that never happened. Before any agent calls a trend, normalise to a daily rate and compare equal periods. Write it into the brief, because the agent won't think of it.


### Demo: who is really reading your site

The second analysis is server logs. Analytics misses most AI activity, because a bot fetching your page never runs your analytics script. On an education site we run, one week of server logs showed nine hundred and sixty four verified fetches by AI bots. ClaudeBot alone made eight hundred and fifty nine of them. None of that can show up in analytics. Your logs are the only place you see it.

So we ask Claude Code to read one week of logs from an education site we run, the twelfth to the eighteenth of October 2026. Classify every request by AI vendor and by type: training, search, or a fetch triggered by a user. Then check every claimed bot against the IP ranges the vendor publishes.

Here's what came back. ClaudeBot claimed a thousand requests, and eight hundred and fifty nine really came from Anthropic's published ranges. ChatGPT-User claimed seventy three, and only eleven were really OpenAI. Perplexity-User claimed fifty two, and not one came from Perplexity's list.

Then the spot-check, because a table like that could just as easily be our own bug. We pulled the raw lines behind the fakes. Five addresses on a public cloud had each claimed to be nine different bots in the same week: Googlebot, bingbot, ClaudeBot, GPTBot, the Perplexity bots and more. That's not AI assistants reading your site. That's one scanner in a costume shop.

Count user agents without checking IPs, and this site would look like ChatGPT users asked about it more than six times as often as they really did. That's why verification isn't optional, and why copied snippets are risky. One popular AI traffic snippet we tried counted any request from an HTTP library like curl as an AI agent. Our own uptime check turned out to be eighty four percent of its AI events.

With the fakes removed, the real picture is plain. Anthropic's training crawler was the busiest real AI visitor that week, OpenAI's search crawler came next, and verified user-triggered fetches were a handful. That handful is the number that means a person asked an assistant about one of your pages, and it's the one worth tracking week by week.

What do you do with the verified fetches? Look at which pages get them. Those are the pages people are asking assistants about right now. Make sure the fact they ask for is in the server HTML, and that the page says plainly who you are, so the answer has a reason to name you. Episodes two and four cover both checks.


### Two verdicts

Claim one. An AI SEO tool does it all: keyword research, audits, content, AI visibility, one subscription. You've seen the ads. Usually with a robot giving a thumbs up.

Most of these tools are a prompt sitting on top of the same public APIs you just watched us call, plus someone else's assumptions about what the data means. That can be convenient. But the two traps in this episode, summed query rows and unverified bots, are exactly what a black box hides. If you can't see the steps, you can't spot-check them.

Claim two. The agent knows your site. You connected it to your data, so surely by now it understands your business.

It knows exactly what you hand it in this session, and nothing else. It didn't know Google hides the tail of queries, and it didn't know that scanner was wearing fake names. Write those lessons into a project instructions file the agent reads at the start of every session. Claude Code reads one called CLAUDE.md. That's how the junior stops repeating last month's mistake.

Here's what ours looks like for this kind of work, in plain sentences. Totals come from a request with no query dimension. Bots count only when the IP is on the vendor's list. These queries are brand queries. Language home pages follow brand demand. Compare equal periods only. Five lines, and the junior stops making last month's mistakes.

Once a weekly pull works, you'll want it on a schedule. Add one thing before you walk away: an alert that emails you when the job fails. Scheduled jobs don't fail loudly. They fail quietly, every morning, until somebody happens to look. The final episode of this part triggers that alert on camera.


### Your starter kit and wrap up

Here's what's on the episode page. A Search Console pull script that pages through the API and always takes totals from the site level. A log classifier that verifies every claimed AI bot by IP. And a starter instructions file with this episode's lessons already written in, ready for your agent to read.

The episode on one screen. Give the agent real data and keep secrets out of the chat. Fix the two setup traps before they find you. Take totals from the site, verify bots by IP, and check three rows before you act on anything. The all-in-one AI SEO tool and the agent that knows your site both came out as placebo.

What will change: the tools, the MCP servers, the bot names and their IP lists. What won't: the agent writes and runs the script, and a human checks three rows against the source. The starter scripts are free at irongoo.com. Next episode, we use this same workbench to build topical maps and query clusters, and let real data cut them down.
