Curated Examples
Use the .NET client
Use VirusTotalAnalyzer from C# with an environment-provided API key.
This pattern is useful when VirusTotal lookups are part of an application or automation service.
It is adapted from VirusTotalAnalyzer.Examples/GetFileReportExample.cs.
Example
using VirusTotalAnalyzer;
var apiKey = Environment.GetEnvironmentVariable("VT_API_KEY");
using IVirusTotalClient client = VirusTotalClient.Create(apiKey);
var report = await client.GetFileReportAsync("44d88612fea8a8f36de82e1278abb02f");
Console.WriteLine(report?.Id);
What this demonstrates
- using the .NET client directly
- keeping the API key out of source
- starting with a known public test hash