query_search_terms
The actual customer SEARCH QUERIES behind Sponsored Products and Sponsored Brands spend — the search-term report, same pipeline as the app (Sponsored Display has no search-term report: asking for it is refused by name). Answers: what customers really type before clicking an ad, negative-keyword candidates (queries with spend and zero sales), auto-campaign discoveries worth promoting to exact match. groupBy="searchTerm" is the main drill-down; the ad product (adProduct), ad-structure grains (portfolio/campaign/adGroup/targetingType/targetingDetail/keyword) and TIME grains also work (adProduct and portfolio need the stacked-cut ads fact and are otherwise refused with a message naming ADS_FACT_ENABLED). Metric universe = the ads keys MINUS impressions/ctr (biased at this grain, rejected) and MINUS the seven brand keys (newToBrand*, videoCompleteViews, viewableImpressions, brandedSearches, topOfSearchImpressionShare — the search-term reports carry none of them) and MINUS the four profit keys (this grain carries no ASIN, so there is no product margin to price a query at — use query_advertising for those): spend, sales, sales14d, clicks, orders, units, units14d, acos, roas, cpc, cvr. NO product (ASIN/SKU) dimension or filter exists here — the search-term report carries no ASIN attribution; for per-product ads use query_advertising. Rows with search term '*' are PDP placements with no typed query. ⚠️ groupBy="searchTerm" serves CLICKED QUERIES ONLY: a query with 0 clicks over the requested period is not served, and rows, summary.count and summary.total all follow that rule (Amazon also emits 0-click / 0-spend rows carrying attribution-window sales; they used to top every ACOS-ascending sort at a fake 0.0%). It is a PERIOD rule, not a daily one — a query clicked on one day keeps the sales its other days attribute. ACOS is null, never 0, when nothing was spent. 🚫 Each searchTerm row carries attrs.negatedLevel ('campaign' | 'ad_group' | null): a keyword negative on that EXACT text already blocking the traffic THIS row is made of — a campaign the row spent in, or an ad group it spent in. A negative in a SIBLING ad group is NOT reported: the query is still costing money where you are looking. Expect it to be null almost everywhere and do not read that as "nothing is blocked" — a negative that works stops the query being served, so it leaves this report entirely; what lights up is a query negated DURING the period. For "have I ever blocked this anywhere", use list_negative_targets with q = the term. ⚠️ Never cross-sum with query_metrics' ad metrics. 🧭 AD PRODUCTS: the console serves Sponsored Products, Sponsored Brands, Sponsored Brands Video and Sponsored Display as DISJOINT blocks of rows — adProducts picks which (default ['sponsored_products'] until the fact serves the others; pass several to read them in ONE call, or groupBy='adProduct' to split the money by product). Each block is read from its own cut of the fact at its OWN attribution window: SP orders/sales/units are 7-day on a Seller Central account and 14-day on a Vendor Central account (each console's own window), SB and SBV 14-day, SD 14-day CLICK-attributed (view-attributed SD conversions are never included) — so never sum or compare sales, orders, ACOS or ROAS across products; spend is the ONE additive column across all four, sponsored_brands + sponsored_brands_video (one report, split per row) the ONE additive pair, and sales14d / units14d the like-for-like 14-day reading. Sponsored Display has no search-term and no placement report (such a call is refused by name). Entity rows carry attrs.adProduct; it is null on a VALUE row (an ASIN, a placement, a targeting type, a search term) that folds two products. 💱 CURRENCY: monetary values are served in the caller's Nova display currency when it is one of the organization's configured currencies (its primary or up to four secondary currencies), else in the organization's primary. In the response, currency is the code, currencyBasis says why (user_preference | organization | pinned) and currencyNotice, when present, MUST be relayed to the user. Quote the code; never assume a symbol from the marketplace. Pass currency to pin any configured code — e.g. to reproduce a figure the seller read on a dashboard set to another currency.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Period end, INCLUSIVE (YYYY-MM-DD): a calendar month is from=YYYY-MM-01 to=its LAST day. to=the 1st of the next month adds one extra day to every total (and one extra bucket with a time grain). | |
| from | Yes | Period start, INCLUSIVE (YYYY-MM-DD). | |
| limit | No | Rows per call of an entity grouping, 1 to 1000 (default 50). A time grain is never cut: its series comes whole, in date order, 1000 buckets at most. | |
| reason | No | One sentence, ALWAYS IN ENGLISH (regardless of the conversation language), on WHY you are making this call — the user question or your analytical goal. Recorded so the seller can see how their data is used. | |
| sortBy | No | Metric key of THIS universe to rank rows by (e.g. "spend"). Refused with a time grain: a series comes in date order. | |
| groupBy | No | searchTerm (the main drill-down), the ad product (adProduct), an ad-structure grain (portfolio/campaign/adGroup/targetingType/targetingDetail/keyword), or a time grain. Omit for a single total row. | |
| metrics | Yes | ADS metric keys minus impressions/ctr and minus the profit keys — NOT product keys from list_metrics. | |
| accounts | No | Restrict to a subset of your own seller account IDs (from list_accounts). Omit to include all your accounts. A brand/account name is accepted and resolved to its id when it matches one of your accounts unambiguously; a label that carries the id ("Brand (A1B2C3D4E5F6G)") resolves to that id. | |
| channels | No | ONE Amazon programme per call. 'SELLER' = Seller Central (3P) advertising: the seller's own Amazon Ads campaigns. 'VENDOR' = Vendor Central (1P) advertising: the campaigns of the vendor's own Amazon Ads profile. Omit = SELLER whenever the accounts of the call include a Seller Central account, else VENDOR. Pass ['VENDOR'] only when the user asks about Vendor Central / 1P advertising. Both at once is refused: 3P and 1P spend and sales are never added into one total. | |
| currency | No | Pin the reporting currency: one of the organization's configured codes — its primary or any of its secondary currencies (e.g. "USD"). Omit to follow the caller's Nova display currency, the dashboard's rule. Any other code is refused. | |
| sortField | No | What to rank on: 'value' (default), or 'variance' / 'variancePercentage' (need a comparison period). | |
| sortOrder | No | desc (default) = biggest first. | |
| adGroupIds | No | ||
| adProducts | No | Which ad products to read, as disjoint blocks: sponsored_products, sponsored_brands, sponsored_brands_video, sponsored_display. Default ['sponsored_products'] until the fact serves the others. Each has its own attribution window and history floor — see the AD PRODUCTS note. | |
| keywordIds | No | ||
| campaignIds | No | ||
| searchTerms | No | Exact customer queries to keep (identity filter). | |
| comparisonTo | No | Baseline period end (inclusive). | |
| marketplaces | No | Marketplace IDs. | |
| portfolioIds | No | Portfolio ids — needs the stacked-cut ads fact (ADS_FACT_ENABLED). | |
| metricFilters | No | Server-side threshold filters (ANDed) — e.g. spend > 20 AND sales < 1 for negative-keyword candidates. Needs an entity grouping. | |
| comparisonFrom | No | Baseline period start (inclusive) — enables variance. | |
| targetingTypes | No | e.g. keyword, auto, product, category. | |
| targetingDetails | No | ||
| excludeUnfinished | No | Exclude the current, still-incomplete period so a partial day/week/month is not read as a drop. |