get_top_objects
Rank VK Ads campaigns, ad groups, or banners by a chosen metric such as CTR or CPC, and retrieve the top N highest or lowest values for performance analysis and optimization.
Instructions
Rank VK Ads objects by a performance metric and return the top N.
Fetches statistics via the shared client, reads the chosen metric from
each object's total.base aggregate, sorts the objects, and returns the
best (or worst) limit of them. Use this to pick the best-performing (or
worst-performing) campaigns, ad groups or banners.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_type | Yes | One of ``"ad_plans"`` (campaigns), ``"ad_groups"`` or ``"banners"``. | |
| metric | Yes | The metric to rank by, taken from ``total.base``, e.g. ``"ctr"``, ``"cpc"``, ``"cpa"``, ``"spent"``, ``"clicks"``, ``"shows"``, ``"cpm"``, ``"cr"``, ``"goals"``. | |
| date_from | No | Inclusive start date ``YYYY-MM-DD``. Pair with ``date_to``. | |
| date_to | No | Inclusive end date ``YYYY-MM-DD``. Pair with ``date_from``. | |
| limit | No | How many top objects to return (default 10). Clamped to >= 1. | |
| order | No | ``"desc"`` (default, best/highest first) or ``"asc"`` (lowest first — handy for cost metrics like ``cpc``/``cpa``). | desc |
| period | No | ``"summary"`` (default, one aggregate per object) or ``"day"``. Ranking always uses the per-object ``total.base`` aggregate. | summary |
| metrics | No | Metrics group to request (default ``"base"``). | base |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |