Skip to content
timotheus edited this page Feb 14, 2013 · 14 revisions

eBay Shopping APIs support performance-optimized, lightweight APIs for accessing public eBay data in the Web 2.0 world. The Shopping API is optimized for response size, speed and usability. Search for eBay items, products and reviews, user info, and popular items and searches. Retrieve public eBay data in a buyer-friendly view, for easy consumption by widgets, search tools, and other buyer-focused applications.

Usage

from ebaysdk import shopping
api = shopping(appid="YOUR_APPID")
api.execute('FindPopularItems', {'QueryKeywords': 'Python'})
print api.response_dict()

Usage With YAML

Place a YAML file in your home or /etc/ directory and reference that filename when constructing the object. The default YAML filename is "ebay.yaml", if you use "ebay.yaml" name it will get picked up automatically.

from ebaysdk import shopping
api = shopping(config_file='myfile.yaml')
api.execute('FindPopularItems', {'QueryKeywords': 'Python'})
print api.response_dict()

Sandbox Usage

from ebaysdk import shopping
api = shopping(domain='svcs.sandbox.ebay.com', appid="YOUR_APPID")
api.execute('FindPopularItems', {'QueryKeywords': 'Python'})
print api.response_dict()

Public Methods

finding(**kwargs)

Keyword arguments to finding() constructor

domain        -- API endpoint (default: svcs.ebay.com)
config_file   -- YAML defaults (default: ebay.yaml)
debug         -- debugging enabled (default: False)
warnings      -- warnings enabled (default: False)
uri           -- API endpoint uri (default: /services/search/FindingService/v1)
appid         -- eBay application id
siteid        -- eBay country site id (default: EBAY-US)
compatibility -- version number (default: 1.0.0)
https         -- execute of https (default: False)
proxy_host    -- proxy hostname
proxy_port    -- proxy port number
timeout       -- HTTP request timeout (default: 20)
parallel      -- ebaysdk parallel object
response_encoding -- API encoding (default: XML)
request_encoding  -- API encoding (default: XML)

execute(verb, data)

Execute the HTTP request.

api.execute('FindPopularItems', {'QueryKeywords': 'Python'})

error()

Returns a string of the HTTP call errors

if api.error():
    print "has errors: %s" % api.error()

response_dom()

Return a DOM object (xml.dom.minidom) of the HTTP response content.

response_dict()

Return a dictionary of the HTTP response content.

response_content()

Returns the string content from HTTP response call.

response_soup()

Returns a BeautifulSoup object of the response

response_code()

Returns the HTTP response code.

response_status()

Returns the HTTP response status

API Use Cases

see more

More Examples

see samples

Clone this wiki locally