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

Installation

Install from GitHub.

remotes::install_github("datawookie/trundler")

Usage

library(trundler)

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("5bed3ac9-6dc9-4926-aed8-8c97a7cb8057")

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

You can also subscribe via RapidAPI, in which case you use a different function to register your key.

set_rapidapi_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