Global Finalist2026 Amazon Ads Partner Awards

Developer API · Prompt library · 02 of 10

Wasted search-term spend finder

A list of every search term that spent money and sold nothing in the last 30 days, ready to negate.

Key scope
WRead-and-write key
Build time
20 to 30 minutes
Stack
Python script, run on demand

For: Anyone doing search-term audits in bulk files.

Paste this into Claude, ChatGPT or Cursor

Read https://www.sellermate.ai/api-docs first. It documents the SellerMate Public API: REST over HTTPS, X-API-Key auth, and every tool with its parameters is on that page. Every tool is POST https://api.sellermate.ai/public/v1/tools/{name} with a JSON body.

Build me a script that finds wasted search-term spend for one Amazon account.

It should:
- Pull the last 30 days of search terms with get_search_term_performance, walking every page
- Keep terms with at least [10] clicks and zero orders, or ACoS above [80]%
- Write them to wasted-terms.csv with campaign, ad group, search term, clicks, spend, orders, ACoS
- Print the total spend on that list
- With an --apply flag, add the zero-order terms as negative exact keywords in their ad group using add_negative_keywords, 50 per call, and print what was added. Without the flag, change nothing.

Let me pick the account from get_user_context, or take it as --account.

Rules:
- My key is in the SELLERMATE_API_KEY environment variable. Send it as the X-API-Key header. Never hard-code it or log it.
- Call get_user_context first and use the accounts it returns. Don't invent account ids.
- Report tools are paginated (page, page_size up to 500, pagination.hasMore). Walk every page.
- On a 429, wait for the Retry-After header and retry. On a 401 or 403, stop and tell me.
- Show me the plan and the code before running anything that writes.

Stack: Python 3 with requests. Keep it to one file.

Fill in anything in [brackets] before you paste, or leave it and the assistant will ask. The first line sends it to the docs, where every tool is listed.

What you get

  • A CSV of money-losing search terms with the spend total at the bottom
  • Thresholds you can change in one place
  • An apply mode that negates the zero-order terms, 50 per call, only when you ask
  • Nothing changes on Amazon until you pass --apply

Before you paste

  • Read-only key for the audit. Switch to a read-and-write key only when you want --apply to work.
  • Writes pass your workspace guardrails; a blocked negative returns 422 and is skipped, not sent.
  • Start with a high click threshold and lower it once you trust the list.

Make it yours

Once it works, ask the assistant for one of these.

  • Negate as phrase instead of exact for broad-match campaigns.
  • Run it weekly and post the CSV to Slack using the weekly report prompt.
  • Add negative product targets for ASINs with the same pattern using add_negative_product_targets.
Book Demo