getRanks | R Documentation |
getRanks
requests rank data for specific products from the appFigures
API.
getRanks(product_ids, country = "US", category, end_date, start_date, filter = 400, granularity = c("daily", "hourly"), tz = c("utc", "est", "user"), curlHandle, verbose = FALSE, orgJSON = FALSE, async = FALSE, agroups = 2)
product_ids |
Numeric. A vector of appFigures-assigned product ids. |
country |
Character. One or more country iso abbreviations that filter which countries rank data to include. Defaults to "US". |
category |
An atomic character or numeric vector. See Details. |
end_date |
Character string or date object. Date of last ranks to be reported. Defaults to today. See Details. |
start_date |
Character string or date object. Date of first ranks to be
reported. Defaults to 31 days prior to the |
filter |
Limit results to ranks in the top N with N being a number between 1 and 400. A filter value of 100 will only show records that are ranked 1 - 100. Defaults to 400. |
granularity |
Character. Should ranks be reported on a daily or hourly basis. |
tz |
Character. Specifies which timezone to use. Defaults to |
curlHandle |
Provide an instance of the CURLHandle-class from the RCurl package. The default will create a curl handle specific to the function call. |
verbose |
Logical. Should details of the web request print to the
console? Defaults to |
orgJSON |
Logical. Should the JSON string be returned with out being
converted to R objects? Defaults to |
async |
Logical. Should the given product ids be split up into groups
and and run concurrently? Defaults to |
agroups |
Integer. The number of concurrent calls to make. |
The category
argument is not included in the web request.
Subsetting the returned rank data on this argument occurs after the data has
been transformed into R objects and is included purely as a convenience.
Details on store categories can be requested using getStoreData
.
For start_date
and end_date
, if the supplied argument can be
interepreted as a date or POSIX object, any hour, minute, or second is
ignored. If a string is supplied, it should have the format: 'yyyy-MM-dd'.
Depends on the selected options. If orgJSON = F
, a data.frame is
returned. If orgJSON = T
, a character vector of json strings is
returned, the length of which is determined by the integer specified by
agroups
.
Official documentation: http://docs.appfigures.com/api/reference/v2/ranks.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.