Trundler provides access to product and historical price data from a range of online retailers.

The homepage for the {trundler} R package is at https://datawookie.github.io/trundler/.

Installation

Install from GitHub.

remotes::install_github("datawookie/trundler")

If you want to be closer to the bleeding edge then you can also install from the development branch.

remotes::install_github("datawookie/trundler", ref = "dev")

Usage

Check version.

packageVersion("trundler")

Set API Key

To access the full API you’ll need to first specify an API key.

# Example API key (this key will not work).
set_api_key("8f9f3c4e-5dd6-4bff-3a2c-592b45cf2437")

To obtain a key, please get in touch. Contact details are in DESCRIPTION.

You can also subscribe via RapidAPI.

# Example RapidAPI key (this key will not work).
set_api_key("5a1ae0ce24mshd483dae6ab7308dp129ef6jsn1f473053d6b0")

Products

Get a list of products for a specific retailer.

Products can be filtered by name and brand.

retailer_products(5, product = "coffee", brand = "nespresso")

A similar search can be applied across all retailers.

products(product = "hand sanitiser")
products(product = "coffee", brand = "nespresso|nescafe")
products(product = "tv", brand = "samsung|hisense")

Information on a specific product.

item <- product(530290)

What fields are available?

names(item)
[1] "product_id"  "retailer_id" "product_url" "product"     "brand"      
[6] "model"       "sku"         "barcodes"   

Get product name, SKU and barcodes.

item$product
item$sku
item$barcodes

Options

You can control the volume of console output with options:

RMarkdown Template

You can use the Trundler RMarkdown template to quickly produce visualisations for product price histories. After installing the package, select “Trundler Report Template” under the “From Template” option on the New RMarkdown dialog.

Note: You might need to restart RStudio before the template shows up in the menu.