Title: | Client for the Amazon Alexa Web Information Services API |
---|---|
Description: | Use the Amazon Alexa Web Information Services API to find information about domains, including the kind of content that they carry, how popular are they---rank and traffic history, sites linking to them, among other things. See <https://aws.amazon.com/awis/> for more information. |
Authors: | Gaurav Sood [aut, cre], Thomas Leeper [ctb] |
Maintainer: | Gaurav Sood <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.8 |
Built: | 2024-08-21 02:44:02 UTC |
Source: | https://github.com/cran/aws.alexa |
Find information about domains, including the kind of content that they carry, how popular are they, sites linking to them, among other things. The package provides access to the Alexa Web Information Service API: https://docs.aws.amazon.com/AlexaWebInfoService/latest/.
To learn how to use aws.alexa, see this vignette: https://CRAN.R-project.org/package=aws.alexa/vignettes/overview.html.
You need to get credentials (Access Key ID and Secret Access Key) to use this application.
If you haven't already, get these at https://aws.amazon.com/.
And set these using set_secret_key
Gaurav Sood
Request Response Verification
alexa_check(req)
alexa_check(req)
req |
request |
in case of failure, a message
GET
alexa_GET( query, key = Sys.getenv("AWS_ACCESS_KEY_ID"), secret = Sys.getenv("AWS_SECRET_ACCESS_KEY"), verbose = getOption("verbose", FALSE), session_token = NULL, region = "us-west-1", headers = list(), ... )
alexa_GET( query, key = Sys.getenv("AWS_ACCESS_KEY_ID"), secret = Sys.getenv("AWS_SECRET_ACCESS_KEY"), verbose = getOption("verbose", FALSE), session_token = NULL, region = "us-west-1", headers = list(), ... )
query |
query list |
key |
A character string containing an AWS Access Key ID. The default is retrieved from |
secret |
A character string containing an AWS Secret Access Key. The default is retrieved from |
verbose |
A logical indicating whether to be verbose. Default is given by |
session_token |
Optionally, a character string containing an AWS temporary Session Token. If missing, defaults to value stored in environment variable AWS_SESSION_TOKEN. |
region |
A character string containing the AWS region. If missing, defaults to “us-west-1”. |
headers |
A list of request headers for the REST call. |
... |
Additional arguments passed to |
list
Postprocess the results a bit
alexa_PROCESS(res)
alexa_PROCESS(res)
res |
result |
display request ID and Response Status and the first member of the list
Uses data from dmoz.org, which is no longer updated.
browse_categories( path = NULL, response_group = "Categories", description = TRUE, ... )
browse_categories( path = NULL, response_group = "Categories", description = TRUE, ... )
path |
String; Required; valid category path |
response_group |
String; Required; One of the following: Categories, RelatedCategories, LanguageCategories, LetterBars |
description |
Boolean; Optional; Whether or not to return descriptions of categories; Default is TRUE |
... |
Additional arguments passed to |
data.frame with 5 columns: path, title, sub_category_count, total_listing_count, description
## Not run: browse_categories(path="Top/Arts") ## End(Not run)
## Not run: browse_categories(path="Top/Arts") ## End(Not run)
Uses data from dmoz.org, which is no longer updated. For any given category, it returns a list of site listings contained within that category.
category_listing( path = NULL, sort_by = "Popularity", recursive = TRUE, start = 0, count = 20, description = TRUE, ... )
category_listing( path = NULL, sort_by = "Popularity", recursive = TRUE, start = 0, count = 20, description = TRUE, ... )
path |
String; Required; valid category path |
sort_by |
sort results by Popularity, Title, or AverageReview |
recursive |
Boolean; Whether to return listings for the current category only, or for the current category plus all subcategories, Default is TRUE |
start |
index of result at which to start; default is 0 |
count |
Number of results to return for this request; Max = 20; Default = 20 |
description |
Boolean; Optional; Whether or not to return descriptions of categories; Default is TRUE |
... |
Additional arguments passed to |
data.frame
https://docs.aws.amazon.com/AlexaWebInfoService/latest/ApiReference_CategoryListingsAction.html
## Not run: category_listing(path="Top/Arts") ## End(Not run)
## Not run: category_listing(path="Top/Arts") ## End(Not run)
Sites linking to the site
in_links(url = NULL, start = 0, count = 20, ...)
in_links(url = NULL, start = 0, count = 20, ...)
url |
String; Required; valid url |
start |
index of result at which to start; default = 0 |
count |
Number of results to return for this request; Max = 20; Default = 20 |
... |
Additional arguments passed to |
data.frame with two columns: title (site hostname) and url (specific url)
https://docs.aws.amazon.com/AlexaWebInfoService/latest/ApiReference_SitesLinkingInAction.html
## Not run: in_links(url = "google.com") ## End(Not run)
## Not run: in_links(url = "google.com") ## End(Not run)
Get the Access Key ID and Secret Access Key by logging into https://console.aws.amazon.com/,
clicking on the username followed by security credentials. The function sets two environmental variables
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
. These environment variables persist within a R session. The function
looks for these variables
set_secret_key(key = NULL, secret = NULL, force = FALSE)
set_secret_key(key = NULL, secret = NULL, force = FALSE)
key |
String; Required; Access Key ID |
secret |
String; Required; Secret Access Key |
force |
String; Required; Force change the |
## Not run: set_secret_key(key = "key", secret = "secret") ## End(Not run)
## Not run: set_secret_key(key = "key", secret = "secret") ## End(Not run)
Get Traffic History of a URL
traffic_history(url = NULL, range = 31, start = NULL, ...)
traffic_history(url = NULL, range = 31, start = NULL, ...)
url |
String; Required; valid url |
range |
Integer; Required; Default is 31, Maximum is 31. Pick an integer between 1 and 31. |
start |
String; Optional; A date within the last 4 years in format YYYYMMDD. |
... |
Additional arguments passed to |
data.frame with the following columns: site, start, range,
date, page_views_per_million, page_views_per_user, rank, reach_per_million
https://docs.aws.amazon.com/AlexaWebInfoService/latest/ApiReference_TrafficHistoryAction.html
## Not run: traffic_history(url = "http://www.google.com", start = "20160505") ## End(Not run)
## Not run: traffic_history(url = "http://www.google.com", start = "20160505") ## End(Not run)
Get Information about a URL
url_info(url = NULL, response_group = "SiteData", ...)
url_info(url = NULL, response_group = "SiteData", ...)
url |
String; Required; valid url |
response_group |
String; Required; One of the following: RelatedLinks, Categories, Rank, RankByCountry, UsageStats, AdultContent, Speed, Language, OwnedDomains, LinksInCount, SiteData Default is 'SiteData'. Multiple fields can be passed. They must be separated by comma. |
... |
Additional arguments passed to |
named list
https://docs.aws.amazon.com/AlexaWebInfoService/latest/ApiReference_UrlInfoAction.html
## Not run: url_info(url = "http://www.google.com") ## End(Not run)
## Not run: url_info(url = "http://www.google.com") ## End(Not run)