How to give your AI agent live Amazon prices

2026-10-26 · 3 min read

Language models know a lot about products, but nothing about today's price. Ask an assistant whether a $24.99 blender is a good deal and it can only guess. To answer properly it needs live data: the current buy box price, what the product usually sells for, and whether today's price is unusually low or high.

This guide shows how to give an agent that data with ASIN402, an API built for agents: there is no account to create and no API key to manage. Each request is paid individually, in USDC on Base, through the x402 protocol.

How it works in one picture

  1. Your agent calls an endpoint, for example GET /api/deal-check?asin=0735211299.
  2. The server answers HTTP 402 Payment Required with the exact price in a PAYMENT-REQUIRED header.
  3. Your x402 client signs a USDC payment for that amount and retries the same request.
  4. The server returns JSON. If the request fails (bad ASIN, no data), the payment is never settled, so failed calls cost nothing.

Steps 2 and 3 are handled for you by an x402 client library, so in practice your code looks like a normal fetch.

What you need

Install the client packages:

npm install @x402/fetch @x402/evm viem

Your first paid call

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_KEY);
const client = new x402Client().register("eip155:*", new ExactEvmScheme(account));
const pay = wrapFetchWithPayment(fetch, client);

const res = await pay("https://asin402.com/api/deal-check?asin=0735211299");
const deal = await res.json();

console.log(deal.verdict, deal.current_price, deal.avg_90d, deal.reason);
// e.g. buy_now 13.79 16.43 "Price is 16% below its 90-day average."

That single call costs $0.02. The response includes the current price, the 30, 90 and 180-day averages, the typical price range over 180 days with outlier offers filtered out, and a verdict:

Verdict Meaning
buy_now Clearly below the usual price, or at the low end of its range
fair_price Within the normal range
wait Noticeably above its 90-day average; it usually comes back down
verify_offer Far below the normal range: could be a glitch or an unreliable seller

Turning it into an agent tool

Most agent frameworks let you register tools as functions with a description. Wrap the call so the model can use it whenever a user asks about a product:

const tools = [{
  name: "check_amazon_deal",
  description: "Check whether an Amazon product's current price is a good deal. Input: a 10-character ASIN.",
  parameters: { type: "object", properties: { asin: { type: "string" } }, required: ["asin"] },
  run: async ({ asin }) => (await pay(`https://asin402.com/api/deal-check?asin=${asin}`)).json(),
}];

If you only have a product name, search first and pick the right ASIN:

const found = await (await pay("https://asin402.com/api/data/search?term=insulated+water+bottle&history=0")).json();
const asin = found.products[0].asin;

Other useful endpoints

Question your agent gets Endpoint Price
"What does this cost right now, and how well does it sell?" /api/product?asin= $0.005
"Is this a good deal?" /api/deal-check?asin= $0.02
"Show me the full price history" /api/data/product?asin=&series=BUY_BOX_SHIPPING from $0.005
"Compare these 20 products" /api/data/product?asin=A,B,C,...&history=0 (up to 100 per call) from $0.005

All endpoints accept domain for other marketplaces: uk, de, fr, jp, ca, it, es, in, mx and br (default us). Responses use plain JSON with prices in currency units and ISO dates, so the model can read them directly.

Keeping spending under control

The x402 client refuses any single payment above $1 by default, which is far above the price of a normal lookup. Two more habits keep costs predictable:

Next steps

Try it

No account or API key: call any endpoint and pay per request in USDC. Start with the API reference or add the MCP server to your assistant.

More guides

Check Amazon prices and deals from Claude or CursorAdd live Amazon data to Claude Desktop, Cursor or any MCP client with one config block. Ask about deals, FBA profit and product research in plain language. Build an Amazon FBA product research agentA step-by-step workflow for an AI agent that finds Amazon products worth selling, scores them and calculates FBA profit, with working code and real costs. Find profitable Amazon products with the Product FinderReady-to-use Product Finder filters for spotting Amazon products with steady demand, low competition and healthy margins, plus how to read the results.