R/set_key.R

Defines functions set_key

Documented in set_key

#' Set API Key
#'
#' Before anything else, get the API key from \url{https://www.virustotal.com/en/}.
#' Next, use \code{\link{set_key}} to store the API key in an environment variable \code{VirustotalToken}. 
#' Once you have set the API key, you can use any of the functions.
#'  
#' @param api_key API key. String. Required. 
#' 
#' @export
#' 
#' @references \url{https://developers.virustotal.com/v2.0/reference}
#' 
#' @examples \dontrun{
#' 
#' set_key('api_key_here')
#' 
#' }

set_key <- function(api_key = NULL) {

  if (!is.character(api_key)) stop("Must specify API Key.\n")

  Sys.setenv(VirustotalToken = api_key)

}

Try the virustotal package in your browser

Any scripts or data that you put into this service are public.

virustotal documentation built on Nov. 4, 2021, 9:08 a.m.