vibecode.wiki
RU EN
~/wiki / seo / kak-vidat-ii-polniy-dostyp-k-analitiky

How to give AI full access to Yandex Metric + Webvisor through OAuth

◷ 4 min read 2/21/2026

Next step

Open the bot or continue inside this section.

$ cd section/ $ open @mmorecil_bot

Article -> plan in AI

Paste this article URL into any AI and get an implementation plan for your project.

Read this article: https://vibecode.morecil.ru/en/seo/kak-vidat-ii-polniy-dostyp-k-analitiky/ Work in my current project context. Create an implementation plan for this stack: 1) what to change 2) which files to edit 3) risks and typical mistakes 4) how to verify everything works If there are options, provide "quick" and "production-ready".
How to use
  1. Copy this prompt and send it to your AI chat.
  2. Attach your project or open the repository folder in the AI tool.
  3. Ask for file-level changes, risks, and a quick verification checklist.

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

  1. Follow the direct link: https://oauth.yandex.ru/client/new

  2. Fill out the form:

    • Application name: VibeCode AI Analyzer (or any understandable)
    • Description: optional
    • Icon: Optionally
  3. ** Platforms:

    • In the field Redirect URI #1 automatically insert https://oauth.yandex.ru/verification_code
    • 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

  1. Press the big button ** Create an app **

Done! Copy Client ID (long string like 1a2b3c4d5e6f7g8h9i0j...)

Step 2. We get an OAuth token

  1. Make a link (replace CLIENT_ID with your own):

    code
    https://oauth.yandex.ru/authorize?response_type=token&client_id=CLIENT_ID
  2. Open this link in the same browser where the login is in Yandex.

  3. Press ** "Allow"**.

  4. After the redirect in the address bar you will see:

    code
    https://oauth.yandex.ru/verification_code#access_token=05dd3dd84a...&token_type=bearer&...
  5. 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:

code
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):

code
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.