The function looks for .httr-oauth in the working directory. If it doesn't find it, it expects an application ID and a secret. If you want to remove the existing .httr-oauth, set remove_old_oauth to TRUE. By default, it is set to FALSE. The function launches a browser to allow you to authorize the application

  app_id = NULL,
  app_secret = NULL,
  scope = "ssl",
  token = ".httr-oauth",



client id; required; no default


client secret; required; no default


Character. ssl, basic, own_account_readonly, upload_and_manage_own_videos, partner, and partner_audit. Required. ssl and basic are basically interchangeable. Default is ssl.


path to file containing the token. If a path is given, the function will first try to read from it. Default is .httr-oauth in the local directory. So if there is such a file, the function will first try to read from it.


Additional arguments passed to oauth2.0_token


sets the google_token option and also saves .httr_oauth in the working directory (find out the working directory via getwd())

References for different scopes


if (FALSE) { yt_oauth("", "MbOSt6cQhhFkwETXKur-L9rN") }