Competitor Analysis in Cursor or Codex: A Reproducible Conversation Script

Sep 16, 2026

"Why is this competitor outselling me" is tiring to answer by hand, because the answer sits in three places: their product performance, the terms they get impressions on, and where those impressions come from.

The script below folds all three into one conversation. It assumes the Skill or MCP is connected — see Querying Amazon data in Claude Code without writing code.

Three endpoints

StepEndpointWhat it answers
Find rivalsProduct CompetitorsWhich listings compete with this ASIN
Reverse look-upReverse Keyword LookupWhich terms they actually get impressions on
Read structureTraffic SourcesWhether impressions come from search, related placements, or ads
Reverse Keyword Lookup APIPass an ASIN, get the search terms that listing actually earns impressions on

The script

Give it your ASIN as well as the competitors', so it can compute the difference — the one step with real action value:

Competitor analysis script

Swap the sample ASIN for your own product and its main rivals.

Analyze the competitive picture on Amazon US. My product is B08CK5Z5Q1.

Step 1: Find the listings that directly compete with my ASIN. Take the top 10 and list ASIN, title, price, rating, and review count. Before executing, tell me the endpoint and expected call count.

Step 2: From those 10, pick the 3 with the most reviews, add my own ASIN for 4 total, and reverse-look-up the traffic terms for each. Take the top 20 terms per ASIN.

Step 3: Compute the difference. List the terms where at least 2 of the 3 competitors get impressions but my ASIN does not, sorted by the competitors impression magnitude.

Step 4: For the top 5 terms in that gap list, look up their traffic source structure.

Output:
1. A competitor comparison table (price, rating, review count).
2. My gap list, with competitor impression magnitude and why I may not be getting it.
3. A short conclusion: do these gaps look more like a listing relevance problem or an advertising problem?

Constraints:
- Read-only queries.
- Mark which figures are estimates.
- If parameters such as marketplace or month are missing, ask me. Do not guess.
- Do not infer search volume from the wording of a term. Use only metrics the API returned.
Need an API key?Create API key

The gap list is the finding

The comparison table itself carries little information — you can see price and rating yourself. What you can act on is step 3: terms your competitors earn impressions on and you do not.

Then step 4's traffic structure decides what to do about each one:

  • Impressions come mostly from search placements, and the competitor's listing contains the term while yours does not → fix listing relevance first.
  • Impressions come mostly from ad placements → this is a spend gap; editing the listing will not close it.
  • Impressions come mostly from related-product traffic → the competitor is attached to other listings' related slots, which has little to do with the term itself.

Those three call for completely different actions. Read together, they collapse into "spend more on ads", which tells you nothing.

Why include your own ASIN

Query only the competitors and you get a table proving the competitors are strong. Putting your ASIN into the same batch is what makes the comparison valid: same month, same marketplace, same endpoint, same metric definition.

Limits

  • Reverse keyword lookup returns an estimated impression relationship, not platform-disclosed organic or ad placement data.
  • Term lists depend on page size. A gap computed from the top 20 differs from one computed from the top 100; keep it consistent when comparing.
  • The competitors endpoint returns an algorithmic notion of competition, which may not match your business definition of a rival. Drop the irrelevant ones yourself.
  • Every step is billable; the total depends on how many ASINs and how large your pages are.
  • For 429 and retry strategy, see errors and rate limits.

To turn a gap list into a maintained keyword set, see Building your own keyword library.

Ecommerce Data API

Competitor Analysis in Cursor or Codex: A Reproducible Conversation Script | Ecommerce Data API