CompSniper Docs

Quickstart

Make your first CompSniper eBay sold-listings request with cURL, Python, or Node.js.

1. Create an API key

Create a free account, then copy the key from Dashboard > API keys. Keys begin with cs_live_. Keep the complete key on your server and out of browser code and public repositories.

2. Send a keyword

Replace cs_live_REPLACEWITHYOURKEY in one example.

cURL
curl --fail-with-body \
  -H "Authorization: Bearer cs_live_REPLACEWITHYOURKEY" \
  "https://api.compsniper.com/v1/scrape?keyword=iphone+15+pro&count=10"
Python
import os
import requests

response = requests.get(
    "https://api.compsniper.com/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['COMPSNIPER_API_KEY']}"},
    params={"keyword": "iphone 15 pro", "count": 10},
    timeout=75,
)
response.raise_for_status()
data = response.json()
print(data["totalItems"], data["summary"]["median"])
Node.js
const response = await fetch(
  "https://api.compsniper.com/v1/scrape?keyword=iphone+15+pro&count=10",
  { headers: { Authorization: `Bearer ${process.env.COMPSNIPER_API_KEY}` } },
);

if (!response.ok) throw new Error(await response.text());
const data = await response.json();
console.log(data.totalItems, data.summary.median);

3. Read the response

A successful response includes:

  • items: completed eBay listings.
  • summary: cleaned median, mean, p25, p75, min, max, shipping average, and sample size.
  • rawMedian and rawSampleCount: evidence before relevance cleanup.
  • hasNextPage: whether another page is available.
  • X-Usage-Remaining: account requests left in the current billing period.
Compact response example
{
  "keyword": "iphone 15 pro",
  "page": 1,
  "totalItems": 10,
  "hasNextPage": true,
  "summary": {
    "count": 10,
    "currency": "USD",
    "median": 749.99,
    "p25": 699.0,
    "p75": 829.5
  },
  "items": [
    {
      "itemId": "123456789",
      "title": "Apple iPhone 15 Pro 256GB",
      "soldPrice": "749.99",
      "soldCurrency": "USD",
      "endedAt": "2026-08-29"
    }
  ]
}

Next, review authentication, rate limits, and pagination before running production jobs.

On this page