Tools for an AI agent, reaching Yandex analytics where there is no official API
A working agent regularly pulls data from Yandex’s analytics stack - Metrika counters, search results, Webmaster, Wordstat - for the SEO work on my own projects. Most ready-made agent tools out there are written for Google, and the little that exists for Yandex did not cover my tasks, so every request turned into clicking through dashboards by hand.
I took open-source skills (polyakov-claude-skills) as a base and reworked them for my needs: four extensions, 8,051 lines, 58 scripts. Each one caches responses and respects quotas, because an agent calling an API in a loop burns through limits far faster than a human does.
Authentication
The access token assembles itself: a signed JWT built from a service account key is exchanged for an IAM token, which is cached and refreshed before it expires. The manual “go fetch a token” step is gone entirely - otherwise the agent hits it at the worst possible moment.
A section with no API
Part of Webmaster has no public API at all. The data comes out of the page itself: an authenticated session cookie fetches the HTML, the initial-state object is extracted from it, and the rest is ordinary parsing. The surprise was in certificates: stock Python ships without root certificates, and they live in different places on macOS, Debian, RHEL and Homebrew - so the code walks through bundles, otherwise the script dies on someone else’s machine for reasons unrelated to the task.
A separate piece parses ad-platform exports: phrase segmentation, OR-query construction, finding untapped demand. Its tests run against local files and never touch the network, so a test run depends on neither quotas nor service availability.
The proof is usage
The scripts’ cache references real projects rather than demo counters: these tools were written for my own work and have been in use since. That is probably the honest measure of a tool like this - whether it is still used after the excitement of writing it wears off.