Malware File Scanner Service API in cURL

< Back to Guides

Instructions

  1. Get a free API to use by signing up at FileScanAPI.com and replace REPLACE_ME with your API key.
  2. Update location value in payload with url location of your file.
  3. Update callback value in payload to your webhook url. We recommend using webhook.site as a callback url during test.
  4. Update FILE_LOCATION with local absolute file path

Offical Documentation

Using cURL to check for malware in file

Async File Upload

curl --location 'https://api.filescanapi.com/v1/file/async' \
--header 'x-api-key: REPLACE_ME' \
--form 'file=@"FILE_LOCATION"' \
--form 'metadata[filename]="demo.png"' \
--form 'callback="https://webhook.site"'

Async File Location

curl --location 'https://api.filescanapi.com/v1/file/async' \
--header 'x-api-key: REPLACE_ME' \
--header 'Content-Type: application/json' \
--data '{
    "location": "https://filescanapi.com/icon.png",
    "metadata": {
        "filename": "demo.png"
    },
    "callback": "https://webhook.site"
}'

Sync File Upload

curl --location 'https://api.filescanapi.com/v1/file/sync' \
--header 'x-api-key: REPLACE_ME' \
--form 'file=@"FILE_LOCATION"' \
--form 'metadata[filename]="demo.png"'

Async File Location

curl --location 'https://api.filescanapi.com/v1/file/sync' \
--header 'x-api-key: REPLACE_ME' \
--header 'Content-Type: application/json' \
--data '{
    "location": "https://filescanapi.com/icon.png",
    "metadata": {
        "filename": "demo.png"
    }
}'