Ecommerce Data API

Competitor Analysis in Cursor or Codex: A Reproducible Conversation Script

Sep 17, 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.

The third case deserves one more question: which listings is the competitor attached to, and were those slots earned or bought.

The Related Product Traffic Statistics endpoint returns three counts for an ASIN — relations (all related slots), freeRelations (free slots) and paidRelations (paid slots) — plus items broken down by relation type. In the documented example, freeRelations is 14 and paidRelations is 28: the product appears in paid related slots twice as often as free ones, so its related-product traffic is mostly bought.

That ratio decides whether you can copy it:

  • Mostly free slots → Amazon itself recommends it to shoppers viewing related products (for example "customers also viewed" or "customers also bought"). That is built up through sales and relevance and is hard to replicate quickly.
  • Mostly paid slots → this traffic can be bought with budget, which is a clear, repeatable action.

To see exactly which listings it is attached to, use the Related Product Traffic endpoint: pass up to 40 ASINs in asinList and name the relation types in relations (values are listed in the relation type table in the API appendix, such as vav also viewed, bab also bought and fbt frequently bought together). Each related product comes back with fields such as asin, title, bsr, units and price.

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