Python wrapper for eBay API

Overview

python-ebay - Python Wrapper for eBay API

This project intends to create a simple python wrapper around eBay APIs.

Development and Download Sites

The entry at the Python Package Index is at: https://pypi.python.org/pypi/python-ebay

Development is coordinated at Github: https://github.com/roopeshvaddepally/python-ebay

How to Install

New Way

  • Install the library with pip or easy_install. With pip you must use option --pre, because python-ebay is currently labeled as prerelease (beta) quality.

    pip install --pre python-ebay
    
  • Create a configuration file.
    • Generate keys at eBay's developer website: http://developer.ebay.com/quickstartguide/
    • Create an example configuration file.
    • Rename the example to something sensible.
    • Edit the example, especially insert the keys that you generated at eBay's developer site.
  • python -c "import ebay.utils; ebay.utils.write_config_example()"
    mv config.ini.example ebay.apikey
    vim ebay.apikey
    
  • Before using python-ebay, you must tell it where the configuration file is:

    from ebay.utils import set_config_file
    from ebay.shopping import FindProducts
    
    set_config_file("ebay.apikey")
    print FindProducts("pen", "false", "10", "JSON")
    

Old Way

  • Download a source package of python-ebay and unpack it. https://github.com/roopeshvaddepally/python-ebay/tarball/master

  • Create a configuration file.
  • Install the (slightly modified) package with:

    python setup.py install
    
  • The python-ebay library now contains a working configuration file. You can use it without calling utils.set_config_file:

    from ebay.shopping import FindProducts
    print FindProducts("pen", "false", "10", "JSON")
    

Documentation

The pyton-ebay library is unfortunately not complete. An overview of the development status is available on our wiki. The currently implemented functions are listed together with a short description: https://github.com/roopeshvaddepally/python-ebay/wiki/List-of-eBay-APIs

Extensive documentation of eBay's API is available on eBay's developer website. This documentation focusses on XML messages that are sent to eBay's servers, and XML responses that are received from those servers. http://developer.ebay.com/products/overview

Example code in Python can be found in the directories examples/ and tests/. The complete source code can be obtained by either:

License

Apache License, Version 2.0 Please refer to details here: http://www.apache.org/licenses/LICENSE-2.0.html

Contributors

  • Eike Welk
  • Utkarsh Sengar
  • Roopesh Vaddepally
  • Stephen Balaban
  • hbtronix
  • bogdanvarlamov
  • patoch
Comments
  • Enforce parameters passed to the operation

    Enforce parameters passed to the operation

    Enforce parameters passed to the operations. For now, I am just passing what the user passes to the API.

    Example:
    Say, an API operation requires an int between 0-100, so if user passes 101 or hello, now, it's not being checked on our side, but the user will get an error from the eBay API, so we need to fix this.

    This will result in more maintenance (if new type is added, we will need to update our code) but a more robust eBay Python SDK rather than just a wrapper.

    -Utkarsh

    feature-req 
    opened by utsengar 5
  • Error: Invalid version specified in URL parameter or HTTP header.

    Error: Invalid version specified in URL parameter or HTTP header.

    matthew@localhost:~/Documents/ebay/python-ebay$ python Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

    from ebay.shopping import FindProducts FindProducts('pen', 'false', '10', 'JSON') '{"Timestamp":"2013-09-10T02:48:14.878Z","Ack":"Failure","Errors":[{"ShortMessage":"Version invalid.","LongMessage":"Invalid version specified in URL parameter or HTTP header.","ErrorCode":"1.28","SeverityCode":"Error","ErrorClassification":"RequestError"}],"Build":"E837_CORE_APILW2_16303068_R1","Version":"837"}'

    Will have a dig around the code and see what I can find that could be causing this, but any ideas?

    bug 
    opened by matthewruttley 4
  • Cannot install from setup.py

    Cannot install from setup.py

    When running python setup.py install I get the following error at the end:

    running install_data
    error: can't copy 'ebay/config.ini': doesn't exist or not a regular file
    

    The file appears to be missing from the ebay directory. No longer needed? In any case the install will not complete.

    opened by yamatt 3
  • Next time you checkin code, PEP8 it first !

    Next time you checkin code, PEP8 it first !

    Hi Guys,

    I finally had the chance to pull the code and start looking.

    My first impression, great effort, and happy to be ("tiny") part of it.

    Second impression, "Hello....have you guys heard of PEP-8" :)

    I would strong suggest to install 'pep8' tool from : http://pypi.python.org/pypi/pep8 [http://www.python.org/dev/peps/pep-0008/ -- GOOD READING]

    and start running it every-time you feel the inevitable need to push code.

    Second good tool is pyflakes : http://pypi.python.org/pypi/pyflakes, checks for bad imports etc.

    I will not go pylint at the moment, but it is also a good tool and must have in the drawer chest of a Python developer.

    Also, there are ways to integrate these with emacs or your favorite editor(s).

    Thanks Anzar

    opened by anzarafaq 3
  • Error due to incorrect value in finding.py

    Error due to incorrect value in finding.py

    Problems:

    return get_response(findItemsAdvanced.name, request, encoding) File "/home/..../finding.py", line 388, in get_response globalId = config.get("call", "global_id") File "/usr/lib/python2.7/ConfigParser.py", line 618, in get raise NoOptionError(option, section) NoOptionError: No option 'global_id' in section: 'call'

    global_id should be siteid? I end up with HTTP 500 on changing it, but then I'm new.

    I'm using an older, working version of this git now.

    opened by chrisinpants 2
  • Functionality for alternative configuration files

    Functionality for alternative configuration files

    I have implemented functionality for using alternative configuration files. This is necessary for interactive applications, because every user needs a separate configuration file. Also library directories must be world readable on Linux computers, disclosing the secret keys to every user of the system.

    The functionality has only been tested with the finding and shopping API, because most tests are broken. However I'm convinced that it works everywhere, because the changes are very simple. I have created test and example scripts for the functionality itself:

    • tests/test_alternative_config.py
    • examples/example_alternative_config.py

    I have also modified the tests for the finding API (tests/test_finding.py). Now all test have meaningful argument values, and they pass on Ebay's production system.

    If necessary I can distribute the changes into two pull requests:

    1. Modify tests for finding API.
    2. Add functionality for alternative configuration files.
    opened by eike-welk 2
  • Implement `ebay.finding.findCompletedItems`

    Implement `ebay.finding.findCompletedItems`

    The call ebay.finding.findCompletedItems is not implemented in Python-Ebay, however this seems the only way to search for completed auctions. Therefore implement:

    ebay.finding.findCompletedItems(...)
    
    opened by eike-welk 2
  • Problem with parsing XML in unittest

    Problem with parsing XML in unittest

    I am working on test_client_alerts.py's test_Login and test_Logout functions.

    Now, when I give wrong params, i get this response and the error:

    <?xml version="1.0" encoding="UTF-8"?>
        <LoginResponse xmlns="urn:ebay:apis:eBLBaseComponents">
            <Timestamp>2011-06-12T22:14:02.803Z</Timestamp>
            <Ack>Failure</Ack>
            <Errors>
                <ShortMessage>Invalid ClientAlerts Auth Token.</ShortMessage>
                <LongMessage>The ClientAlerts Auth Token that you provided is not valid.</LongMessage>
                <ErrorCode>11.1</ErrorCode>
                <SeverityCode>Error</SeverityCode>
                <ErrorParameters ParamID="0"/>
                <ErrorClassification>RequestError</ErrorClassification>
            </Errors>
            <Build>E723_CORE_BUNDLED_13321499_R1</Build>
            <Version>723</Version>
            <SessionID xsi:nil="true"/>
            <SessionData xsi:nil="true"/>
        </LoginResponse>
    
    ======================================================================
    ERROR: test_Login (__main__.TestClientAlertsApi)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "test_client_alerts.py", line 45, in test_Login
        root = etree.fromstring(result)
      File "lxml.etree.pyx", line 2743, in lxml.etree.fromstring (src/lxml/lxml.etree.c:52665)
      File "parser.pxi", line 1573, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:79932)
      File "parser.pxi", line 1452, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:78774)
      File "parser.pxi", line 960, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:75389)
      File "parser.pxi", line 564, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:71739)
      File "parser.pxi", line 645, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:72614)
      File "parser.pxi", line 585, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:71955)
    XMLSyntaxError: Namespace prefix xsi for nil on SessionID is not defined, line 16, column 22
    

    At this line: root = etree.fromstring(result)

    Ideally, it should fail. Any suggestions?

    Any kind of response should be parsed comfortably by lxml right? Is it something dirty from eBay's response?

    bug 
    opened by utsengar 2
  • Installation with **pip** now possible.

    Installation with **pip** now possible.

    This set of modifications makes it possible to install python-ebay with pip (and also easy_install I think).

    The changes to allow the new installation method itself are rather small. Most effort went into a release script (release.py), that deletes and backups the key file, and also handles the password and user ID of PyPi. The documentation was adapted and slightly expanded. The documentation was also converted to RST markup, because PyPi needs it.

    The changes were not rigorously tested, but both installation methods worked for me with a virtualenv Python. Installation with pip also worked with my system Python. (Both on Linux.)

    I'll merge the changes, if no one objects, in a week or so.

    opened by eike-welk 1
  • X-EBAY-SOA-GLOBAL-ID missing in finding API requests

    X-EBAY-SOA-GLOBAL-ID missing in finding API requests

    The finding API seems to require the X-EBAY-SOA-GLOBAL-ID for non-US listings. Here is my new get_response method in finding.py that fixes this:

    def get_response(operation_name, data, encoding, **headers):
        config = ConfigParser()
        config.read(relative("config.ini"))
        globalId = config.get("call", "global_id")
        app_name = config.get("keys", "app_name")
        endpoint = config.get("endpoints", "finding")
    
        http_headers = {"X-EBAY-SOA-OPERATION-NAME": operation_name,
                        "X-EBAY-SOA-SECURITY-APPNAME": app_name,
                        "X-EBAY-SOA-GLOBAL-ID" : globalId,
                        "X-EBAY-SOA-RESPONSE-DATA-FORMAT": encoding}
    
        http_headers.update(headers)
    
        req = urllib2.Request(endpoint, data, http_headers)
        res = urllib2.urlopen(req)
        data = res.read()
        return data
    
    opened by nkoelling 1
  • aspectHistogram and aspectFilter

    aspectHistogram and aspectFilter

    I'm learning to check ebay prices with python using this library. I use eval to get a Python dictionary (or else I get a string). This snipped should have the aspect Histogram somewhere... (so I can restrict my search to different brands of tablets and laptops).

    from ebay.finding import *
    ebayResponse = eval(findItemsByKeywords(keyword="ipod", outputSelector=['AspectHistogram']))
    

    I have been able to get the histogram from the getHistograms function directly.

    ebayResponse = eval(getHistograms(categoryId="171485"))
    

    When I try to use the aspect filters, I get into trouble? Maybe

    ebayResponse = eval(findItemsByCategory(categoryId='171485', aspectFilter=[{"Brand":"Amazon"}]))
    

    It doesn't seem to restrict to Amazon brand tablets (e.g. includes iPads).

    opened by mango314 1
  • update for Python 3 compatibility

    update for Python 3 compatibility

    Imported from six so that the code works running python 3. More fully implemented custom headers **headers. Also cleaned up some corrupted test files.

    opened by netvigator 0
  • vcvarsall.bat error for windows 10 - Please include wheels

    vcvarsall.bat error for windows 10 - Please include wheels

    Let me first say that I normally don't post errors on this site, however I found that installing this package gave me an error on windows 10 for not having a vcvarsall.bat. After doing some googling, I found that this problem could be prevented by including wheels with the updates. Here is a link to the person who said to do this, I figured it might help to those that are still working on this package.

    opened by zicameau 0
  • Filters not working on getUserCases()

    Filters not working on getUserCases()

    no one of the arguments for such process works. When i make a search for "OPEN" cases, it just list all.. i tried to provide the structure in as many ways as possible.. lists, dicts, json... but the search always returns a full query of all cases of a user. (env. production ebay)

    code:

    caseStatusFilter= ["OPEN"] caseTypeFilter = ["EBP_INR", "RETURN", "EBP_SNAD"] paginationInput = {"entriesPerPage":"5", "pageNumber":"0"} result = getUserCases(caseStatusFilter = caseStatusFilter, caseTypeFilter = caseTypeFilter, paginationInput = paginationInput, encoding = encoding)

    This should return less then 50, but is returning the max per page (200), and possible more then 1 page available, for sure the filters are not working.

    opened by xmurias 0
  • Improve tests and documentation of the Shopping API. (V 2.0)

    Improve tests and documentation of the Shopping API. (V 2.0)

    This is the second attempt. I fixed one more typo, and also merged the differences between the repositories.

    • The tests for the Shopping API (tests/test_shopping.py) now work, and actually test something.
    • The Shopping API itself (ebay/shopping.py) has now relatively extensive docstrings.
    • One function of the Finding API (ebay/finding.py) has now documentation too, but documenting all functions is too much work for now.
    • The three test files that I worked on, tests/test_shopping.py, tests/test_finding.py, tests/test_alternative_config, now use an alternative configuration file.
    • Some polishing.

    I'll merge the changes in a week or so, if no one objects.

    opened by eike-welk 0
  • Remove Dead Code

    Remove Dead Code

    There seems to be unused code in some parts of python-ebay. Remove it to make the library more easy to understand.

    Candidates are:

    • All code in __init__.py
    • Classes utils.Specification, utils.CompatibilityPropertyFilter, utils.ApplicationPropertyFilter, utils.SortOrder.
    opened by eike-welk 0
Owner
Roopesh
Roopesh
buys ethereum based on graphics card moving average price on ebay

ebay_trades buys ethereum based on graphics card moving average price on ebay Built as a meme, this application will scrape the first 3 pages of ebay

ConnorCreate 41 Jan 5, 2023
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

Richard Kolkovich 904 Jan 2, 2023
Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

null 16 Mar 29, 2022
A Python API wrapper for the Twitter API!

PyTweet PyTweet is an api wrapper made for twitter using twitter's api version 2! Installation Windows py3 -m pip install PyTweet Linux python -m pip

TheFarGG 1 Nov 19, 2022
Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

Aaron DeVera 2 May 11, 2022
This an API wrapper library for the OpenSea API written in Python 3.

OpenSea NFT API Python 3 wrapper This an API wrapper library for the OpenSea API written in Python 3. The library provides a simplified interface to f

Attila Tóth 159 Dec 26, 2022
YARSAW is an Async Python API Wrapper for the Random Stuff API.

Yet Another Random Stuff API Wrapper - YARSAW YARSAW is an Async Python API Wrapper for the Random Stuff API. This module makes it simpler for you to

Bruce 6 Mar 27, 2022
EpikCord.py - This is an API Wrapper for Discord's API for Python

EpikCord.py - This is an API Wrapper for Discord's API for Python! We've decided not to fork discord.py and start completely from scratch for a new, better structuring system!

EpikHost 28 Oct 10, 2022
A simple Python API wrapper for Cloudflare Stream's API.

python-cloudflare-stream A basic Python API wrapper for working with Cloudflare Stream. Arbington.com started off using Cloudflare Stream. We used the

Arbington 3 Sep 8, 2022
Discord-Wrapper - Discord Websocket Wrapper in python

This does not currently work and is in development Discord Websocket Wrapper in

null 3 Oct 25, 2022
An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% api coverage most of the codebase is documented

null 7 Dec 11, 2022
An API Wrapper for Gofile API

Gofile2 from gofile2 import Gofile g_a = Gofile() print(g_a.upload(file="/home/itz-fork/photo.png")) An API Wrapper for Gofile API. About API Gofile

I'm Not A Bot #Left_TG 16 Dec 10, 2022
A simple API wrapper for the Tenor API

Gifpy A simple API wrapper for the Tenor API Installation Python 3.9 or higher is recommended python3 -m pip install gifpy Clone repository: $ git cl

Juan Ignacio Battiston 4 Dec 22, 2021
An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

Izhar Ahmad 14 Jan 3, 2022
A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key).

fulltmdb A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key). Installation Use the package manager pip t

Jacob Hale 2 Sep 26, 2021