How to Check if an IP Address is a Tor Node Server in Node.JS

With the increase in online commerce and remote business dealings, the use of VPNs and other privacy-preserving technology has risen in tandem. Tor servers are one of these services; they hide the original IP Address of a user, reducing the ability to trace information back to its source. The following API will allow you to check if an IP Address is a Tor exit node server.

Image for post
Image for post

To run this API, our first step is to install the client software:

npm install cloudmersive-validate-api-client –save

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

"dependencies": {
"cloudmersive-validate-api-client": "^1.2.4"

Then, you can call our function, IPAddressIsTorNode:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');
var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveValidateApiClient.IPAddressApi();var value = "value_example"; // String | IP address to check, e.g. \"\". The input is a string so be sure to enclose it in double-quotes.var callback = function(error, data, response) {
if (error) {
} else {
console.log('API called successfully. Returned data: ' + data);
apiInstance.iPAddressIsTorNode(value, callback);

Now, you can be informed on who is accessing your content and how. To access your API Key, you van visit the Cloudmersive website; this will give you access to 800 free calls per month across our library of APIs.

Written by

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

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