Pagination past 240 sales
One request returns up to 240 eBay sales. For more, ask for the next page: page=2 returns sales 241 to 480,
page=3 returns 481 to 720, and so on, while hasNextPage is true. Each page is one request, and a page that fails
or comes back past the end is never counted.
curl -G "https://api.sellercomps.com/scrape" \
--data-urlencode "keyword=nintendo switch oled" \
--data-urlencode "page=2" \
-H "Authorization: Bearer YOUR_API_KEY"How it works on eBay
| Field or parameter | Meaning |
|---|---|
page | 1 (default) to 100 |
count | Sales per page, 1 to 240. Keep it the same on every page of one search |
hasNextPage | true when eBay has another page for the search |
totalResults | eBay’s estimate of the matching sales; it can be higher than what pages reach |
A page past the last one answers 404 not_found and is not counted, so a loop that stops on hasNextPage: false or on
a 404 never pays for an empty page. eBay serves at most about 10,000 results for one search; to reach further, split
the search with a price band (minPrice, maxPrice), a date range (soldAfter, soldBefore), a condition or a
category, and page each part.
A complete loop
Python
import time, requests
API = "https://api.sellercomps.com/scrape"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
def all_sales(keyword, max_pages=5, **params):
sales = []
for page in range(1, max_pages + 1):
r = requests.get(API, params={"keyword": keyword, "page": page, **params}, headers=HEADERS, timeout=90)
if r.status_code == 404: # past the last page, not counted
break
if r.status_code in (429, 502, 503, 504):
time.sleep(int(r.headers.get("Retry-After", 5)))
continue # the failed page was free; try the next one or rerun
r.raise_for_status()
data = r.json()
sales += data["results"]
if not data["hasNextPage"]:
break
return sales
rows = all_sales("nintendo switch oled", max_pages=3, itemCondition="used")
print(len(rows), "sales")Node
async function allSales(keyword, maxPages = 5, extra = {}) {
const sales = [];
for (let page = 1; page <= maxPages; page++) {
const url = new URL("https://api.sellercomps.com/scrape");
url.search = new URLSearchParams({ keyword, page: String(page), ...extra }).toString();
const res = await fetch(url, { headers: { Authorization: "Bearer YOUR_API_KEY" } });
if (res.status === 404) break; // past the last page, not counted
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
sales.push(...data.results);
if (!data.hasNextPage) break;
}
return sales;
}
console.log((await allSales("nintendo switch oled", 3)).length, "sales");cURL
for page in 1 2 3; do
curl -sG "https://api.sellercomps.com/scrape" \
--data-urlencode "keyword=nintendo switch oled" \
--data-urlencode "page=$page" \
-H "Authorization: Bearer YOUR_API_KEY" > "sales-page-$page.json"
doneEvery endpoint’s paging
| Endpoint | How to page | Page size |
|---|---|---|
/scrape (eBay sold and active) | page 1 to 100 while hasNextPage | Up to 240 |
/sold, /active (shared format) | The marketplace’s own way, below; page and hasNextPage are in every answer | The marketplace’s |
/history (3 years) | page 1 to 200; follow nextPage until it is null | 10, 20 or 50 |
/tcgplayer/sold | One answer with up to 250 sales, use soldAfter for new ones | Up to 250 |
/tcgplayer/listings | page 1 to 50 | Up to 50 |
/psa/search, /psa/sets | page while hasNextPage | Up to 20 / 100 |
/stockx/search | page 1 to 25 | 40 |
/goat/search | page 1 to 50 | Up to 100 |
/mercari | page 1 to 100 | Up to 100 |
/poshmark/sold, /poshmark/listings | page 1 to 100 | 48 |
/grailed/sold, /grailed/listings | page while page x count stays at or under 1,000 | Up to 100 |
/depop/listings | cursor = the previous nextCursor | Up to 48 |
/vinted/listings | page 1 to 10 | 96 |
/whatnot/listings | cursor = the previous nextCursor, or page | Up to 48 |
/cardhobby/sold | page, while (page - 1) x count is under 60,000 | Up to 60 |
/goldin/sold | page 1 to 100 | 50 |
/fanatics/sold | page 1 to 200 | 50 |
/pristine/sold | page 1 to 50 | 60 |
/myslabs/sold | One page; deep=true merges a few hundred sales | Up to 72 |
Costs and speed
- Every page is one request, whatever its size, so ask for the biggest page the endpoint allows.
- Pages count toward your per-minute speed like any request. A loop that sends pages one after another stays well under every plan’s speed; for many keywords at once, use batch jobs.