Global Finalist2026 Amazon Ads Partner Awards

Developer API · Prompt library · 08 of 10

Search Query Performance tracker

Month-by-month impression share and purchase share for your top search queries, so you can see rank and conversion move together.

Key scope
RRead-only key
Build time
30 minutes
Stack
Python script on a monthly cron, writing CSV

For: Brands working on organic and paid share of voice.

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 Search Query Performance tracker for one account.

Each month:
- Pull last month's SQP data with get_sqp_report (it takes integer month and year, not dates)
- For the top [50] queries by total impressions, record impression share, click share, cart-add share and purchase share for my brand
- Append a row per query per month to sqp-history.csv
- Print the 10 queries where purchase share moved most versus the previous month, up and down
- Pull the same ASINs' sessions and conversion from get_retail_product_performance and add them to the output

Resolve the account with get_user_context.

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 and the csv module.

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 growing history of share metrics per search query
  • A monthly list of the biggest gains and losses in purchase share
  • Retail conversion alongside, so you can tell a ranking change from a conversion change

Before you paste

  • Read-only key. SQP needs the Seller Central connection, available from Pro.
  • SQP is monthly data; run it on the 5th so Amazon has finished the previous month.

Make it yours

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

  • Join with get_search_term_performance to see paid spend on the same queries.
  • Chart the history in a Google Sheet using the sheet prompt.
Book Demo