eBay UK sold listings API
The eBay UK sold listings API is the same GET /ebay/v1/sold with site=EBAY_GB. Every result is a sale on ebay.co.uk, priced in pounds. One script, in Python and Node, returns the last 100 sales of one item and prices it from them.
Do these steps
Click the button to copy this prompt, then paste it into your coding agent. The link tells it which page you came from.
Read https://trawl.dev/llms.txt?from=/guides/ebay-uk-sold-listings-api and help me integrate this API into my project.- Set your API key. Get a key from the free tier. One key works on both marketplaces. terminal
export TRAWL_API_KEY=your_key - Send
site=EBAY_GBwith the search. Without it the call searches ebay.com. Nothing else in the request changes. - Run the script in your language. Python needs the requests package. Node 18 needs nothing more. The search costs 1 credit.
# uk_comps.py (pip install requests)
import os
import statistics
import requests
# The last 100 UK sales of one item, used, priced from the sales. site=EBAY_GB is the whole change.
r = requests.get(
"https://api.trawl.dev/ebay/v1/sold",
headers={"x-api-key": os.environ["TRAWL_API_KEY"]},
params={
"site": "EBAY_GB",
"query": "iphone 15 pro 256gb",
"condition": "used",
"exclude": "max,case,cracked,parts,locked",
"max_pages": 1, # up to 100 sales, 1 credit
},
timeout=30,
)
r.raise_for_status()
sold = r.json()
sales = sold["results"]
prices = sorted(s["sale_price"] for s in sales)
n = len(prices)
print(f"{sold['count']} sales on {sold['site']}, {sold['credits_charged']} credit, prices in {sold['currency']}")
print(f"median {statistics.median(prices):.2f}, low {prices[0]:.2f}, high {prices[-1]:.2f}")
print(f"middle half {prices[n // 4]:.2f} to {prices[3 * n // 4]:.2f}")
print("latest five:")
for s in sales[:5]:
print(f" {s['date_sold'][:10]} {s['currency']}{s['sale_price']:>8.2f} {s['title'][:56]}")// uk_comps.mjs (Node 18 or newer, no packages)
const params = new URLSearchParams({
site: "EBAY_GB",
query: "iphone 15 pro 256gb",
condition: "used",
exclude: "max,case,cracked,parts,locked",
max_pages: "1", // up to 100 sales, 1 credit
});
const r = await fetch(`https://api.trawl.dev/ebay/v1/sold?${params}`, {
headers: { "x-api-key": process.env.TRAWL_API_KEY },
});
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
const sold = await r.json();
const sales = sold.results;
const prices = sales.map((s) => s.sale_price).sort((a, b) => a - b);
const n = prices.length;
const median = n % 2 ? prices[(n - 1) / 2] : (prices[n / 2 - 1] + prices[n / 2]) / 2;
console.log(`${sold.count} sales on ${sold.site}, ${sold.credits_charged} credit, prices in ${sold.currency}`);
console.log(`median ${median.toFixed(2)}, low ${prices[0].toFixed(2)}, high ${prices[n - 1].toFixed(2)}`);
console.log(`middle half ${prices[Math.floor(n / 4)].toFixed(2)} to ${prices[Math.floor((3 * n) / 4)].toFixed(2)}`);
console.log("latest five:");
for (const s of sales.slice(0, 5)) {
console.log(` ${s.date_sold.slice(0, 10)} ${s.currency}${s.sale_price.toFixed(2).padStart(8)} ${s.title.slice(0, 56)}`);
}100 sales on EBAY_GB, 1 credit, prices in GBP
median 426.95, low 2.80, high 700.39
middle half 380.20 to 474.99
latest five:
2026-10-17 £ 506.49 Apple iPhone 15 Pro 256GB Blue Titanium 5G Smartphone (A
2026-10-17 £ 353.50 Apple iPhone 15 Pro 256GB Unlocked White iOS 48MP 5G Sma
2026-10-17 £ 469.20 Apple iPhone 15 Pro - 256GB - Natural Titanium (Unlocked
2026-10-17 £ 379.00 iPhone 15 Pro 256GB Natural Titanium
2026-10-17 £ 368.80 Apple iPhone 15 Pro 256GB Black Titanium USB-C A17 Pro 4100 sales on EBAY_GB, 1 credit, prices in GBP
median 426.95, low 2.80, high 700.39
middle half 380.20 to 474.99
latest five:
2026-10-17 £ 506.49 Apple iPhone 15 Pro 256GB Blue Titanium 5G Smartphone (A
2026-10-17 £ 353.50 Apple iPhone 15 Pro 256GB Unlocked White iOS 48MP 5G Sma
2026-10-17 £ 469.20 Apple iPhone 15 Pro - 256GB - Natural Titanium (Unlocked
2026-10-17 £ 379.00 iPhone 15 Pro 256GB Natural Titanium
2026-10-17 £ 368.80 Apple iPhone 15 Pro 256GB Black Titanium USB-C A17 Pro 4What changes on ebay.co.uk
Every price in the answer is in pounds: sale_price, shipping_price, and the min_price and max_price you send. Nothing is converted. date_sold is the sale date on UK time. Category ids are specific to a marketplace, so look them up with site=EBAY_GB on the eBay Category IDs API before you filter on one. The low of 2.80 in the output is a mislisted item. The median ignores it, which is why the median is the price to use.
The price a UK buyer paid
For a UK private seller, eBay adds a Buyer Protection fee to every price it shows, and the buyer pays it. sale_price is that figure: the price the buyer saw and paid, fee included. Business sellers carry no fee. The fee is 10p plus 7% of the first £20, 4% of £20 to £300 and 2% of £300 to £4,000, with VAT on top. A £290 sale shows as £302.30. To recover the seller's own figure in the £20 to £300 band, take 70p off and divide by 1.04.
More than 100 sales
A count of 100 means the page is full and older sales exist. Raise max_pages for up to 2,000 in one response, and follow next_cursor past that. Send category with no query for every sale in a UK category. The eBay Sold Listings API reference has every parameter. How the comps become a price is the subject of the eBay sold comps API guide, and how this compares to a service that reads eBay's sold search for you is Trawl vs the SoldComps API.