Trundler Python Package

We have some very exciting news to share today: we have just released trundlerpy, a Python package for interacting with Trundler! If you’re working in Python, this makes it even easier to get data from Trundler into Python.


First, you’ll need to install trundlerpy from PyPI.

pip3 install trundlerpy

If you want to keep up to date with the latest package developments, you can also install trundlerpy directly from GitHub.

pip3 install git+


It’s a good idea to store your API key in an environment variable rather than hard-coded into a script.

import os

trundler_key = os.getenv('TRUNDLER_KEY')

Now, import the package and set your API key.

from trundlerpy import Trundler

# Set the API Key
tr = Trundler(key = trundler_key)


You can use retailer() to return a Pandas DataFrame of retailers.

# Get retailers
retailer = tr.retailer()

# View the first 10 retailers
retailer.head(10)[["retailer_id", "retailer", "retailer_url", "currency"]]
   retailer_id          retailer                      retailer_url currency
0            1  EEM Technologies      USD
1            2            Clicks         ZAR
2            3           Dischem      ZAR
3            4              Game       ZAR
4            5        Woolworths      ZAR
5            6   Fortnum & Mason      GBP
6            7        John Lewis      GBP
7            8   Marks & Spencer      GBP
8            9       Pick 'n Pay        ZAR
9           10             Makro      ZAR

You can use the currency field to focus on retailers from specific countries.

# Get South African retailers
   retailer_id     retailer                   retailer_url currency  visible
1            2       Clicks      ZAR     True
2            3      Dischem      ZAR     True
3            4         Game      ZAR     True
4            5   Woolworths      ZAR     True
8            9  Pick 'n Pay      ZAR     True


The retailer_products() method yields a DataFrame with the products for a specific retailer, where each product is assigned a name, brand, model, SKU and barcode (if available).

# View first 5 products at a specific retailer
tr.retailer_products(5)[["product_id", "product", "sku"]].head(5)
   product_id                                       product            sku
0     3522790   Memory Foam Mattress Topper - WHITE / QUEEN  6009207005980
1     3522791    Memory Foam Mattress Topper - WHITE / KING  6009207005973
2     3522792  Memory Foam Mattress Topper - WHITE / DOUBLE  6009207005966
3     3522803       Sherpa Lined Blanket 180x150cm - INDIGO  6009217044313
4     3392411                  Ken Forrester Viognier 750ml  6009175703192

Products can also be filtered by name and brand.

product = tr.retailer_products(5, product = "coffee", brand = "nespresso").head(5)

To get details on a specific product, use the product_details() method and the product ID.

# Get details on an specific product
tr.product(711497)[["product_id", "product", "sku"]]
   product_id                                       product            sku
0      711497  Instant Coffee Café Gold Italian Sachets 50g  6009204582774


Finally, you can use product_prices() to get the price history for a particular product using its product ID.

# Get the price history for a specific product
   product_id                       time  price price_promotion available
0      711497  2020-05-13T14:46:55+00:00  53.99            None      None
1      711497  2020-05-12T10:41:52+00:00  53.99            None      None
2      711497  2020-05-11T18:15:54+00:00  53.99            None      None
3      711497  2020-05-10T23:25:28+00:00  49.99            None      None
4      711497  2020-05-09T13:03:59+00:00  49.99            None      None
5      711497  2020-05-08T11:50:41+00:00  49.99            None      None
6      711497  2020-05-07T14:16:00+00:00  49.99            None      None
7      711497  2020-05-06T15:35:29+00:00  49.99            None      None
8      711497  2020-05-05T14:33:10+00:00  49.99            None      None
9      711497  2020-05-04T14:58:00+00:00  49.99            None      None
Matt Dennis
Matt Dennis
Data Scientist
Laura Calcagni
Laura Calcagni
Data Scientist
Andrew Collier
Andrew Collier
Data Scientist


For more blog posts on R check out R-Bloggers.

For more blog posts on Python check out Python-Bloggers.