Run this command to install the SDK:

npm install cloudmersive-image-api-client --save


Or add this snippet to your package.json:

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


var CloudmersiveImageApiClient = require('cloudmersive-image-api-client');
var defaultClient = CloudmersiveImageApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveImageApiClient.NsfwApi();

var imageFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.nsfwClassify(imageFile, callback);

Run this command to install the SDK:

pip install git+https://github.com/Cloudmersive/Cloudmersive.APIClient.Python.ImageRecognition.git


from __future__ import print_function
import time
import cloudmersive_image_api_client
from cloudmersive_image_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_image_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'



# create an instance of the API class
api_instance = cloudmersive_image_api_client.NsfwApi(cloudmersive_image_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

try:
    # Not safe for work (NSFW) racy content classification
    api_response = api_instance.nsfw_classify(image_file)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NsfwApi->nsfw_classify: %s\n" % e)

Run this command to install the SDK:

Install-Package Cloudmersive.APIClient.NET.ImageRecognition -Version 1.3.5


using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.ImageRecognition.Api;
using Cloudmersive.APIClient.NET.ImageRecognition.Client;
using Cloudmersive.APIClient.NET.ImageRecognition.Model;

namespace Example
{
    public class NsfwClassifyExample
    {
        public void main()
        {
            // Configure API key authorization: Apikey
            Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
            
            

            var apiInstance = new NsfwApi();
            var imageFile = new System.IO.FileStream("C:\\temp\\inputfile", System.IO.FileMode.Open); // System.IO.Stream | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

            try
            {
                // Not safe for work (NSFW) racy content classification
                NsfwResult result = apiInstance.NsfwClassify(imageFile);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling NsfwApi.NsfwClassify: " + e.Message );
            }
        }
    }
}

To install with Maven, add a reference to the repository in pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>


And add a reference to the dependency in pom.xml:

<dependencies>
<dependency>
    <groupId>com.github.Cloudmersive</groupId>
    <artifactId>Cloudmersive.APIClient.Java</artifactId>
    <version>v2.32</version>
</dependency>
</dependencies>


To install with Gradle, add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}


And add the dependency in build.gradle:

dependencies {
        implementation 'com.github.Cloudmersive:Cloudmersive.APIClient.Java:v2.32'
}


// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.NsfwApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.setApiKeyPrefix("Token");

NsfwApi apiInstance = new NsfwApi();
File imageFile = new File("/path/to/file.txt"); // File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.
try {
    NsfwResult result = apiInstance.nsfwClassify(imageFile);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NsfwApi#nsfwClassify");
    e.printStackTrace();
}

Run this command to install the SDK:

composer require cloudmersive/cloudmersive_imagerecognition_api_client


<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');



$apiInstance = new Swagger\Client\Api\NsfwApi(
    
    
    new GuzzleHttp\Client(),
    $config
);
$image_file = "/path/to/file.txt"; // \SplFileObject | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

try {
    $result = $apiInstance->nsfwClassify($image_file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NsfwApi->nsfwClassify: ', $e->getMessage(), PHP_EOL;
}
?>

Add the Objective-C client to your Podfile:

pod 'CloudmersiveImageRecognitionApiClient', '~> 1.0'


CMDefaultConfiguration *apiConfig = [CMDefaultConfiguration sharedConfig];

// Configure API key authorization: (authentication scheme: Apikey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Apikey"];




NSURL* imageFile = [NSURL fileURLWithPath:@"/path/to/file"]; // Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

CMNsfwApi*apiInstance = [[CMNsfwApi alloc] init];

// Not safe for work (NSFW) racy content classification
[apiInstance nsfwClassifyWithImageFile:imageFile
          completionHandler: ^(CMNsfwResult* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling CMNsfwApi->nsfwClassify: %@", error);
                        }
                    }];

Add the Ruby client to your Gemfile:

gem 'cloudmersive-image-recognition-api-client', '~> 1.3.2'


# load the gem
require 'cloudmersive-image-recognition-api-client'
# setup authorization
CloudmersiveImageRecognitionApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveImageRecognitionApiClient::NsfwApi.new

image_file = File.new("/path/to/file") # File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.


begin
  #Not safe for work (NSFW) racy content classification
  result = api_instance.nsfw_classify(image_file)
  p result
rescue CloudmersiveImageRecognitionApiClient::ApiError => e
  puts "Exception when calling NsfwApi->nsfw_classify: #{e}"
end