Search demand as a number
direct_wordstatFetches Yandex search volume data: phrase frequency, time trends, and regional breakdown from Wordstat API. Includes a free tree of region codes.
Instructions
Frequency of search phrases from the Wordstat API (Yandex Search API v2, Yandex Cloud — not the Direct API). Methods: 'top' — a phrase's frequency plus phrases containing it; 'dynamics' — demand over time; 'regions' — distribution across the world; 'tree' — the region code tree.
🔴 A call spends REAL MONEY from the cloud folder, not Direct API units: top and dynamics ~0.02 rubles each, regions ~0.05. 'tree' is FREE — start with it, both to take region codes from and to prove the credential works at no cost. The real bottleneck is the quota of 100 calls per sliding hour; it is seized locally BEFORE the network, and an exhausted quota is refused with the wait named.
Needs its own credential — a Yandex Cloud Api-Key and folder id: python -m shturman_direct login searchapi.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | top: frequency + containing phrases; dynamics: demand over time; regions: worldwide distribution (2.5x the price); tree: region codes, free | |
| period | No | dynamics granularity, default PERIOD_MONTHLY. Weekly and monthly boundaries must land on Monday/Sunday or the first/last day of the month — checked locally, before paying | |
| phrase | No | the mask. Required for every method except tree. Search operators (quotes, !, +, -, [], (), |) work and give the EXACT frequency in the same call | |
| devices | No | device filter, at most 3 entries | |
| regions | No | region codes as STRINGS, not numbers: ["1"], never [1]. ⚠️ The codes in the documentation are CITIES, not federal subjects — take codes from method=tree and check each by name. top and dynamics only | |
| to_date | No | YYYY-MM-DD. dynamics only | |
| from_date | No | YYYY-MM-DD. dynamics only, required there | |
| num_phrases | No | how many containing phrases 'top' returns, 1..2000 (default 50). More phrases deepen the same mask — they do not widen coverage |