pageSpeed: Function to retrieve Data from Googles Pagespeed Testing API
Description
This function allows you to retrive Data from Googles Pagespeed Testing API. The Function retrives the data (a numeric value between 0 and 100) for a given Url.
Usage
pageSpeed(url, APIToken = "AIzaSyC1gUZEsqk-nny6f3KnJyTKuy30O6fpGCw",
strategy = "mobile", pageStats = FALSE, speedScore = FALSE)
Arguments
url
The Url you want to perform the test for.
APIToken
Your API Token for this Google Project. Please use your own token if you perform a lot of calls.
strategy
Character. Choose if you want to get the data for "mobile" or "desktop"
pageStats
Logical. Do you want to get the Pagestats from the API? Default is TRUE
speedScore
Logical. If TRUE you just get the Pagespeed Score Number. Default is FALSE
pageSpeed()
Examples
Run this code# NOT RUN {
pageSpeed("https://www.r-project.org/")
# }
Run the code above in your browser using DataLab