How to Scan a Website for Threats in Node.JS

When opening URLs or receiving site visit requests, it is important to know if the URL or link is of any danger to you and your business. With Phishing on the rise through email and other modes of contact, understanding where the URL is coming from and analyzing its script for any malicious content will keep your organization protected from any data breaches. The following API will scan any website for threats including viruses and phishing attempts, so you can feel safe following links and opening correspondence.

Image for post
Image for post

To start our function, we first need to run this command to install the SDK:

npm install cloudmersive-virus-api-client --save

Or, you can add this snippet to your package.json:

"dependencies": {
"cloudmersive-virus-api-client": "^1.1.7"
}

Then, we can call our function:

var CloudmersiveVirusApiClient = require('cloudmersive-virus-api-client');
var defaultClient = CloudmersiveVirusApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveVirusApiClient.ScanApi();var input = new CloudmersiveVirusApiClient.WebsiteScanRequest(); // WebsiteScanRequest |var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.scanWebsite(input, callback);

Now, you can be assured that your information will remain safe as you browse online. The API Key is available at no cost and with no commitment on the Cloudmersive website. This will give you access to 800 calls per month across our entire API library.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store