Price suggestions for a marketplace app from eBay sold data
// Server-side only. Cache per normalized title for 12 hours.
const cache = new Map();
export async function suggestPrice(title, condition = "used") {
const key = `${title.toLowerCase().trim()}|${condition}`;
const hit = cache.get(key);
if (hit && hit.at > Date.now() - 12 * 3600e3) return hit.value;
const url = new URL("https://www.soldcomps.io/v1/sold");
url.search = new URLSearchParams({ q: title, condition, limit: "5" });
const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.SOLDCOMPS_KEY}` } });
if (!res.ok) return null; // never block the listing form on a lookup
const { count, stats } = await res.json();
const value = count < 5 || stats.median == null ? null : {
low: stats.p25, typical: stats.median, high: stats.p75, sales: count, currency: stats.currency,
attribution: "Sold data by SoldComps.io", // shown with a link, per the Terms
};
cache.set(key, { at: Date.now(), value });
return value;
}The job
A peer-to-peer marketplace, classifieds app or listing tool wants sellers to price realistically. Too high and the item never sells; too low and the seller feels cheated. A suggested range at listing time fixes both, but you need a source of real sale prices for anything a user might type.
eBay sold data covers almost every used product, which makes it a practical reference price for a general marketplace, as long as you show a range and the evidence behind it.
How to do it
- Look up on the server. When the seller types a title and picks a condition, call /v1/sold from your backend with that title.
- Show a range. Display p25 to p75 as "most sold for" and the median as "typical". Hide the suggestion when there are fewer than 5 clean sales.
- Cache per title. Normalize the title and cache results for 12 hours; popular items get typed again and again.
- Never block the form. If the lookup fails or is slow, let the seller continue without a suggestion.
- Credit the source. Show "Sold data by SoldComps.io" with a link near the suggestion (Terms, section 3).
What sellers would see for six everyday items (eBay US, snapshot Nov 13, 2026)
| Item | Condition | Median | Middle half | Clean sales | Left out | Auctions | Sales from |
|---|---|---|---|---|---|---|---|
| Nintendo Switch Lite | used | $109.97 | $97.00 to $119.99 | 93 | 7 | 4% | Nov 12, 2026 to Nov 14, 2026 |
| Dyson V15 Detect | used | $339.00 | $278.91 to $356.94 | 37 | 5 | 11% | Aug 30, 2026 to Nov 12, 2026 |
| KitchenAid Artisan 5qt mixer | used | $152.99 | $115.00 to $185.50 | 39 | 5 | 10% | Oct 4, 2026 to Nov 12, 2026 |
| Coach Tabby 26 Shoulder Bag | used | $200.00 | $187.00 to $255.00 | 21 | 4 | 29% | Nov 9, 2026 to Nov 18, 2026 |
| GoPro HERO12 Black | used | $110.00 | $65.00 to $194.50 | 35 | 7 | 6% | Oct 13, 2026 to Nov 11, 2026 |
| Meta Quest 3 512GB | used | $372.50 | $350.00 to $399.75 | 38 | 6 | 3% | Sep 27, 2026 to Nov 12, 2026 |
- Ranges matter more than medians for general goods: 2 of these 6 items have a middle half where p75 is more than 1.5× p25, such as the GoPro HERO12 Black at $65.00 to $194.50. A single number would be wrong for most sellers.
- Popular electronics price tightly: the Nintendo Switch Lite runs $97.00 to $119.99, so "typical $109.97" is a good default.
- Prices are item prices; shipping is returned separately per sale. Local-pickup marketplaces may want to show a lower range.
Source: the eBay Sold Comps Index, eBay US sold listings, snapshot 2026-11-13. Prices exclude shipping. “Left out” = lots, for-parts units, outliers and hidden Best Offers (methodology).
When SoldComps.io is not the right tool
- Items that rarely sell on eBay (large furniture, local services, cars): the API will return few or no sales; fall back to no suggestion.
- Exact-condition pricing: the suggestion is for the condition bucket (new, used, refurbished), not this specific item's wear.
- Non-eBay markets: we cover eBay US, UK and Germany.
Frequently asked questions
Can I show eBay sold prices in my app?
Yes, on every plan including Free, as long as you show "Sold data by SoldComps.io" with a link near the data. Internal tools only your team sees don't need it.
What if a user types a vague title?
Vague titles mix markets and give wide ranges. Ask for brand and model in the form, or hide the suggestion when count is low or p75 is far above p25.
How many calls will a marketplace need?
One per distinct title and condition per 12 hours with caching. At limit=5 a call costs 25 credits, so Starter ($5/month, 50,000 credits) covers about 2,000 lookups.
Is it fast enough for a listing form?
Cached searches return quickly; a fresh search can take several seconds. Run it in the background after the title field loses focus and never block submission on it.
Related
- JavaScript and Node.js integration
- API docs
- Attribution terms
- Median vs average sold price
- Pricing
- Free sold comps lookup
SoldComps.io sells an eBay sold comps API, so we have a commercial interest here. Corrections: hello@soldcomps.io.