# eBay Sold Comps — Median & Analytics Summary (`intelscrape/ebay-sold-comps-scraper`) Actor

eBay sold comps + sold-price analytics summary: median/avg/p10/p90, compScore, buyBelow, comps-summary dataset row, optional Discord/CRM deal-alert. Demo mode included.

- **URL**: https://apify.com/intelscrape/ebay-sold-comps-scraper.md
- **Developed by:** [IntelScrape](https://apify.com/intelscrape) (community)
- **Categories:** E-commerce, AI
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 sold listing rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## eBay Sold Comps Scraper — Median, Analytics Summary & Deal Score

**eBay sold comps** and **sold price analytics** for flippers and resellers. This **sold listings scraper** pulls completed eBay sales so you can benchmark **eBay sold prices**, compute median / avg / p10 / p90, score deals with `compScore`, set a `buyBelow` threshold, and (when enabled) receive a dedicated **`comps-summary`** analytics row in the dataset. Optional Discord / CRM webhook alerts for strong comps (`deal-alert` PPE).

### Why this Actor

Competitors often dump raw sold rows. IntelScrape adds:

- **Multi-marketplace** — `ebaySite` / `marketplace` for US, UK, DE, AU, CA, FR, IT, ES (correct eBay TLD + currency)
- **`queries[]` multi-search** — run several SKUs in one run (keeps backward-compat `searchQuery`)
- **Noise filters** — `excludedPhrases[]` and `knownBrands[]` (drop “case only” / wrong-brand comps)
- **`startUrls`** — paste sold/search URLs; sold+completed filters are forced on
- **median / avg / p10 / p90** sold price bands + **`comps-summary`** dataset row
- **compScore** (0–100) vs the sold distribution + **buyBelow** threshold
- Filters: `soldWithinDays`, `sortBy`, `freeShippingOnly`, `listingType`, `seller`, `returnsAccepted`
- Optional **Discord** + **CRM webhook** for high-score deals (`compScore` ≥ 75)
- **demoMode** fixture so you can verify output without live eBay access

Need product opportunity research too? Pair with [Amazon Product Scraper](https://apify.com/intelscrape/amazon-product) or review text via [Amazon Product Review Scraper](https://apify.com/intelscrape/amazon-product-review-scraper).

### Input

| Field | Description |
| --- | --- |
| `searchQuery` | Keywords (backward-compat; optional if `queries` or `startUrls` set) |
| `queries` | Array of search keywords — one sold search per entry |
| `startUrls` | Optional eBay search URLs (forced to sold+completed) |
| `ebaySite` / `marketplace` | Marketplace: `US` `UK` `DE` `AU` `CA` `FR` `IT` `ES` (or host forms) |
| `listingType` | `all` / `auction` / `buy_it_now` |
| `seller` | Optional seller username filter |
| `returnsAccepted` | Returns-accepted sold filter |
| `categoryId` | Optional eBay category ID |
| `maxItems` | Cap on sold rows across all queries (default 50) |
| `minSoldPrice` / `maxSoldPrice` | Price filters |
| `conditions` | Optional condition allow-list |
| `excludedPhrases` | Drop titles containing these phrases |
| `knownBrands` | Brand noise control when query names a listed brand |
| `computeComps` | Attach median/avg/p10/p90/compScore/buyBelow (default true) |
| `includeCompsSummary` | Push one `type=comps-summary` analytics row (default true) |
| `soldWithinDays` | Keep sales within N days when date parses (0 = off) |
| `sortBy` | `best_match` / `newest` / `price_asc` / `price_desc` |
| `freeShippingOnly` | eBay free-shipping sold filter |
| `buyBelowPct` | Percent of median for buyBelow (default 85) |
| `discordWebhook` | Optional Discord incoming webhook |
| `webhookUrl` | Optional CRM HTTP POST of high-score rows |
| `demoMode` | Use bundled fixtures |

### Output

Each sold listing includes `title`, `price`, `soldDate`, `condition`, `shipping`, `url`, `itemId`, `ebaySite`, `marketplace`, `currency`. When comps are on: `median`, `p10`, `p90`, `compScore`, `buyBelow`. When `includeCompsSummary` is on, one extra row with `type: "comps-summary"` carries count/median/avg/p10/p90/buyBelow plus marketplace metadata.

> **Soft CTA — after comps:** The `comps-summary` row includes `softCta` links to **[Facebook Marketplace Deal Radar](https://apify.com/intelscrape/facebook-marketplace-deal-radar)**, **[Craigslist Deal Scraper](https://apify.com/intelscrape/craigslist-deal-scraper)**, **[OfferUp Deal Radar](https://apify.com/intelscrape/offerup-deal-radar)**, **[Mercari Deal Radar](https://apify.com/intelscrape/mercari-deal-radar)**, and **[Skip Trace PRO](https://apify.com/intelscrape/skip-trace-pro)** (SoftCTA-only). Continue your journey →

### Pricing (PPE)

| Event | When | Price |
| --- | --- | --- |
| `apify-actor-start` | Every run (live or demo) | $0.05 |
| `apify-default-dataset-item` | Each dataset row via `pushData` (sold listing **or** comps-summary) | $0.003 (~$3 / 1K) |
| `premium-comp-report` | When `computeComps` produces a report | $0.012 |
| `deal-alert` | Discord and/or CRM webhook notify succeeds (**live only**) | **$0.002** |

`deal-alert` bills only on successful notify in live runs — **never** in `demoMode`. One charge per high-score row even if both Discord + CRM fire. Comp report still uses `Actor.charge('premium-comp-report')`.

### Quick start

```json
{
  "queries": ["iPhone 14 Pro 128GB", "iPhone 14 Pro 256GB"],
  "ebaySite": "US",
  "excludedPhrases": ["case only", "screen only"],
  "knownBrands": ["apple", "samsung", "google"],
  "maxItems": 25,
  "computeComps": true,
  "includeCompsSummary": true,
  "demoMode": true
}
```

UK marketplace example:

```json
{
  "searchQuery": "nintendo switch oled",
  "marketplace": "ebay.co.uk",
  "maxItems": 20,
  "demoMode": false
}
```

### Author

IntelScrape — ecommerce / AI comps tooling on Apify.

# Actor input Schema

## `searchQuery` (type: `string`):

eBay search keywords for sold comps (e.g. iPhone 14 Pro 128GB). Optional if queries\[] or startUrls is provided. Kept for backward compatibility.

## `queries` (type: `array`):

Optional array of search keywords (one sold search per entry). Merged with searchQuery. Use this for multi-SKU comps in one run (xtracto queries / tagadanar search parity).

## `startUrls` (type: `array`):

Optional eBay search-result URLs to scrape. Each URL is forced into sold+completed mode (LH\_Sold=1\&LH\_Complete=1). Use for advanced browser-built filters. NOT for /itm/ product-detail pages.

## `ebaySite` (type: `string`):

eBay site for sold search (US/UK/DE/AU/CA/FR/IT/ES). Aliases: marketplace, eBaySite. Also accepts host forms like ebay.co.uk / www.ebay.de.

## `marketplace` (type: `string`):

Optional alias for ebaySite (khadinakbar-style). Accepts US/UK/... or host forms (ebay.com, ebay.co.uk, …). Overrides ebaySite when set.

## `listingType` (type: `string`):

Filter by listing format: all, auction (LH\_Auction=1), or buy\_it\_now (LH\_BIN=1).

## `seller` (type: `string`):

When set, adds LH\_SpecificSeller=1 and \_ssn=seller to the sold search URL.

## `returnsAccepted` (type: `boolean`):

When true, adds LH\_Rtn=1 to the sold search URL.

## `categoryId` (type: `string`):

Optional eBay category ID to narrow sold results.

## `maxItems` (type: `integer`):

Maximum sold listings to push to the dataset (across all queries/URLs).

## `minSoldPrice` (type: `number`):

Filter out sold items cheaper than this (0 = no min). Applied to eBay URL and client-side.

## `maxSoldPrice` (type: `number`):

Filter out sold items more expensive than this (0 = no max). Applied to eBay URL and client-side.

## `conditions` (type: `array`):

Optional condition labels to keep (e.g. New, Open box, Used, Refurbished). Empty = all.

## `excludedPhrases` (type: `array`):

Drop sold listings whose title contains any of these case-insensitive phrases (e.g. "case only", "charger only", "for parts"). midwest\_united parity.

## `knownBrands` (type: `array`):

Brand allow-list for noise control. If the search query names one of these brands, listings whose title shows a different brand from this list (and not the query brand) are dropped. Leave empty to disable. midwest\_united parity.

## `computeComps` (type: `boolean`):

Attach median, avg, p10, p90, compScore, buyBelow to each row and charge premium-comp-report.

## `includeCompsSummary` (type: `boolean`):

Push one type=comps-summary analytics row (median/avg/p10/p90/buyBelow/count) after sold listings. Still charges premium-comp-report when computeComps is on.

## `soldWithinDays` (type: `integer`):

Keep sold listings newer than this many days when soldDate parses (0 = no filter).

## `sortBy` (type: `string`):

eBay sold search sort (best effort).

## `freeShippingOnly` (type: `boolean`):

Add eBay free-shipping filter to the sold search URL.

## `itemLocation` (type: `string`):

Search-page item location filter (caffein.dev parity). default = no LH\_PrefLoc; domestic = LH\_PrefLoc=1; worldwide = LH\_PrefLoc=3.

## `aspectFilter` (type: `object`):

eBay aspect facet filters, e.g. {"Brand": "Nike"}. Keys and values are double-encoded per eBay's convention (caffein.dev parity). Applied to sold search URLs.

## `discordWebhook` (type: `string`):

Optional Discord incoming webhook for high-compScore (≥75) deal alerts. Live runs: a successful Discord post bills the deal-alert PPE event ($0.002).

## `webhookUrl` (type: `string`):

Optional HTTP POST of each high-score sold-comp JSON. Live runs: a successful POST bills deal-alert ($0.002). One alert charge per row even if both Discord + CRM fire.

## `demoMode` (type: `boolean`):

Load bundled fixture sold listings (no live scrape). Still produces dataset items. Client filters (excludedPhrases/knownBrands/price/condition) still apply.

## `buyBelowPct` (type: `number`):

buyBelow = median \* (buyBelowPct/100). Default 85 means buy under 85% of median.

## Actor input object example

```json
{
  "searchQuery": "iPhone 14 Pro 128GB",
  "ebaySite": "US",
  "listingType": "all",
  "returnsAccepted": false,
  "maxItems": 50,
  "minSoldPrice": 0,
  "maxSoldPrice": 0,
  "computeComps": true,
  "includeCompsSummary": true,
  "soldWithinDays": 0,
  "sortBy": "best_match",
  "freeShippingOnly": false,
  "itemLocation": "default",
  "aspectFilter": {},
  "demoMode": false,
  "buyBelowPct": 85
}
```

# Actor output Schema

## `soldListings` (type: `string`):

eBay sold comps rows pushed to the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQuery": "iPhone 14 Pro 128GB"
};

// Run the Actor and wait for it to finish
const run = await client.actor("intelscrape/ebay-sold-comps-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "searchQuery": "iPhone 14 Pro 128GB" }

# Run the Actor and wait for it to finish
run = client.actor("intelscrape/ebay-sold-comps-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQuery": "iPhone 14 Pro 128GB"
}' |
apify call intelscrape/ebay-sold-comps-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,intelscrape/ebay-sold-comps-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KPmVvMddu33U48Z1g/builds/HVrVXJJjdfypkf92L/openapi.json
