Sample

Samples are what make Virus.exchange — they are the basic building blocks of your every interaction with Virus.exchange. On this page, we’ll dive into the different endpoints you can use to upload files programmatically.


POST/api/samples/new

Create a Sample

This endpoint allows you to upload a file to the exchange.

Request

POST
/api/samples/new
curl --request POST \
  --url https://virus.exchange/api/samples/new \
  --header 'authorization: Bearer $API_KEY' \
  --header 'content-type: multipart/form-data' \
  --form 'file=@/tmp/file'

Request

POST
/api/upload
curl --request POST \
  --url https://virus.exchange/api/upload \
  --header 'authorization: Bearer $API_KEY' \
  --header 'content-type: multipart/form-data' \
  --form 'file=@/tmp/file'

Response

{
  "id": 123
}
GET/api/samples/:sha256

Get a Sample

This endpoint allows you to retreieve a file from virus.exchange

Request

GET
/api/samples/sha256
curl -X GET https://virus.exchange/api/samples/sha256 /
-H "Authorization: Bearer $TOKEN"

Response

{
	"md5": "",
	"size": 0,
	"type": "image/png",
	"names": ["test"],
	"sha512": "",
	"sha256": "sha256",
	"sha1": "",
	"tags": null,
	"first_seen": "2023-09-07T00:08:30Z",
	"download_link": "",
  "binary": ""
}