Build an Amazon FBA product research agent
Product research is the most time-consuming part of selling on Amazon: filtering thousands of listings, checking competition, estimating fees, and doing the math before ordering inventory. It is also a near-perfect job for an AI agent, as long as the agent has real marketplace data instead of guesses.
This guide builds a research agent in four steps using ASIN402's pay-per-call endpoints. No subscription is involved: the whole pipeline below costs well under a dollar per run.
The workflow
- Find candidates that match your criteria with the Product Finder.
- Score each candidate as a selling opportunity.
- Calculate FBA profit for the survivors using your real unit cost.
- Report the best options with the reasoning behind them.
Setup
npm install @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const pay = wrapFetchWithPayment(fetch,
new x402Client().register("eip155:*", new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY))));
const API = "https://asin402.com";
const get = async (path) => (await pay(API + path)).json();
const post = async (path, body) => (await pay(API + path, {
method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body),
})).json();
Fund the agent's wallet with a few dollars of USDC on Base. Use a dedicated wallet.
Step 1: Find candidates
The Product Finder filters the whole Amazon catalog in one call. Prices are in cents. This query looks for mid-priced products that sell steadily, have room for a new seller, and where Amazon itself is not competing:
const finder = await post("/api/data/finder", {
current_BUY_BOX_SHIPPING_gte: 2000, // buy box at least $20
current_BUY_BOX_SHIPPING_lte: 6000, // ...and at most $60
monthlySold_gte: 300, // ~300+ units sold last month
totalOfferCount_lte: 8, // 8 sellers or fewer
buyBoxIsAmazon: false, // Amazon doesn't hold the buy box
current_COUNT_REVIEWS_lte: 400, // beatable review moat
perPage: 50,
sort: [["monthlySold", "desc"]],
});
const candidates = finder.asinList.slice(0, 10);
To focus on one category, add "rootCategory": [<id>]. Get the ID with GET /api/data/category-search?term=kitchen. The full list of filters is at /docs/finder, or see Find profitable products with the Product Finder.
Step 2: Score each candidate
/api/sell-score combines demand, competition, Amazon's presence, price stability, review moat and price fit into a 0-100 score, with plain-language risk flags:
const scored = [];
for (const asin of candidates) {
const s = await get(`/api/sell-score?asin=${asin}`);
scored.push(s);
}
const shortlist = scored.filter((s) => s.score >= 60 && !s.signals.amazon_is_seller);
A typical result:
{
"asin": "B0EXAMPLE1",
"score": 72,
"rating": "strong",
"components": { "demand": 93, "competition": 58, "price_stability": 59, "price_fit": 90, "review_moat": 10, "amazon_penalty": 0 },
"flags": []
}
Flags are worth reading even on high scores: "Large price swings in the last 180 days (price war risk)" or "Out of stock 40% of the last 90 days" change the decision.
Step 3: Calculate FBA profit
Pass your landed cost per unit (product plus inbound shipping):
for (const s of shortlist) {
const p = await get(`/api/fba-profit?asin=${s.asin}&cost=6.50&shipping=1.20`);
s.profit = p;
}
The response includes the referral fee, the FBA fulfillment fee, net profit, margin, ROI, the break-even cost, and the maximum landed cost for a 30% ROI, which is the number to bring to a supplier negotiation.
Step 4: Report
Give the shortlist to your model and ask it to explain the trade-offs, or print a table:
console.table(shortlist.map((s) => ({
asin: s.asin, score: s.score, price: s.signals.current_price,
monthly_sales: s.signals.estimated_monthly_sales, net_profit: s.profit.net_profit, roi_pct: s.profit.roi_pct,
})));
What a run costs
| Step | Calls | Cost |
|---|---|---|
| Product Finder (50 results) | 1 | from $0.005 |
| Sell score | 10 | 10 × $0.10 |
| FBA profit | ~3-5 survivors | 3-5 × $0.05 |
Failed calls (an ASIN with no data, for example) are never charged.
Tips from real use
- Score fewer, better candidates. Tighten the finder filters until 10-20 products come back; scoring is the expensive step.
- Check consistency, not just the snapshot. Add
salesRankDrops90_gte: 300to the finder to keep products that sold steadily over the last 90 days (each rank drop roughly equals a sale), not just last week. - Re-run weekly. Markets move; a product that failed last month because Amazon held the buy box can open up.
- Treat scores as a filter, not a verdict. They rank opportunities from marketplace data; supplier quality, IP risk and your own experience still decide.
Next steps
- Find profitable products with the Product Finder: more filter recipes
- Use the same tools in Claude or Cursor, no code needed