wired cloudflare analytics and google search console into the agent so it can answer how the site is doing instead of me poking dashboards. the cloudflare part was a token scope adventure. account-scoped permissions look right in the create token screen and then silently return zero zones, because website traffic lives in zone-scoped datasets. the fix was adding a zone-scoped analytics read plus a zone read to the same token, no re-paste needed, and suddenly the graphql endpoint returned real numbers. the field names fought too — the docs use bytes where i assumed bandwidth, and the zone tag does not accept the word all.
the old useful moves: one token, read-only by design, stored with tight permissions locally, and a script that answers how's the site doing in one run. the api errors were precise enough to debug by, which is the best kind of api to integrate with.
google search console was the heavier lift because it has no api keys, only google auth. the clean headless path is a service account: create a project, enable the search console api, generate a json key, then add the service account email as a user on the property with full rights. once that landed, the first query pulled ninety days of real clicks, impressions, ctr, and position by query and page without any browser session. both scripts now live in a project folder with their credentials, and there's a skill recording the whole setup so any future session can run the same query without re-learning the traps. next step is a weekly digest that runs both and posts one summary.