Building an AI Agent That Finds the Best Deals on eBay and Jawa
Short answer
How do you build an AI agent that checks eBay and Jawa listings and reports the best deals?
Give the agent a tool that fetches public search result pages and returns structured listings: title, price, shipping, condition and URL. Compute total price in code, compare it with your target price or the median of recent listings, and let the model only rank and explain the shortlist. AlterLab can supply the fetch and extraction step.
Step by step
- 1
Define the search
Write down the exact product, acceptable condition and maximum total price before building anything.
- 2
Fetch structured listings
Fetch each marketplace's public search page and extract listings into a fixed schema rather than passing raw HTML to the model.
- 3
Score deals in code
Calculate price plus shipping and compare it with the median of comparable listings. Arithmetic belongs in code, not in the model.
- 4
Let the model summarise
Pass the top candidates to the model to explain trade-offs and send you a short report.
Example
from statistics import median
def best_deals(listings: list[dict], max_total: float) -> list[dict]:
totals = [l["price"] + l.get("shipping", 0) for l in listings]
typical = median(totals)
deals = [
{**l, "total": t, "vs_median": round(t / typical, 2)}
for l, t in zip(listings, totals)
if t <= max_total
]
return sorted(deals, key=lambda d: d["total"])[:5]Frequently Asked Questions
Should the model read raw listing pages?
No. Extract listings into structured fields first. The model is better at explaining a short list than at parsing long pages, and structured input is cheaper.
Can marketplaces offer an API instead?
Some do, such as eBay's Browse API. Use an official API where it covers your fields and keep page extraction for marketplaces that do not offer one.
Read the full guide
How to build a price comparison toolTry it with AlterLab
Send a URL, get the page back as HTML, markdown or JSON. Rendering, proxy rotation and retries are handled for you.
Your first scrape.
Sixty seconds.
Up to 5,000 free requests — about 5,000 Light, 500 Protected or 250 Dynamic requests. No credit card.
Just a POST request.
No credit card required · Up to 5,000 free requests (about 5,000 Light, 500 Protected or 250 Dynamic requests) · Balance never expires