Yandex Direct — PPC Audit & Management (API v5)
Authors: Nick Serebrov & Kobe 🐍
Full-cycle Yandex Direct management: account audits, campaign CRUD, keyword
management, reporting, optimization, and budget analysis.
Quick Reference
| Command |
What it does |
/direct audit |
Full account audit (all campaigns), scoring 0-100 |
/direct campaigns |
List campaigns with statuses and key metrics |
/direct create |
Create campaign (Search/YAN) with ad groups, keywords, ads |
/direct keywords |
Keyword management (list, add, update bids, pause) |
/direct report |
Performance stats (CTR, CPC, conversions, spend) |
/direct optimize |
Optimization recommendations (pause losers, adjust bids) |
/direct budget |
Budget spend analysis and forecasting |
/direct negative |
Negative keyword management (campaign & shared sets) |
API Configuration
Credentials: ~/.secrets/yandex-direct.json
{ "client_id": "...", "client_secret": "...", "oauth_token": "..." }
Endpoint: https://api.direct.yandex.com/json/v5/
Auth: Authorization: Bearer {oauth_token}
API wrapper script: scripts/yd-api.sh
Orchestration Logic
/direct audit
- Load credentials from
~/.secrets/yandex-direct.json
- Fetch all campaigns via API (
campaigns service)
- Fetch ad groups, keywords, ads, sitelinks for each campaign
- Run 50+ checks from
references/yandex-audit.md
- Score using
references/scoring-system.md
- Compare metrics against
references/benchmarks.md
- Generate report with grade (A-F), findings, and prioritized action plan
/direct campaigns
- Call
campaigns.get with fields: Id, Name, Status, State, Statistics, DailyBudget, Strategy
- Format table with status indicators
- Show key metrics if available (impressions, clicks, spend)
/direct create
- Gather: campaign name, type (SEARCH/YAN), geo, budget, strategy
- Create campaign via
campaigns.add
- Create ad groups via
adgroups.add
- Add keywords via
keywords.add
- Create ads via
ads.add (TextAd for search, TextImageAd for YAN)
- Add sitelinks and callouts
/direct keywords
- Fetch keywords via
keywords.get with campaign/adgroup filter
- Operations: add, suspend, resume, update bids, delete
- Show quality metrics where available
/direct report
- Use Reports service (
/json/v5/reports)
- Build TSV report request with selected fields
- Available presets: campaign, adgroup, keyword, search_query
- Date ranges: today, yesterday, last7, last30, custom
- Parse and format results
/direct optimize
- Run report for last 30 days
- Identify: zero-conversion keywords (spend > 2x avg CPA), low CTR ads, expensive placements
- Cross-reference with
references/benchmarks.md
- Generate recommendations sorted by impact
- Apply 3x Kill Rule: flag anything with CPA > 3x target
/direct budget
- Fetch campaign budgets and daily spend
- Calculate run rate, projected monthly spend
- Flag underspending (< 70% of budget) and overspending campaigns
- Budget sufficiency check vs strategy requirements
/direct negative
- Fetch negative keywords at campaign and ad group level
- Fetch shared negative keyword sets (
negativekeywordsharedsets)
- Analyze search query report for new negatives
- Add/remove negatives via API
Quality Gates
- Never recommend broad match keywords without auto-strategy (Yandex best practice)
- 3x Kill Rule: flag keywords/groups with CPA > 3x target for pause
- Budget sufficiency: daily budget should support ≥10 clicks at current CPC
- Moderation: always check ad moderation status before optimizing
- Learning phase: don't change strategy settings during first 7 days
- UTM: all ads must have UTM parameters for Metrika attribution
Reference Files
Load on-demand, NOT at startup:
references/yandex-audit.md — 50+ audit checks (YD01-YD55)
references/scoring-system.md — Weighted scoring (0-100, grades A-F)
references/benchmarks.md — Russian market benchmarks (CTR, CPC, CVR)
references/bidding-strategies.md — Yandex Direct bidding strategy guide
references/compliance.md — Yandex moderation rules & ad policies
references/image-specs.md — Image sizes and specs for YAN (RSY) ads
Scripts
scripts/yd-api.sh — Generic API v5 call wrapper
scripts/yd-report.sh — Reports service wrapper
scripts/yd-audit.sh — Automated audit data collection
Subagents
agents/audit-yandex.md — Audit subagent for parallel campaign analysis
1---2name: direct3description: Yandex Direct (API v5) advertising audit, management, and optimization. Full account audits, campaign management, keyword operations, reporting, budget analysis, and optimization recommendations for Russian market PPC. Triggers on: "Яндекс Директ", "Yandex Direct", "директ", "РСЯ", "YAN", "direct audit", "direct campaigns", "direct report", "direct optimize".4---56# Yandex Direct — PPC Audit & Management (API v5)78**Authors:** Nick Serebrov & Kobe 🐍910Full-cycle Yandex Direct management: account audits, campaign CRUD, keyword11management, reporting, optimization, and budget analysis.1213## Quick Reference1415| Command | What it does |16|---------|-------------|17| `/direct audit` | Full account audit (all campaigns), scoring 0-100 |18| `/direct campaigns` | List campaigns with statuses and key metrics |19| `/direct create` | Create campaign (Search/YAN) with ad groups, keywords, ads |20| `/direct keywords` | Keyword management (list, add, update bids, pause) |21| `/direct report` | Performance stats (CTR, CPC, conversions, spend) |22| `/direct optimize` | Optimization recommendations (pause losers, adjust bids) |23| `/direct budget` | Budget spend analysis and forecasting |24| `/direct negative` | Negative keyword management (campaign & shared sets) |2526## API Configuration2728Credentials: `~/.secrets/yandex-direct.json`29```json30{ "client_id": "...", "client_secret": "...", "oauth_token": "..." }31```3233Endpoint: `https://api.direct.yandex.com/json/v5/`34Auth: `Authorization: Bearer {oauth_token}`3536API wrapper script: `scripts/yd-api.sh`3738## Orchestration Logic3940### `/direct audit`411. Load credentials from `~/.secrets/yandex-direct.json`422. Fetch all campaigns via API (`campaigns` service)433. Fetch ad groups, keywords, ads, sitelinks for each campaign444. Run 50+ checks from `references/yandex-audit.md`455. Score using `references/scoring-system.md`466. Compare metrics against `references/benchmarks.md`477. Generate report with grade (A-F), findings, and prioritized action plan4849### `/direct campaigns`501. Call `campaigns.get` with fields: Id, Name, Status, State, Statistics, DailyBudget, Strategy512. Format table with status indicators523. Show key metrics if available (impressions, clicks, spend)5354### `/direct create`551. Gather: campaign name, type (SEARCH/YAN), geo, budget, strategy562. Create campaign via `campaigns.add`573. Create ad groups via `adgroups.add`584. Add keywords via `keywords.add`595. Create ads via `ads.add` (TextAd for search, TextImageAd for YAN)606. Add sitelinks and callouts6162### `/direct keywords`631. Fetch keywords via `keywords.get` with campaign/adgroup filter642. Operations: add, suspend, resume, update bids, delete653. Show quality metrics where available6667### `/direct report`681. Use Reports service (`/json/v5/reports`)692. Build TSV report request with selected fields703. Available presets: campaign, adgroup, keyword, search_query714. Date ranges: today, yesterday, last7, last30, custom725. Parse and format results7374### `/direct optimize`751. Run report for last 30 days762. Identify: zero-conversion keywords (spend > 2x avg CPA), low CTR ads, expensive placements773. Cross-reference with `references/benchmarks.md`784. Generate recommendations sorted by impact795. Apply 3x Kill Rule: flag anything with CPA > 3x target8081### `/direct budget`821. Fetch campaign budgets and daily spend832. Calculate run rate, projected monthly spend843. Flag underspending (< 70% of budget) and overspending campaigns854. Budget sufficiency check vs strategy requirements8687### `/direct negative`881. Fetch negative keywords at campaign and ad group level892. Fetch shared negative keyword sets (`negativekeywordsharedsets`)903. Analyze search query report for new negatives914. Add/remove negatives via API9293## Quality Gates9495- Never recommend broad match keywords without auto-strategy (Yandex best practice)96- 3x Kill Rule: flag keywords/groups with CPA > 3x target for pause97- Budget sufficiency: daily budget should support ≥10 clicks at current CPC98- Moderation: always check ad moderation status before optimizing99- Learning phase: don't change strategy settings during first 7 days100- UTM: all ads must have UTM parameters for Metrika attribution101102## Reference Files103104Load on-demand, NOT at startup:105106- `references/yandex-audit.md` — 50+ audit checks (YD01-YD55)107- `references/scoring-system.md` — Weighted scoring (0-100, grades A-F)108- `references/benchmarks.md` — Russian market benchmarks (CTR, CPC, CVR)109- `references/bidding-strategies.md` — Yandex Direct bidding strategy guide110- `references/compliance.md` — Yandex moderation rules & ad policies111- `references/image-specs.md` — Image sizes and specs for YAN (RSY) ads112113## Scripts114115- `scripts/yd-api.sh` — Generic API v5 call wrapper116- `scripts/yd-report.sh` — Reports service wrapper117- `scripts/yd-audit.sh` — Automated audit data collection118119## Subagents120121- `agents/audit-yandex.md` — Audit subagent for parallel campaign analysis