Title: | Walmart Open API Wrapper |
---|---|
Description: | Provides API access to the Walmart Open API <https://developer.walmartlabs.com/>, that contains data about stores, Value of the day and products which includes names, sale prices, shipping rates and taxonomies. |
Authors: | Emil Hvitfeldt [aut, cre] |
Maintainer: | Emil Hvitfeldt <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.5.9000 |
Built: | 2024-10-25 02:44:27 UTC |
Source: | https://github.com/emilhvitfeldt/walmartapi |
Returns NA if input is null, else returns input
ifelse_null(x)
ifelse_null(x)
x |
A number. |
A number or NA.
ifelse_null(NA) ifelse_null(1)
ifelse_null(NA) ifelse_null(1)
response formats are described at the url https://developer.walmartlabs.com/docs/read/Item_Field_Description.
item_base_response(x)
item_base_response(x)
x |
A List. |
A tibble with 15 columns in base response format.
lookup
gives access to item price and availability in real-time.
lookup(key = auth_cache$KEY, lsPublisherId = NULL, id = NULL, upc = NULL, list_output = FALSE)
lookup(key = auth_cache$KEY, lsPublisherId = NULL, id = NULL, upc = NULL, list_output = FALSE)
key |
Your API access key. |
lsPublisherId |
Your LinkShare Publisher Id. |
id |
vector of item ids. |
upc |
upc of the item. |
list_output |
Indicator for list output. |
An API key will be required to run this function and can be acquired by creating an account on the following website https://developer.walmartlabs.com/member.
For more information refer to the original documentation https://developer.walmartlabs.com/docs/read/Home.
Response formats are described at the url https://developer.walmartlabs.com/docs/read/Item_Field_Description.
A tibble with 15 columns in base response format.
## Not run: key <- "************************" ## Up to 20 ids can be called at once. lookup(id = c(12417882:12417937), key = key) lookup(id = 12417832, key = key) lookup(upc = 10001137891, key = key) ## First argument will be used with conflicting arguments. lookup(id = 12417837, upc = 10001137891, key = key) lookup(id = 12417832, key = key, list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" ## Up to 20 ids can be called at once. lookup(id = c(12417882:12417937), key = key) lookup(id = 12417832, key = key) lookup(upc = 10001137891, key = key) ## First argument will be used with conflicting arguments. lookup(id = 12417837, upc = 10001137891, key = key) lookup(id = 12417832, key = key, list_output = TRUE) ## End(Not run)
lookup
gives access to item price and availability in
real-time.
paginted(key = auth_cache$KEY, lsPublisherId = NULL, category = NULL, brand = NULL, specialOffer = NULL, list_output = FALSE)
paginted(key = auth_cache$KEY, lsPublisherId = NULL, category = NULL, brand = NULL, specialOffer = NULL, list_output = FALSE)
key |
Your API access key. |
lsPublisherId |
Your LinkShare Publisher Id. |
category |
Category id of the desired category. This should match the
id field from |
brand |
Brand name. |
specialOffer |
Special offers like (rollback, clearance, specialBuy). |
list_output |
Indicator for list output. |
An API key will be required to run this function and can be acquired by creating an account on the following website https://developer.walmartlabs.com/member.
For more information refer to the original documentation https://developer.walmartlabs.com/docs/read/Home.
Response formats are described at the url https://developer.walmartlabs.com/docs/read/Item_Field_Description.
A tibble with 16 columns. First 15 is the items in base response format, followed by a column containing the URL path for the next page.
## Not run: key <- "************************" paginted(key = key, brand = "Apple") paginted(key = key, category = 3944) paginted(key = key, category = 3944, specialOffer = "rollback") paginted(key = key, brand = "Apple", list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" paginted(key = key, brand = "Apple") paginted(key = key, category = 3944) paginted(key = key, category = 3944, specialOffer = "rollback") paginted(key = key, brand = "Apple", list_output = TRUE) ## End(Not run)
This functions caches the credentials to avoid need for entering it when calling other functions
save_walmart_credentials(app_key)
save_walmart_credentials(app_key)
app_key |
application key |
# since not checking is preformed not to waste API calls # it falls on the user to save correct information save_walmart_credentials("APP_KEY")
# since not checking is preformed not to waste API calls # it falls on the user to save correct information save_walmart_credentials("APP_KEY")
searching
allows text search on the Walmart.com catalogue and
returns matching items available for sale online.
An API key will be required to run this function and can be acquired by
creating an account on the following website
https://developer.walmartlabs.com/member.
searching(query, key = auth_cache$KEY, lsPublisherId = NULL, categoryId = NULL, start = NULL, sort = NULL, order = NULL, numItems = NULL, facet = FALSE, facet.filter = NULL, list_output = FALSE)
searching(query, key = auth_cache$KEY, lsPublisherId = NULL, categoryId = NULL, start = NULL, sort = NULL, order = NULL, numItems = NULL, facet = FALSE, facet.filter = NULL, list_output = FALSE)
query |
Search text - whitespace separated sequence of keywords to search for. |
key |
Your API access key. |
lsPublisherId |
Your LinkShare Publisher Id. |
categoryId |
Category id of the category for search within a category. This should match the id field from Taxonomy API. |
start |
Starting point of the results within the matching set of items - up to 10 items will be returned starting from this item. |
sort |
Sorting criteria, allowed sort types are (relevance, price, title, bestseller, customerRating, new). Default sort is by relevance. |
order |
Sort ordering criteria, allowed values are (asc, desc). This parameter is needed only for the sort types (price, title, customerRating). |
numItems |
Number of matching items to be returned, max value 25. Default is 10. |
facet |
Logical. Enables facets. Default value is FALSE. Set this to on to enable facets. |
facet.filter |
Filter on the facet attribute values. This parameter can be set to <facet-name>:<facet-value> (without the angles). Here facet-name and facet-value can be any valid facet picked from the search API response when facets are on. |
list_output |
Indicator for list output. |
For more information refer to the original documentation https://developer.walmartlabs.com/docs/read/Search_API.
Response formats are described at the url https://developer.walmartlabs.com/docs/read/Item_Field_Description.
A tibble with 15 columns in base response format.
## Not run: key <- "************************" searching(query = "ipod", key = key) searching(query = "ipod", key = key, categoryId = 3944) searching(query = "ipod", key = key, start = 44) searching(query = "ipod", key = key, numItems = 44) searching(query = "ipod", key = key, sort = "price", order = "asc") searching(query = "ipod", key = key, sort = "bestseller") searching(query = "ipod", key = key, list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" searching(query = "ipod", key = key) searching(query = "ipod", key = key, categoryId = 3944) searching(query = "ipod", key = key, start = 44) searching(query = "ipod", key = key, numItems = 44) searching(query = "ipod", key = key, sort = "price", order = "asc") searching(query = "ipod", key = key, sort = "bestseller") searching(query = "ipod", key = key, list_output = TRUE) ## End(Not run)
Subsets up to n elements in a vector
smart_subset(x, n)
smart_subset(x, n)
x |
A vector. |
n |
A number. |
vector of length equal to length of x or n, whichever is smallest.
smart_subset(1:10, 5) smart_subset(1:10, 50)
smart_subset(1:10, 5) smart_subset(1:10, 50)
store_locator
helps locate nearest Walmart Stores by letting
you users search for stores by latitude and longitude, by zip code and by
city.
store_locator(key = auth_cache$KEY, lat = NULL, lon = NULL, city = NULL, zip = NULL, list_output = FALSE)
store_locator(key = auth_cache$KEY, lat = NULL, lon = NULL, city = NULL, zip = NULL, list_output = FALSE)
key |
Your API access key. |
lat |
latitude. |
lon |
longitude. |
city |
city. |
zip |
zip code. |
list_output |
Indicator for list output. |
An API key will be required to run this function and can be acquired by creating an account on the following website https://developer.walmartlabs.com/member.
For more information refer to the original documentation https://developer.walmartlabs.com/docs/read/Store_Locator_API.
A tibble with 12 columns in base response format.
## Not run: key <- "************************" store_locator(key = key, lat = 29, lon = -95) store_locator(key = key, city = "Houston") store_locator(key = key, zip = 77063) store_locator(key = key, zip = 77063, list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" store_locator(key = key, lat = 29, lon = -95) store_locator(key = key, city = "Houston") store_locator(key = key, zip = 77063) store_locator(key = key, zip = 77063, list_output = TRUE) ## End(Not run)
This function returns the top level of categories only, for further levels
run function with list_output = FALSE
for nested list.
taxonomy(key = auth_cache$KEY, list_output = FALSE)
taxonomy(key = auth_cache$KEY, list_output = FALSE)
key |
Your API access key. |
list_output |
Indicator for list output. |
taxonomy
gives returns the category taxonomy used by
walmart.com to categorize items.
An API key will be required to run this function and can be acquired by creating an account on the following website https://developer.walmartlabs.com/member.
For more information refer to the original documentation https://developer.walmartlabs.com/docs/read/Taxonomy_API.
A tibble with 15 columns in base response format.
## Not run: key <- "************************" taxonomy(key = key) taxonomy(key = key, list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" taxonomy(key = key) taxonomy(key = key, list_output = TRUE) ## End(Not run)
trending
gives information on what is bestselling on
Walmart.com right now.
trending(key = auth_cache$KEY, lsPublisherId = NULL, list_output = FALSE)
trending(key = auth_cache$KEY, lsPublisherId = NULL, list_output = FALSE)
key |
Your API access key. |
lsPublisherId |
Your LinkShare Publisher Id. |
list_output |
Indicator for list output. |
An API key will be required to run this function and can be acquired by creating an account on the following website https://developer.walmartlabs.com/member.
For more information refer to the original documentation https://developer.walmartlabs.com/docs/read/Trending_API.
Response formats are described at the url https://developer.walmartlabs.com/docs/read/Item_Field_Description.
A tibble with 15 columns in base response format.
## Not run: key <- "************************" trending(key = key) trending(key = key, list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" trending(key = key) trending(key = key, list_output = TRUE) ## End(Not run)
VOD
provides the Value of the Day item at walmart.
VOD(key = auth_cache$KEY, list_output = FALSE)
VOD(key = auth_cache$KEY, list_output = FALSE)
key |
Your API access key. |
list_output |
Indicator for list output. |
An API key will be required to run this function and can be acquired by creating an account on the following website https://developer.walmartlabs.com/member.
Response formats are described at the url https://developer.walmartlabs.com/docs/read/Item_Field_Description.
A tibble with 15 columns in base response format.
## Not run: key <- "************************" VOD(key = key) VOD(key = key, list_output = TRUE) ## End(Not run)
## Not run: key <- "************************" VOD(key = key) VOD(key = key, list_output = TRUE) ## End(Not run)