R/rescan_file.R

Defines functions rescan_file

Documented in rescan_file

#' Request rescan of a file
#'
#' Request a new analysis of a file already present in VirusTotal's database.
#' Returns an analysis ID for use with \code{\link{file_report}}.
#'
#' @param hash File hash (MD5, SHA1, or SHA256) or file ID. Required.
#' @param \dots Additional arguments passed to \code{\link{virustotal_POST}}.
#'
#' @return list containing analysis details and ID
#'
#' @export
#'
#' @references \url{https://docs.virustotal.com/reference}
#'
#' @seealso \code{\link{set_key}} for setting the API key
#'
#' @examples \dontrun{
#'
#' # Before calling the function, set the API key using set_key('api_key_here')
#'
#' rescan_file(hash='99017f6eebbac24f351415dd410d522d')
#' }

rescan_file <- function(hash = NULL, ...) {

    assert_character(hash, len = 1, any.missing = FALSE, min.chars = 1)

    res <- virustotal_POST(path = paste0("files/", hash, "/analyse"), ...)

    res
}

Try the virustotal package in your browser

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

virustotal documentation built on April 13, 2026, 9:07 a.m.