Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Python package providing full access to the Gilt API
tree: 2173b2a1b3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Use gilt-python to access the Gilt API to obtain sale and product data on live and upcoming sales.


Use pip to install:

$ pip install gilt

You can fall back to ye olde way of installing (but pip is awesomer) by downloading the latest source (ZIP) and then run:

$ python install

You may need to run the above commands with sudo.

Getting Started

First register for a developer API key and browse the API documentation.

API Credentials

Access to the Gilt API needs an API key, which you can get for free. Once you have it, it needs to be passed to the GiltRestClient constructor or passed as an environment variable:

from gilt import GiltRestClient

client = GiltRestClient(apikey)

The better, more secure way is to set GILT_API_KEY in your environment, then construct your client like:

from gilt import GiltRestClient
client = GiltRestClient()

Retrieve a list of all live sales

from datetime import datetime
from import GiltRestClient
from gilt.util import sort_by_ending_soonest

client = GiltRestClient()
sales =
sales.sort(sales, sort_by_ending_soonest)
now =
for sale in
  print "%(name)s: %(description)s" % sale.__dict__
    if now > sale.begins: 
      print "  Begins in %s and finishes in %s" % (now - sale.begins, sale.ends - now)
      print "  Began %s ago and finishes in %s" % (sale.begins - now, sale.ends - now)

Retrieve upcoming sales in the womens store

from import GiltRestClient

client = GiltRestClient()
sales = client.sales.upcoming.list('women')
for sale in
  print "%s, %s: %d products" % (, sale.description, len(sale.products))

Get details on a product in a sale

The below will print details on all products in the first active sale in the kids store.

from import GiltRestClient

client = GiltRestClient()
sale ='kids')[0]
products = client.products.details.list(sale.products)
for i, product in enumerate(products):
  print "  %3d. %s by %s" % (,, product.brand)
  for sku in product.skus
  print "     %s on sale for $%1.2f" % (sku.description, sku.sale_price)

Design Principles

  • Model classes should be pythonic.

    Users should not have to use dictionaries to access fields. Types should be what you expect, including dates.

  • Loading data should be pythonic.

    Throwing together big and small programs should use familiar constructs with minimal magic.

  • Respect and reflect the API

    Naming is kept as consistent as possible with exactly what the API provides. This includes methods, classes and fields.

  • Timezone Neutral

    Everything is in UTC. It is recommended that you work with UTC except for display formatting.

  • more...

Something went wrong with that request. Please try again.