Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

eBay Search API travis


eBay Search API is a Flask (About Flask) powered RESTful API wrapper to the EBay search portal.


eBay Search API has been tested and known to work on the following configurations:

  • MacOS X 10.9.5
  • Ubuntu 14.04 LTS
  • Python 2.7, 3.5, and 3.6


Flask Extensions

Production Server

Quick Start


Check that the correct version of Python is installed

python -V

Activate your virtualenv


Clone the repo

git clone

Install requirements

cd ebay-search-api
pip install -r base-requirements.txt

Run API server

manage serve

Now view the API documentation at http://localhost:5000


eBay Search API comes with a built in script manager Use it to start the server, run tests, and initialize the database.


manage <command> [command-options] [manager-options]


Start server

manage serve

Run tests

manage test

Run linters

manage lint

Manager options

-m MODE, --cfgmode=MODE
 set the configuration mode, must be one of ['Production', 'Development', 'Test'] defaults to 'Development'. See for details
-f FILE, --cfgfile=FILE
 set the configuration file (absolute path)


runserver Runs the flask development server serve Runs the flask development server check Check staged changes for lint errors lint Check style with linters test Run nose, tox, and script tests add_keys Deploy staging app deploy Deploy staging app install Install requirements shell Runs a Python shell inside Flask application context.

Command options

Type manage <command> --help to view any command's options

manage manage serve --help


usage: manage serve [-?] [-t] [-T TIMEOUT] [-l] [-o] [-p PORT] [-h HOST]

Runs the flask development server

optional arguments:

-?, --help show this help message and exit -t, --threaded Run multiple threads -T TIMEOUT, --timeout TIMEOUT

Fetch timeout
-l, --live Use live data
-o, --offline Offline mode
-p PORT, --port PORT
 The server port
-h HOST, --host HOST
 The server host


Start production server on port 1000

manage serve -p 1000 -m Production


Config Variables

The following configurations settings are available in

variable description default value
__DOMAIN__ your custom domain
CACHE_TIMEOUT amount of time (in seconds) to cache responses 60 minutes
API_RESULTS_PER_PAGE the number of results returned per page 24
API_MAX_RESULTS_PER_PAGE the maximum number of results returned per page 1024
API_URL_PREFIX string to prefix each resource in the api url '/api/v1'

Environment Variables

eBay Search API references the following environment variables:

variable description environment
EBAY_DEV_ID your eBay device ID  
EBAY_LIVE_APP_ID your eBay AppID Production
EBAY_LIVE_CERT_ID your eBay CertID Production
EBAY_LIVE_TOKEN your eBay Token Production
EBAY_SB_APP_ID your eBay AppID Sandbox
EBAY_SB_CERT_ID your eBay CertID Sandbox
EBAY_SB_TOKEN your eBay Token Sandbox

To set an environment variable, e.g. MY_ENV, do the following:

echo 'export MY_ENV=value' >> ~/.profile


For a list of available resources, example requests and responses, and code samples, view the online documentation.

Advanced Installation

Production Server


Getting gevent up and running is a bit tricky so follow these instructions carefully.

To use gevent, you first need to install libevent.


apt-get install libevent-dev

Mac OS X via homebrew

brew install libevent

Mac OS X via macports

sudo port install libevent

Mac OS X via DMG

download on Rudix


Now that libevent is handy, install the remaining requirements

pip install -r requirements.txt

Or via the following if you installed libevent from macports

sudo CFLAGS="-I /opt/local/include -L /opt/local/lib" pip install gevent
pip install -r requirements.txt


Finally, install foreman

sudo gem install foreman

Now, you can run the application locally

foreman start

You can also specify what port you'd prefer to use

foreman start -p 5555


If you haven't signed up for Heroku, go ahead and do that. You should then be able to add your SSH key to Heroku, and also heroku login from the commandline.

Install heroku and create your app

sudo gem install heroku
heroku create -s cedar app_name

Add memcachier

heroku addons:add memcachier

Push to Heroku

git push heroku master

Start the web instance and make sure the application is up and running

heroku ps:scale web=1
heroku ps

Now, we can view the application in our web browser

heroku open

And anytime you want to redeploy, it's as simple as git push heroku master. Once you are done coding, deactivate your virtualenv with deactivate.

Directory Structure

$ tree . | sed 's/+----/├──/; /.pyc/d; /.DS_Store/d'
├── Procfile
├── README.rst
├── app
│   ├──
│   ├──
│   ├──
│   ├──
│   ├──
│   ├── static
│   │   ├── favicon-16x16.png
│   │   ├── favicon-32x32.png
│   │   ├── index.html
│   │   ├── oauth2-redirect.html
│   │   ├── swagger-ui-bundle.js
│   │   ├──
│   │   ├── swagger-ui-standalone-preset.js
│   │   ├──
│   │   ├── swagger-ui.css
│   │   ├──
│   │   ├── swagger-ui.js
│   │   └──
│   ├── templates
│   │   └── index.html
│   ├── tests
│   │   ├── standard.rc
│   │   ├──
│   │   ├──
│   ├──
│   ├──
├── base-requirements.txt
├── dev-requirements.txt
├── helpers
│   ├── check-stage
│   ├── clean
│   ├── pippy
│   ├── srcdist
│   └── wheel
├── py2-requirements.txt
├── requirements.txt
├── runtime.txt
├── setup.cfg
├── test.txt
└── tox.ini


First time

  1. Fork
  2. Clone
  3. Code (if you are having problems committing because of git pre-commit hook errors, just run manage check to see what the issues are.)
  4. Use tabs not spaces
  5. Add upstream git remote add upstream
  6. Rebase git rebase upstream/master
  7. Test manage test
  8. Push git push origin master
  9. Submit a pull request


  1. Code (if you are having problems committing because of git pre-commit hook errors, just run manage check to see what the issues are.)
  2. Use tabs not spaces
  3. Update upstream git fetch upstream
  4. Rebase git rebase upstream/master
  5. Test manage test
  6. Push git push origin master
  7. Submit a pull request


$ git shortlog -sn
    95  Reuben Cummings

About Flask

Flask is a BSD-licensed microframework for Python based on Werkzeug, Jinja2 and good intentions.


eBay Search API is distributed under the MIT License.