Skip to content

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

eBay Scraper API by ScrapeBadger

Get API key Docs MCP server Pricing

eBay Scraper API

Pull eBay listings, sold prices and seller data as JSON with one HTTP request. The eBay Scraper API searches active and completed (sold) listings, returns full item pages with item specifics and shipping, and reads item reviews, seller profiles, seller listings and feedback on 18 eBay marketplaces. Every endpoint below has a runnable Python, Node.js and cURL example and the real response it returned.

What does an eBay scraper do?

An eBay scraper collects public data from eBay, such as listing titles, prices, bids, sold prices, item condition, shipping and seller ratings, and turns it into structured data. Resellers use it to price items from real sold listings, brands use it to find unauthorised sellers, and analysts use it to track demand. With this API you send a keyword, item ID or seller name and get JSON back.

Contents

Quick start

  1. Create a free ScrapeBadger account. You get 1,000 free credits, no card needed.

  2. Copy your API key from the dashboard and export it:

    export SCRAPEBADGER_API_KEY="your_api_key"
  3. Make your first request: search active listings.

cURL

curl -sS --max-time 120 -G "https://scrapebadger.com/v1/ebay/search" \
  -H "X-API-Key: $SCRAPEBADGER_API_KEY" \
  --data-urlencode 'query=iphone 15 pro' \
  --data-urlencode 'domain=com'

Python (pip install requests)

import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/ebay/search",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "iphone 15 pro",
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js (18+, no dependencies)

const params = new URLSearchParams({
  query: 'iphone 15 pro',
  domain: 'com',
});

const response = await fetch(`https://scrapebadger.com/v1/ebay/search?${params}`, {
  headers: { 'X-API-Key': process.env.SCRAPEBADGER_API_KEY },
  signal: AbortSignal.timeout(120000),
});
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(JSON.stringify(await response.json(), null, 2));

Every endpoint below has the same three versions in examples/, and the real response it returned is in output-samples/.

Endpoints

Base URL: https://scrapebadger.com. Authenticate with the X-API-Key header. Credits are charged only for successful requests.

Endpoint What it returns Credits per request Docs
GET /v1/ebay/search Search listings 8 Docs
POST /v1/ebay/search/by-image Search by image 16 Docs
GET /v1/ebay/completed Completed / sold listings 8 Docs
GET /v1/ebay/items/{item_id} Get item detail 8 Docs
GET /v1/ebay/items/{item_id}/reviews Get item reviews 16 Docs
GET /v1/ebay/sellers/{username} Get seller profile 8 Docs
GET /v1/ebay/sellers/{username}/items Get seller listings 8 Docs
GET /v1/ebay/sellers/{username}/feedback Get seller feedback 16 Docs
GET /v1/ebay/categories/{category_id}/items Browse a category 8 Docs
GET /v1/ebay/categories List categories Free Docs
GET /v1/ebay/autocomplete Keyword suggestions 2 Docs
GET /v1/ebay/markets List markets Free Docs

Common parameters

Parameter Description Default
domain eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18. com
page Results page for list endpoints. 1
per_page Results per page on search, sold listings, seller listings and categories.
sort_by Sort order on search, sold listings and categories, e.g. best_match, price_asc, newly_listed. best_match

Examples by endpoint

Each example prints the JSON response. The Python versions are below; Node.js and cURL versions are linked under each one.

Search active listings

Search an eBay marketplace for active listings.

GET /v1/ebay/search · Credits: 8 · Docs

Parameter Required Type Default Description
query Yes string Search keywords
domain string com Marketplace domain (com, co.uk, de …)
category_id string eBay category ID, e.g. 139971 for Video Game Consoles
page integer 1 Results page for list endpoints.
per_page integer 60, 120 or 240
sort_by string best_match best_match|ending_soonest|newly_listed|price_low_to_high|price_high_to_low
condition string new|open_box|refurbished|used|for_parts|graded|ungraded
buying_format string auction|buy_it_now|best_offer
min_price number
max_price number
free_shipping boolean false
location string domestic|worldwide
language string english|japanese|chinese|korean
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/ebay/search",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "iphone 15 pro",
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (84 KB)

Search sold listings

Search completed/sold listings — eBay's sold-price history.

GET /v1/ebay/completed · Credits: 8 · Docs

Parameter Required Type Default Description
query string Search keywords. Optional when seller is set.
seller string Only this seller's sold listings (eBay username). Works without query.
domain string com Marketplace domain (com, co.uk, de …)
category_id string eBay category ID, e.g. 139971 for Video Game Consoles
page integer 1 Results page for list endpoints.
per_page integer 60, 120 or 240
sort_by string best_match best_match|ending_soonest|newly_listed|price_low_to_high|price_high_to_low
condition string new|open_box|refurbished|used|for_parts|graded|ungraded
min_price number
max_price number
location string domestic|worldwide
language string english|japanese|chinese|korean
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/ebay/completed",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "iphone 15 pro",
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (86 KB)

Get item details

Get a single eBay listing's full detail.

GET /v1/ebay/items/{item_id} · Credits: 8 · Docs

Parameter Required Type Default Description
item_id Yes string eBay item number (the digits in ebay.com/itm/<id>)
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

item_id = "227309266026"

response = requests.get(
    f"https://scrapebadger.com/v1/ebay/items/{item_id}",
    headers={"X-API-Key": API_KEY},
    params={
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (17 KB)

Get item reviews

Get catalog product reviews shown on an eBay listing.

GET /v1/ebay/items/{item_id}/reviews · Credits: 16 · Docs

Parameter Required Type Default Description
item_id Yes string eBay item number (the digits in ebay.com/itm/<id>)
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
page integer 1 Results page for list endpoints.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

item_id = "227309266026"

response = requests.get(
    f"https://scrapebadger.com/v1/ebay/items/{item_id}/reviews",
    headers={"X-API-Key": API_KEY},
    params={
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (9 KB)

Get a seller profile

Get an eBay seller's public profile.

GET /v1/ebay/sellers/{username} · Credits: 8 · Docs

Parameter Required Type Default Description
username Yes string eBay seller username (as shown on the item page)
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

username = "musicmagpie"

response = requests.get(
    f"https://scrapebadger.com/v1/ebay/sellers/{username}",
    headers={"X-API-Key": API_KEY},
    params={
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (1 KB)

Get a seller's listings

List the active listings of a single eBay seller.

GET /v1/ebay/sellers/{username}/items · Credits: 8 · Docs

Parameter Required Type Default Description
username Yes string eBay seller username (as shown on the item page)
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
query string
page integer 1 Results page for list endpoints.
per_page integer Results per page on search, sold listings, seller listings and categories.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

username = "musicmagpie"

response = requests.get(
    f"https://scrapebadger.com/v1/ebay/sellers/{username}/items",
    headers={"X-API-Key": API_KEY},
    params={
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (83 KB)

Get seller feedback

Get a seller's recent feedback comments.

GET /v1/ebay/sellers/{username}/feedback · Credits: 16 · Docs

Parameter Required Type Default Description
username Yes string eBay seller username (as shown on the item page)
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
page integer 1 Results page for list endpoints.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

username = "musicmagpie"

response = requests.get(
    f"https://scrapebadger.com/v1/ebay/sellers/{username}/feedback",
    headers={"X-API-Key": API_KEY},
    params={
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (34 KB)

Browse a category

List active listings within an eBay category.

GET /v1/ebay/categories/{category_id}/items · Credits: 8 · Docs

Parameter Required Type Default Description
category_id Yes string eBay category ID, e.g. 139971 for Video Game Consoles
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
page integer 1 Results page for list endpoints.
per_page integer Results per page on search, sold listings, seller listings and categories.
sort_by string best_match best_match|ending_soonest|newly_listed|price_low_to_high|price_high_to_low
min_price number
max_price number
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

category_id = "139971"

response = requests.get(
    f"https://scrapebadger.com/v1/ebay/categories/{category_id}/items",
    headers={"X-API-Key": API_KEY},
    params={
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (80 KB)

Get keyword suggestions

Return eBay keyword autocomplete suggestions.

GET /v1/ebay/autocomplete · Credits: 2 · Docs

Parameter Required Type Default Description
query Yes string Partial query prefix
domain string com eBay marketplace, e.g. com, co.uk, de, com.au, ca. GET /v1/ebay/markets lists all 18.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/ebay/autocomplete",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "iphone 15",
        "domain": "com",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (1 KB)

List categories

List eBay's top-level category ids.

GET /v1/ebay/categories · Credits: Free · Docs

import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/ebay/categories",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (2 KB)

List marketplaces

List all supported eBay marketplaces.

GET /v1/ebay/markets · Credits: Free · Docs

import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/ebay/markets",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (3 KB)

Example output

A real response from GET /v1/ebay/search, trimmed to the first items of each list. The full response is in output-samples/search.json.

{
  "query": "iphone 15 pro",
  "domain": "com",
  "category_id": null,
  "sold": false,
  "results": [
    {
      "position": 1,
      "item_id": "365824501458",
      "product_id": null,
      "title": "Apple iPhone 15 Pro 128GB Unlocked - Very Good",
      "url": "https://www.ebay.com/itm/365824501458?_skw=iphone+15+pro&epid=5062777530&hash=item552cd6e6d2:g:M9IAAOSw2LdmetK4",
      "image": "https://i.ebayimg.com/images/g/M9IAAOSw2LdmetK4/s-l225.jpg",
      "price": {
        "value": 429.95,
        "currency": "USD",
        "symbol": null,
        "raw": "$429.95"
      },
      "original_price": {
        "value": 999.0,
        "currency": "USD",
        "symbol": null,
        "raw": "$999.00"
      },
      "discount_percent": 57.0,
      "currency": "USD",
      "condition": "Very Good - Refurbished",
      "brand": null,
      "buying_format": "Buy It Now",
      "is_auction": false,
      "bids": null,
      "current_bid": null,
      "time_left": null,
      "shipping": null,
      "shipping_cost": null,
      "free_shipping": null,
      "location": "Located in United States",
      "returns": null,
      "sold_count": null,
      "sold_date": null,
      "sold_date_at": null,
      "ended_at": null,
      "watchers": null,
      "coupon": null,
      "rating": null,
      "ratings_total": null,
      "seller_name": "bidallies",
      "seller_feedback_percent": 99.4,
      "seller_feedback_score": 373267,
      "program_badge": null,
      "is_sponsored": null,
      "exact_match": true
    }
  ],
  "facets": {
    "Buying Format": [
      "All Listings"
    ],
    "Condition": [
  …

Use it with AI agents (MCP)

ScrapeBadger runs a hosted MCP server, so Claude, Cursor, ChatGPT and other agents can call the eBay endpoints as tools, with no code.

  • Claude (claude.ai or Claude Desktop): Settings → Connectors → Add custom connector → https://mcp.scrapebadger.com/mcp, then sign in. No API key needed.
  • Cursor, VS Code, Windsurf and other clients: add this server to your MCP config:
{
  "mcpServers": {
    "scrapebadger": {
      "url": "https://mcp.scrapebadger.com/mcp?apis=ebay",
      "headers": { "Authorization": "Bearer YOUR_SCRAPEBADGER_API_KEY" }
    }
  }
}

Then ask:

What did a used iPhone 15 Pro 256GB sell for on eBay US over the last few weeks? Give me the median and the price range by condition.

Setup guides for each client are in the MCP docs.

Use cases

Use case What you collect Endpoints
Resale pricing What an item actually sold for, by condition, over recent weeks Search sold listings, Search active listings
Price and stock monitoring Current price, bids, quantity and shipping for listings you watch Get item details, Search active listings
Seller research A seller's rating, feedback, and everything they list Get a seller profile, Get a seller's listings, Get seller feedback
Brand protection Listings that use your brand name, and who sells them Search active listings, Get a seller profile
Market and category analysis What sells in a category, at what price, from which countries Browse a category, List categories, Search sold listings
Keyword research What buyers type into eBay search Get keyword suggestions

Pricing

  • Each endpoint's credit cost is listed in the endpoints table.
  • Only successful requests are billed. Blocked, empty and failed results cost nothing.
  • New accounts get 1,000 free credits. After that, pay as you go or pick a monthly plan. Credits on pay-as-you-go never expire.

See ScrapeBadger pricing for the price per credit on each plan.

Errors

Errors come back as JSON with a detail field (and an error code on some).

Status Meaning What to do
400 / 422 A parameter is missing or invalid Check the parameter table for the endpoint
401 Missing, invalid or expired API key Send the key in the X-API-Key header
402 Out of credits Top up or upgrade in the dashboard
403 The key can't call this API, or the request came from an IP the key doesn't allow Check the key's scopes and IP allowlist
404 The item, page or profile doesn't exist (or is no longer public) Check the ID; not billed
429 Over your account's max concurrency Wait Retry-After (1 s) and retry; run fewer calls in parallel (concurrency)
502 / 503 / 504 The target site failed or timed out on this attempt Not billed. Retry with backoff

Long calls can run asynchronously: send Prefer: respond-async and poll the returned request_id (async requests).

FAQ

Is it legal to scrape eBay?

Collecting publicly available listing data, such as titles, prices and sold prices, is generally lawful in most jurisdictions. This API only reads pages anyone can see without signing in. How you store and use the data is your responsibility, so check the rules that apply to you (for example on personal data in feedback) and ask a lawyer if you're unsure.

Can I get eBay sold prices?

Yes. GET /v1/ebay/completed searches completed listings, the same results as eBay's "Sold items" filter, with the final price and sale date. You can search by keyword or by seller.

How much does it cost?

Each request costs a fixed number of credits, shown in the endpoints table, and only successful requests are billed. You get 1,000 free credits when you sign up, then pay as you go or pick a plan on the pricing page.

Which eBay marketplaces are supported?

18, including the US, UK, Germany, France, Italy, Spain, Canada, Australia and more. Pass the marketplace in domain; GET /v1/ebay/markets returns the full list with currency and locale.

How fast is it, and are there rate limits?

Most calls answer in a few seconds. There's no per-minute cap: you can run as many requests in parallel as your plan's max concurrency allows, and a request over it gets 429 without being billed.

Other languages

These examples use plain HTTP. Official SDKs wrap every endpoint with types and retries:

Language Repository Install
Python scrape-badger/scrapebadger-python pip install scrapebadger
Node.js / TypeScript scrape-badger/scrapebadger-node npm install scrapebadger
Go scrape-badger/scrapebadger-go
Java scrape-badger/scrapebadger-java
C# scrape-badger/scrapebadger-csharp
PHP scrape-badger/scrapebadger-php
Ruby scrape-badger/scrapebadger-ruby
Rust scrape-badger/scrapebadger-rust
Kotlin scrape-badger/scrapebadger-kotlin
Swift scrape-badger/scrapebadger-swift
Dart scrape-badger/scrapebadger-dart
C++ scrape-badger/scrapebadger-cpp

There is also a CLI (pip install scrapebadger-cli) and an n8n node.

Related scrapers

  • Amazon Scraper API: Products, search, offers, reviews, bestsellers, deals and sellers on 20 marketplaces
  • Walmart Scraper API: Search, product pages, prices, reviews, sellers, deals and stores on walmart.com
  • Etsy Scraper API: Search, listings, shops, reviews, categories and suggestions
  • Vinted Scraper API: Search by text or photo, items, sellers, brands and reference data on 27 markets
  • E-commerce Scraper API: Every marketplace we cover, with one example repo per marketplace

Learn more

Disclaimer

ScrapeBadger is an independent tool and is not affiliated with, endorsed by, or sponsored by eBay Inc. or any of its subsidiaries or affiliates. "eBay" is a trademark of eBay Inc., used here only to describe the platform this scraper works with. This repository only covers publicly available data. You are responsible for how you use the data you collect and for following the laws that apply to you.

License

MIT. The examples are free to copy into your own projects.