Get Regions Tree
AI-generatedSummary
Get the tree of regions from the Yandex Wordstat API.
Inputs
- operation — The operation to perform; set to "getRegionsTree" for this call.
- phrase (required) — The search phrase; supports operators like ".".
- numPhrases — Number of top phrases to return, default 50, max 2000.
- regions — List of region IDs to filter results; defaults to all regions.
- devices — Device types to filter results; defaults to all.
- period (required) — Aggregation period for dynamics; options are daily, weekly, monthly.
- fromDate (required) — Start date of the period in YYYY-MM-DD format.
- toDate — End date of the period in YYYY-MM-DD format; defaults to last day of month for monthly, last Sunday for weekly, yesterday for daily.
- regionType — Type of regions to show: all, cities, or regions.
Output shape
a JSON object representing the region hierarchy
The response contains region nodes with id, name, and parent relationships; no pagination is used.
Examples
Example 1: Fetch the full region tree for default settings
operation=getRegionsTree
Example 2: Get dynamics for a phrase over the last month
operation=dynamics&phrase=AI&period=monthly&fromDate=2023-01-01&toDate=2023-01-31