Skip to content
Lawrence Wu edited this page Apr 19, 2015 · 3 revisions

The eBay Listing Archiver is a Python script that uses python-ebay and the eBay API to archive an eBay listing. The eBay listing can be viewed as a typical HTML page, and all XML output from the eBay API about the listing is also archived.

There have been tons of hilarious or unusual eBay listings that would suck if they disappeared, so we'd like to be able to slurp them down for future generations to access.

Obtaining Item Metadata

  • GetItem - Obtain all information about the item. This is a very extensive XML output, with basically everything you'd ever want to know. Awesome.
    • URL Structure/REST:
  • GetDescriptionTemplates - Those crazy eBay description HTML templates need to be saved too.

Downloading all Images and Assets

From GetItem, grab all image URLs and any other links in the description.

Also make a list of any YouTube videos, so they can be obtained with youtube-dl.

Page Templating

Now we need to reconstruct the eBay page in a templating system.

  • GetItem - All possible info about an item.
    • Item.Title - The name of the item.
    • Item.Description - Basic HTML description of the item.

Installation

  1. Install python-ebay using pip.

     pip install --pre python-ebay
    
  2. You will need to get an eBay Developer's account to access their API. Then, generate production API keys.

#Your secret Ebay access keys.
#Generate the keys on: developer.ebay.com
dev_name = ENTER_HERE
app_name = ENTER_HERE
cert_name = ENTER_HERE
  1. Generate a configuration file using python-ebay.

     python -c "import ebay.utils; ebay.utils.write_config_example()"
     mv config.ini.example ebay.apikey
     nano ebay.apikey
    
  2. Enter your API keys in the configuration file ebay.apikey.

  3. Now run the ebay-archiver.py script.