eBay search results show what's for sale right now: titles, prices, condition, shipping, and who's selling. If you want to scrape eBay listings for price tracking, competitor research, or product research, you need the data in a structured format rather than copying it from the page.
This tutorial shows how to scrape eBay with two SerpApi APIs:
- eBay Search API: Scrape eBay listings and prices from search results (titles, links, thumbnails, seller usernames, review counts, and more).
- eBay Product API: Get the full details of a single listing, such as its description, shipping options, and seller feedback.

Challenges of Scraping eBay Manually
Scraping eBay search results may seem simple at first, but doing it consistently at scale is difficult. Developers often face:
- CAPTCHA and bot detection.
- IP blocking and rate limits.
- Session timeouts.
- Dynamic and frequently changing HTML structure.
- Pagination and infinite scrolling.
- Data variability and missing fields.
- Legal and ethical constraints.
These issues make DIY scraping slow, fragile, and expensive to maintain over time. You often need browser automation tools like Puppeteer, must constantly search for the right CSS selectors which can break whenever eBay updates its layout, and repeatedly work around anti-bot systems just to keep your scraper alive.
Luckily, instead of tackling these problems manually, SerpApi handles it all and returns clean, ready-to-use structured JSON and Markdown.
Setting up a SerpApi account
SerpApi offers 250 free searches every month. You can register a new account and start your first search directly in our interactive playground. When you're ready for more volume, you can review the pricing page.

We can collect data from organic results, including "title", "link", "price", "thumbnail", "promotion", "seller", and more.
Once you are familiar with the available results, you can start integrating our API into your code.
How to Scrape eBay Listings and Prices from Search Results
Get your API key
First, grab your API key from your dashboard.
Store the key in an environment variable so it stays out of your code. The JavaScript, Python and Ruby examples below read it from there:
export SERPAPI_API_KEY="YOUR_SERPAPI_API_KEY"JavaScript Tutorial Integration
If you prefer to watch a video, here is the video tutorial on YouTube
First, install the official SerpApi JavaScript library: npm install serpapi. Save the code below in a file named index.js so Node.js can use import.
Declare constants from required libraries:
import { getJson } from "serpapi";
const apiKey = process.env.SERPAPI_API_KEY;getJson sends a search request to SerpApi and returns the results as JSON. The API key is read from the environment variable you set earlier.
Next, we write down what we want to search and the necessary parameters for making a request:
const searchString = "playstation";
const pagesLimit = 10;
const params = {
engine: "ebay",
_nkw: searchString,
ebay_domain: "ebay.com",
api_key: apiKey,
};_nkw is the search query and ebay_domain sets the eBay site to search, such as ebay.com, ebay.de, or ebay.co.uk. pagesLimit caps how many pages we request.
Next, we write a callback function in which we describe what data we need from the result of our request:
const getOrganicResults = ({ organic_results = [] }) => {
return organic_results.map((element) => {
const { link, title, condition = "No condition data", price, shipping, thumbnail = "No image" } = element;
return {
link,
title,
condition,
price: !price ? "No price data" : price.raw ?? `${price.from?.raw} - ${price.to?.raw}`,
shipping: shipping?.raw ?? shipping ?? "No shipping data",
thumbnail,
};
});
};This function keeps only the fields we need from each listing in organic_results and sets a default when a field is missing. Some listings have a price range instead of one price, so we join the from and to prices. Shipping can be a plain string or an object with a raw value, so we handle both.
And finally, we declare and run the function getResult that gets info from all pages between currentPage and pagesLimit and return it.
const getResults = async () => {
const organicResults = [];
for (let currentPage = 1; currentPage <= pagesLimit; currentPage++) {
const json = await getJson({ ...params, _pgn: currentPage });
organicResults.push(...getOrganicResults(json));
if (!json.serpapi_pagination?.next) break;
}
return organicResults;
};
getResults().then(console.log).catch(console.error);The loop requests one page at a time, setting the page number with _pgn, and adds each page's listings to organicResults. It stops at pagesLimit, or earlier when serpapi_pagination has no next link. If a request fails, the error is printed.
Output
[
{
"link":"https://www.ebay.com/itm/324950767168?hash=item4ba8933640:g:yQsAAOSwU8phwB9l",
"title":"Sony PlayStation PS Vita OLED (PCH-1001) Firmware FW 3.60, 128GB - Ship in 1-DAY",
"condition":"Open Box",
"price":"$179.95",
"shipping":"Free shipping",
"thumbnail":"https://i.ebayimg.com/thumbs/images/g/yQsAAOSwU8phwB9l/s-l225.jpg"
},
{
"link":"https://www.ebay.com/itm/393419045168?hash=item5b999a3930:g:NzYAAOSwBPNiBoAk",
"title":"PS4 PlayStation 4 Sony Original Slim Pro 500GB 1TB 2TB Console Used Ship first",
"condition":"Pre-Owned",
"price":"$259.80 - $484.99",
"shipping":"Free shipping",
"thumbnail":"https://i.ebayimg.com/thumbs/images/g/NzYAAOSwBPNiBoAk/s-l225.jpg"
},
...and other results
]
Python Tutorial Integration
To get started with Python, install SerpApi's Python packages:
pip install serpapiHere's a basic example of how to scrape eBay Search Results:
import os
import serpapi
client = serpapi.Client(api_key=os.environ["SERPAPI_API_KEY"])
results = client.search({
"engine": "ebay",
"_nkw": "Coffee",
"ebay_domain": "ebay.com",
})
print(results)The code above returns the scraped data in JSON format. To analyze the results more easily, we can export the JSON fields to a CSV file using the following approach:
# ... continue from previous code
import csv
organic_results = results.get("organic_results", [])
header = ["title", "link", "price_raw", "thumbnail", "seller_username", "no_of_reviews"]
with open("ebay_search_results.csv", "w", encoding="UTF8", newline="") as f:
writer = csv.writer(f)
writer.writerow(header)
for organic_result in organic_results:
price = None
price_data = organic_result.get('price')
if price_data:
price = price_data.get('raw') if price_data.get('raw') else price_data.get('to', {}).get('raw')
writer.writerow([
organic_result.get('title'),
organic_result.get('link'),
price,
organic_result.get('thumbnail'),
organic_result.get('seller', {}).get('username'),
organic_result.get('seller', {}).get('reviews')
])Note that some products have price ranges, so we'll extract the highest price.

Ruby Tutorial Integration
Next, let's see how we can implement this in Ruby.
First, you need to install the SerpApi client in your Gemfile.
gem 'serpapi'Then install the gem.
bundle installSet up the SerpApi client and run a search:
require 'serpapi'
client = SerpApi::Client.new(engine: 'ebay', api_key: ENV['SERPAPI_API_KEY'])
results = client.search(_nkw: 'coffee')
puts resultsThe client reads your API key from the environment variable you set earlier and uses the ebay engine. client.search sends the query in _nkw and returns the results as a Ruby hash with symbol keys.
To retrieve the eBay organic results for a given search query, you can use the following code:
organic_results = results[:organic_results] || []You can store eBay organic results in databases or export them to a CSV file.
require 'csv'
CSV.open("organic_results.csv", "w") do |csv|
csv << ["title", "link", "thumbnail", "price", "seller"]
organic_results.each do |organic_result|
price = organic_result.dig(:price, :raw) || organic_result.dig(:price, :to, :raw)
csv << [organic_result[:title], organic_result[:link], organic_result[:thumbnail], price, organic_result.dig(:seller, :username)]
end
endEach listing becomes one row. When a listing has a price range instead of one price, we use the highest price, as in the Python example. dig returns nil for missing fields, so listings without a price or seller still get a row.
Parameters Explanation
Required parameters
_nkw: Defines the search query, similar to typing keywords directly into eBay’s search bar. This parameter becomes optional whencategory_idis provided.
Advanced parameters
ebay_domain: Specifies which regional eBay domain to scrape from.
(defaults:ebay.com).
Let's check on our playground by changing the domain to Germany.ebay_domain=ebay.de
https://serpapi.com/playground?engine=ebay&_nkw=Coffee&ebay_domain=ebay.de

Notice from the result that the prices are in euros and the language is German.
Check the supported domains list for other domains.
_salic: Defines the country location for the search. Useful when you want results specific to a region._pgn: Defines the page number for pagination (default: 1)_ipg: Sets how many results to return per page. Available values are 25, 50 (default), 100, and 200._udlo: Defines the lowest price of items that should be included in the results._udhi: Defines the highest price of items that should be included in the results.show_only: Shows only listings that match one or more eBay filters. Combine values with commas, for exampleFS,RPA.
Sold and Complete options for show_only are deprecated. Requests that use them return an error saying the option is no longer supported.Many parameters are also supported to make your search more specific. Visit our eBay Search Engine Result API documentation for more information.

Beyond scraping eBay product listings and prices, many use cases need the full details of a single listing, such as its description, shipping options, and seller feedback.
How to Scrape eBay Product Details
This next section of the tutorial will show you how to easily scrape eBay product details without dealing with dynamic HTML changes or anti-bot systems by using the eBay Product API, so you don't need to build your own eBay product scraper.

Each eBay product page contains detailed, valuable information. Beyond basic fields like product "titles" or "thumbnails", product pages include "short description", "customers' reviews", "shipping details", "coupon codes", "seller metadata", "related products", "details of product information", and more.
Python Tutorial Integration
At this point, I assume you already have your API key.
Here's a basic example of how to scrape an eBay product by ID (e.g., 327426620756). Note that the listing IDs stop working when a listing ends, so if this one returns no data, use the ID of any active listing.
import os
import serpapi
client = serpapi.Client(api_key=os.environ["SERPAPI_API_KEY"])
results = client.search({
"engine": "ebay_product",
"product_id": "327426620756",
})
print(results)Using JSON Restrictor to focus on Key Field
Since an eBay product page returns a large amount of structured data, you can use the JSON Restrictor to extract only specific fields.
In this example, our goal is to get only the seller feedback on this listing, without fetching unnecessary fields. Here's how to return only the seller feedback section in the response:
# all previous code
results = client.search({
"engine": "ebay_product",
"product_id": "327426620756",
"json_restrictor": "seller_results.{reviews}",
})
# ...Sample JSON Output
The response below shows the seller feedback returned when using the json_restrictor :
{
"seller_results": {
"reviews": {
"groups": {
"this_product": {
"count": 30,
"list": [
{
"review_id": "2456079510019",
"sentiment": "positive",
"author": {
"username": "9***2",
"rating": 1556
},
"text": "Great seller! Came brand new and sealed as advertised. Shipping was fast via Ontrac, definitely not my preferred shipping method but I did not have any issues. Thanks",
"created_time": "Past 6 months",
"verified_purchase": true
},
.....
.....
.....
"see_all_link": "https://www.ebay.com/fdbk/mweb_profile?fdbkType=FeedbackReceivedAsSeller&item_id=126637277150&username=antonline&filter=feedback_page%3ARECEIVED_AS_SELLER&sort=RELEVANCEV2#tab1"
}
}
}
Next, we’ll parse the JSON fields and export the eBay product review data to CSV format:
# ... same as previous section
import csv
header = ["sentiment", "review_text", "author_feedback_score", "created_time"]
with open("ebay_seller_feedback.csv", "w", encoding="UTF8", newline="") as f:
writer = csv.writer(f)
writer.writerow(header)
reviews = results.get("seller_results", {}).get("reviews", {}).get("groups", {}).get("this_product", {}).get("list", [])
for review in reviews:
writer.writerow([
review.get("sentiment"),
review.get("text"),
review.get('author', {}).get('rating'),
review.get("created_time")
])
For a seller's full feedback history across all their listings, see the tutorial below:

Parameters Explanation
Required Parameter
product_id: The unique product identifier, which can be found in the product URL. For example:https://www.ebay.com/itm/{product_id}
Advanced Parameters
Apart from that, SerpApi supports other parameters as well to make your search results more specific:
ebay_domain: Defines the eBay domain to use (default:ebay.com)- See supported eBay domains.
locale: Defines the geographic location for the research.- See supported eBay locales.
lang: Defines the language of the results (default:en-US)- For example, if you set the
locale=jp, the result will be in Japanese, unless you overridelang=en-US
- For example, if you set the

You can explore all parameters available on the product page in our eBay product API documentation.
Other programming languages
SerpApi provides official libraries for multiple programming languages including PHP, Go and also no-code platforms such as n8n and direct integration in Google Sheets. Check out the full list in SerpApi Integrations for more details.
Conclusion
By combining the eBay Search API and Product API, you can scrape eBay product listings, extract eBay prices, and scrape eBay product details at scale without dealing with anti-bot challenges.
To collect buyer reviews of a catalog product, follow:

SerpApi returns clean JSON and provides official libraries for Python, JavaScript, Ruby, PHP, Go, and no-code platforms like n8n and Google Sheets.
Get started for free today and run up to 250 searches per month
If you have any questions, please feel free to contact us at contact@serpapi.com

