{"id":15561017,"url":"https://github.com/pwelch/virustotal_api","last_synced_at":"2025-04-15T06:53:15.789Z","repository":{"id":24892568,"uuid":"28308818","full_name":"pwelch/virustotal_api","owner":"pwelch","description":"Ruby Gem for VirusTotal API","archived":false,"fork":false,"pushed_at":"2023-01-19T21:34:25.000Z","size":194,"stargazers_count":29,"open_issues_count":0,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T06:53:09.527Z","etag":null,"topics":["malware-analysis","ruby","security"],"latest_commit_sha":null,"homepage":"https://pwelch.github.io/virustotal_api","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pwelch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-21T18:34:28.000Z","updated_at":"2025-03-09T23:20:43.000Z","dependencies_parsed_at":"2023-02-11T21:20:28.075Z","dependency_job_id":null,"html_url":"https://github.com/pwelch/virustotal_api","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwelch%2Fvirustotal_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwelch%2Fvirustotal_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwelch%2Fvirustotal_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwelch%2Fvirustotal_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pwelch","download_url":"https://codeload.github.com/pwelch/virustotal_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023711,"owners_count":21199958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["malware-analysis","ruby","security"],"created_at":"2024-10-02T16:04:52.665Z","updated_at":"2025-04-15T06:53:15.767Z","avatar_url":"https://github.com/pwelch.png","language":"Ruby","readme":"# VirustotalAPI\n\nRuby Gem for [VirusTotal](https://www.virustotal.com) [V3 API](https://developers.virustotal.com/v3.0/reference).\nIf you want the version 2, check out the gem versions up to [0.4.0](https://github.com/crondaemon/virustotal_api/tree/v0.4.0).\n\n![Ruby](https://github.com/pwelch/virustotal_api/workflows/Ruby/badge.svg)\n\n[![Gem Version](https://badge.fury.io/rb/virustotal_api.svg)](http://badge.fury.io/rb/virustotal_api)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'virustotal_api'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install virustotal_api\n\n## Usage\n\nVirusTotal only allows 4 queries per minute for their Public API. https://www.virustotal.com/en/faq/\n\nYou will need a Private API Key if you require more queries per minute.\n\n### File Find\n\n```ruby\nrequire 'virustotal_api'\n\nsha256  = '01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b'\napi_key = 'MY_API_KEY'\n\nvtreport = VirustotalAPI::File.find(sha256, api_key)\n\n# Does the resource have any results?\nvtreport.exists?\n# =\u003e true\n\n# URL for File Report (if it exists)\nvtreport.report_url\n# =\u003e \"https://www.virustotal.com/api/v3/files/01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\"\n\n# Report results (if they exist) are available via #report\nvtreport.report['data']['attributes']['last_analysis_results']['ClamAV']\n# =\u003e {\"category\"=\u003e\"undetected\", \"engine_name\"=\u003e\"ClamAV\", \"engine_update\"=\u003e\"20200826\",\n# \"engine_version\"=\u003e\"0.102.4.0\", \"method\"=\u003e\"blacklist\", \"result\"=\u003enil}\n\n# Check whether an Antivirus detected this sample or not\nvtreport.detected_by('ClamAV')\n# =\u003e false\n```\n\n### File Upload\n\n```ruby\nrequire 'virustotal_api'\n\nfile    = '/path/to/file'\napi_key = 'MY_API_KEY'\n\n# for upload file\nvtscan = VirustotalAPI::File.upload(file, api_key)\n# or large file (more than 32MB)\nvtscan = VirustotalAPI::File.upload_large(file, api_key)\n\n# Virustotal ID of file\nvtscan.id\n# =\u003e \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b-1419454668\"\n\n# Response results are available via #response\nvtscan.report\n# =\u003e\n{\"data\"=\u003e\n  {\"id\"=\u003e\"MTkxNDBmMjU4ZGY1OGZiYzZjNmU2ODcyMWNhYjhkZTM6MTU5ODUzMTE5OQ==\",\n   \"type\"=\u003e\"analysis\"}}\n```\n\n### File Analyse\n\n```ruby\nrequire 'virustotal_api'\n\nsha256  = '01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b'\napi_key = 'MY_API_KEY'\n\nvtrescan = VirustotalAPI::File.analyse(sha256, api_key)\n\n# Virustotal ID of file\nvtrescan.id\n# =\u003e \"MTkxNDBmMjU4ZGY1OGZiYzZjNmU2ODcyMWNhYjhkZTM6MTU5ODUzMTE5OQ==\"\n\n# Response results are available via #response\nvtrescan.report\n# =\u003e\n{\"data\"=\u003e\n  {\"id\"=\u003e\"MTkxNDBmMjU4ZGY1OGZiYzZjNmU2ODcyMWNhYjhkZTM6MTU5ODUzMTE5OQ==\",\n   \"type\"=\u003e\"analysis\"}}\n```\n\n### URL find\n\n```ruby\nrequire 'virustotal_api'\n\nurl     = 'http://www.google.com'\napi_key = 'MY_API_KEY'\n\nvturl_report = VirustotalAPI::URL.find(url, api_key)\n\n# Does the resource have any results?\nvturl_report.exists?\n# =\u003e true\n\n# URL for Report (if it exists)\nvturl_report.report_url\n# =\u003e \"https://www.virustotal.com/api/v3/urls/dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf\"\n\n# Report results (if they exist) are available via #report\nvturl_report.report['data']['attributes']['last_analysis_results']['Avira']\n# =\u003e {\"category\"=\u003e\"harmless\", \"engine_name\"=\u003e\"Avira\", \"method\"=\u003e\"blacklist\", \"result\"=\u003e\"clean\"}\n```\n\n### URL Upload\n\n```ruby\nrequire 'virustotal_api'\n\nurl     = 'http://www.google.com'\napi_key = 'MY_API_KEY'\n\nvturl_scan = VirustotalAPI::URL.upload(url, api_key)\n\n# Virustotal ID of file\nvturl_scan.id\n# =\u003e \"u-dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf-1598531929\"\n\n# Response results are available via #response\nvturl_scan.report\n# =\u003e\n{\"data\"=\u003e\n  {\"id\"=\u003e\n    \"u-dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf-1598531929\",\n   \"type\"=\u003e\"analysis\"}}\n```\n\n### IP Find\n\n```ruby\nrequire 'virustotal_api'\n\nip      = '8.8.8.8'\napi_key = 'MY_API_KEY'\n\nvtip_report = VirustotalAPI::IP.find(ip, api_key)\n\n# Does the resource have any results?\nvtip_report.exists?\n# =\u003e true\n\n# URL for Report (if it exists)\nvtip_report.report_url\n# =\u003e \"https://www.virustotal.com/api/v3/ip_addresses/8.8.8.8\"\n\n# Report results (if they exist) are available via #report\nvtip_report.report\n# =\u003e Hash of report results\n```\n\n### Domain Find\n\n```ruby\nrequire 'virustotal_api'\n\ndomain  = 'virustotal.com'\napi_key = 'MY_API_KEY'\n\nvtdomain_report = VirustotalAPI::Domain.find(domain, api_key)\n\n# Does the resource have any results?\nvtdomain_report.exists?\n# =\u003e true\n\n# URL for Report (if it exists)\nvtdomain_report.report_url\n# =\u003e \"https://www.virustotal.com/api/v3/domains/virustotal.com\"\n\n# Report results (if they exist) are available via #report\nvtdomain_report.report\n# =\u003e Hash of report results\n```\n\n### User Find\n\n```ruby\nrequire 'virustotal_api'\n\nuser_key  = 'user_key' # user_id or api_key\napi_key = 'MY_API_KEY'\n\nvtuser_report = VirustotalAPI::User.find(user_key, api_key)\n\n# Does the resource have any results?\nvtuser_report.exists?\n# =\u003e true\n\n# Report results (if they exist) are available via #report\nvtuser_report.report\n# =\u003e Hash of report results\n```\n\n### Group Find\n\n```ruby\nrequire 'virustotal_api'\n\ngroup_id  = 'GROUP_id'\napi_key = 'MY_API_KEY'\n\nvtgroup_report = VirustotalAPI::Group.find(group_id, api_key)\n\n# Does the resource have any results?\nvtgroup_report.exists?\n# =\u003e true\n\n# Report results (if they exist) are available via #report\nvtgroup_report.report\n# =\u003e Hash of report results\n```\n\n## Contributors\n\n- [@jonnynux](https://github.com/jonnynux)\n- [@crondaemon](https://github.com/crondaemon/)\n- [@postmodern](https://github.com/postmodern)\n- [@mkunkel](https://github.com/mkunkel)\n- [@Grandman](https://github.com/Grandman)\n\n## Contributing\n\n1. Fork it ( https://github.com/pwelch/virustotal_api/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwelch%2Fvirustotal_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpwelch%2Fvirustotal_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwelch%2Fvirustotal_api/lists"}