Cool idea! You can also roll your own with ClamAV, there are a few libs utilizing the Daemon I suppose, like solita/clamav-java and cdarras/clamav-client
More info here
There is an API to do that: https://developers.virustotal.com/reference
But do note that your files end up on a server not in your control. Might be a security issue.
Regards,
Ronald