How to give AI full access to Yandex Metric + Webvisor through OAuth
In this article, we will create an OAuth application and get a token. AI will immediately start pulling data from Metrics and Webvisor and issuing accurate SEO recommendations.
On this page
Do you want Claude, Codex or Cursor not just “guess”, but really look at your metrics: where does traffic from Yandex come from, what pages fall off, where people scroll and click on the Webvisor?
In this article, we will create an OAuth application and get a token. AI will immediately start pulling data from Metrics and Webvisor and issuing accurate SEO recommendations.
Why do we need it right now
- The metric shows real organic traffic from Yandex (search phrases, positions, conversions).
- The webvisor gives video sessions: where users get stuck, where they don’t click.
- The AI analyzes all of this in seconds and says, "Put the button, put that block away, bounce will drop 18%.".
- Works with any site: Next.js, Telegram Mini App, pure HTML.
What will we get
- Access to reports: visits, sources, bounce rate, time on page, goals.
- Access to the Webvisor: session statistics, heat maps of behavior (via API).
Step 1. Create an application in Yandex OAuth
Follow the direct link: https://oauth.yandex.ru/client/new
Fill out the form:
- Application name:
VibeCode AI Analyzer(or any understandable) - Description: optional
- Icon: Optionally
- Application name:
** Platforms:
- In the field Redirect URI #1 automatically insert
https://oauth.yandex.ru/verification_code
- In the field Redirect URI #1 automatically insert
- Access to data**:
- In the field, select only:
- webmaster:hostinfo - access to site data from the Webvisor
- metrika:read - Obtaining statistics, reading the parameters of your and trusted meters, obtaining a list of counters
(This is enough for SEO and Webvisor analysis.) If you want to control the meters, add metrika:write
- Press the big button ** Create an app **
Done! Copy Client ID (long string like 1a2b3c4d5e6f7g8h9i0j...)
Step 2. We get an OAuth token
Make a link (replace
CLIENT_IDwith your own):plaintexthttps://oauth.yandex.ru/authorize?response_type=token&client_id=CLIENT_IDOpen this link in the same browser where the login is in Yandex.
Press ** "Allow"**.
After the redirect in the address bar you will see:
plaintexthttps://oauth.yandex.ru/verification_code#access_token=05dd3dd84a...&token_type=bearer&...Copy everything after
access_token=and before the first&. This is your token (valid for 1 year).
Ready-made prompt for AI so that it itself helps to get the token:
Help get OAuth-token for Yandex Metrics.
Client ID: PASTE CLIENT ID
Make a ready-made link for Implicit Flow and explain what to copy after the redirect.
Step 3. Transfer the AI token and launch SEO analysis
Universal Prompt (copy in Claude / Gemini / Cursor):
You are a senior SEO + UX expert with access to Yandex Metric and Webvisor.
My data:
- Counter ID: [Counter number]
- ClientID: [Your ID]
- Client secret: [Your ID]
- OAuth token: PASTE YOUR TOKEN HERE
Take a look at the site over the past 30 days:
1. Top 10 traffic sources (especially Yandex organics + search phrases)
2. Pages with bounce rate > 70% and page time < 30 seconds
3. Top 5 most viewed pages
4. Problems from WebVisor (where scrolling < 30%, where clicking past buttons)
5. Specific recommendations for improvement (what to change in the interface, text, structure)
If necessary, write ready-made requests to the Metrika API (https://api-metrica.yandex.net) and explain what they will show.
The AI will make the queries and issue a report with figures and screenshots of recommendations. JSON should come back with your meter list. If 200 OK, it works.
Okay. Now your AI is a real Yandex SEO analyst.
What to read next
- Как подключить Яндекс.Метрику и Вебмастер без типовых ошибокXX
- n8n для автоматизации: что это, как работает и с чего начатьXX
- Supabase: Полный гид для новичков, или как разобраться с базами данныхXX