alexis-brosseau / Ebay-Scraper

Get the average price of a product on eBay or a list of products on sale.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ebay Scraper

This script has 2 main functions:

  1. Get the average price of a product based on already sold ones.
  2. Get a list of products on sale.

Requirements:

How to Use:

  1. Add EbayScraper.py to your project directory.
  2. Import it.

Average Function:

Here we search for a new Nintendo switch on eBay Canada. The first parameter is for the search query, the second one is for the country and the third one is for the condition of the item.

import EbayScraper

averagePrice = EbayScraper.Average(query='Nintendo Switch', country='ca', condition='new')
print(averagePrice)

Output:

The output will be a dictionary with the average sold price, the average shipping price and the average total price of the item searched. Here we can see that the average price for a brand new Nintendo Switch on eBay, including the shipping, is 365.87 CAD.

{'price': 326.2, 'shipping': 39.67, 'total': 365.87}

Items Function:

Like the Average Function, the first parameter is for the search query, the second one is for the country and the third one is for the condition of the item. The difference here is that this function return a list of dictionary with data about each item. Since the list returned is sorted by price + shipping, here we get the cheapest auction for an RTX 3060 in Canada.

import EbayScraper

itemList = EbayScraper.Items(query='RTX 3060', country='ca', condition='new', type='auction')
print(itemList[0])

Output:

The output will be a dictionary with all the information about the item.

{'title': 'MSI Gaming GeForce RTX 3060 12GB NEW SEALED', 'price': 339.04, 'shipping': 0, 'time-left': '3d 4h left', 'time-end': '(Sun, 12:25 p.m.)', 'bid-count': 14, 'reviews-count': 0, 'url': 'https://www.Ebay.ca/itm/...'}

About

Get the average price of a product on eBay or a list of products on sale.


Languages

Language:Python 100.0%