Sightengine nudity detection - Nudity filter for images
Use the Sightengine nudity API to instantly moderate adult content in user-submitted photos.
Installation
npm install nudity-filter
Instructions
-
Create an account on http://sightengine.com, you will get your own
API_USER
andAPI_SECRET
values -
Import the Sightengine package
var SightengineClient = require ('./sightengine');
-
Initialize the Client with your
API_USER
andAPI_SECRET
valuesvar Sightengine = new SightengineClient(API_USER, API_SECRET);
-
Moderate your images using either
Sightengine.checkNudityForURL
orSightengine.checkNudityForFile
. See the example below.
Example
Initialize
// Set your API_USER and API_SECRET values here. See http://sightengine.com to create your account
var API_USER = "";
var API_SECRET = "";
var SightengineClient = require ('./sightengine');
var Sightengine = new SightengineClient(API_USER, API_SECRET);
Moderate an image available over HTTP
var imageurl = "http://url.to/image.jpg";
Sightengine.checkNudityForURL(imageurl, function(error, result) {
if(error) console.dir(error);
else console.log(result);
});
Moderate an image available on the local filesystem
var imagepath = "/path/to/image.jpg";
Sightengine.checkNudityForFile(imagepath, function(error, result) {
if(error) console.dir(error);
else console.log(result);
});