API Documentation

POST mediarating

https://apisub.masala.one/v2/mediarating

Accepts an image as a public URL in a JSON request and returns a rating as result. The output returned by the API contains the rating of the image represented as below:

  • RatingCode: Unique image rating code
  • RatingDescription: Description of the rating code
  • Confidence: The confidence of the generated rating

With the following rating code definitions:

  • V01: Safe, OK – Implies that inappropriate content was not detected in the image.
  • V02: Provocative, Racy – Image may contain subjects with skimpy clothing, partial nudity, excessive skin exposure or provocative poses
  • V03: Adult, Nudity – Image may contain explicit nudity, pornography or obscene content

HEADERS


 
X-Masala-APIKey:
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type:
application/json
 

PARAMS          N/A


 

BODY raw



 

SAMPLE RESPONSE raw

{
  "RatingCode": "V02",
  "RatingDescription": "Racy, Provocative",
  "Confidence": "High"
}
curl --request POST "https://apisub.masala.one/v2/mediarating" \
--header "X-Masala-APIKey: xxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--header "Content-Type: application/json" \
--data '{"payload": "https://rebrand.ly/z0i7egt"}'

import requests

url = 'https://apisub.masala.one/v2/mediarating'
payload = "{\r\n \"payload\": \"https://rebrand.ly/z0i7egt\"\r\n}\r\n"
headers = {
      'X-Masala-APIKey':'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      'Content-Type':'application/json'
}
response = requests.request('POST', url, headers=headers, data=payload,allow_redirects=false,timeout=undefined,allow_redirects=false)

print(response.text)

var https = require('https');

var options = {
  'method': 'POST',
  'hostname': 'apisub.masala.one',
  'path': '/v2/mediarating',
  'headers': {
    'X-Masala-APIKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json'
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData =  "{\r\n  \"payload\": \"https://rebrand.ly/z0i7egt\"\r\n}\r\n";

req.write(postData);

req.end();

POST mediaratingb

https://apisub.masala.one/v2/mediaratingb

Accepts an image encoded as a string in Base64 format in a JSON request and returns a rating as result. The output returned by the API contains the rating of the image represented as below:

  • RatingCode: Unique image rating code
  • RatingDescription: Description of the rating code
  • Confidence: The confidence of the generated rating

With the following rating code definitions:

  • V01: Safe, OK – Implies that inappropriate content was not detected in the image.
  • V02: Provocative, Racy – Image may contain subjects with skimpy clothing, partial nudity, excessive skin exposure or provocative poses
  • V03: Adult, Nudity – Image may contain explicit nudity, pornography or obscene content

HEADERS


 
X-Masala-APIKey:
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type:
application/json
 

PARAMS          N/A


 

BODY raw


{
  "payload": "b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'"
}

 

SAMPLE RESPONSE raw

{
  "RatingCode": "V02",
  "RatingDescription": "Racy, Provocative",
  "Confidence": "High"
}
curl --request POST "https://apisub.masala.one/v2/mediaratingb" \
--header "X-Masala-APIKey: xxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--header "Content-Type: application/json" \
--data "{\"payload\": \"b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'\"}"

import requests

url = 'https://apisub.masala.one/v2/mediaratingb'
payload = "{\r\n \"payload\": \"b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'\"\r\n}\r\n"
headers = {
      'X-Masala-APIKey':'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      'Content-Type':'application/json'
}
response = requests.request('POST', url, headers=headers, data=payload,allow_redirects=false,timeout=undefined,allow_redirects=false)

print(response.text)

var https = require('https');

var options = {
  'method': 'POST',
  'hostname': 'apisub.masala.one',
  'path': '/v2/mediaratingb',
  'headers': {
    'X-Masala-APIKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json'
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData =  "{\r\n  \"payload\": \"b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'\"\r\n}\r\n";

req.write(postData);

req.end();

POST humandetectb

https://apisub.masala.one/v2/humandetectb

Accepts an image encoded as a string in Base64 format in a JSON request and returns a rating along with a probability value for human presence as result. The output returned by the API contains the rating of the image represented as below:

  • RatingCode: Unique image rating code
  • RatingDescription: Description of the rating code
  • HumanPresenceProbability: The probability of human presence in the image.

With the following rating code definitions:

  • V01: Safe, OK – Implies that inappropriate content was not detected in the image.
  • V02: Provocative, Racy – Image may contain subjects with skimpy clothing, partial nudity, excessive skin exposure or provocative poses
  • V03: Adult, Nudity – Image may contain explicit nudity, pornography or obscene content

HEADERS


 
X-Masala-APIKey:
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type:
application/json
 

PARAMS          N/A


 

BODY raw


{
  "payload": "b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'"
}

 

SAMPLE RESPONSE raw

{
  "HumanPresenceProbability": "1.0",
  "NudityRating": {
     "RatingCode": "V01",
     "RatingDescription": "2",
     "Confidence": "High"
   }
}
curl --request POST "https://apisub.masala.one/v2/humandetectb" \
--header "X-Masala-APIKey: xxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--header "Content-Type: application/json" \
--data "{\"payload\": \"b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'\"}"

import requests

url = 'https://apisub.masala.one/v2/humandetectb'
payload = "{\r\n \"payload\": \"b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'\"\r\n}\r\n"
headers = {
      'X-Masala-APIKey':'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      'Content-Type':'application/json'
}
response = requests.request('POST', url, headers=headers, data=payload,allow_redirects=false,timeout=undefined,allow_redirects=false)

print(response.text)

var https = require('https');

var options = {
  'method': 'POST',
  'hostname': 'apisub.masala.one',
  'path': '/v2/humandetectb',
  'headers': {
    'X-Masala-APIKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json'
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData =  "{\r\n  \"payload\": \"b'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...'\"\r\n}\r\n";

req.write(postData);

req.end();

POST Cyberbully Detection

https://text.masala.one/v1/textrating
Accepts text in segments in a JSON request and returns a toxicity score as an indication of probability. The detected toxicity currently covers various aspects ranging from aggressive language, to profanity, and sexually explicit content. The output returned by the API contains the rating of the content toxicity represented as below:
  • Description: Description of the rating code
  • RatingCode: Unique text rating code
  • Scores: The toxicity score along with individual scores for each label-or-attribute contributing to the toxicity of the input text. Currently supported labels include: Hate, Insult, Obscene, Severely Toxic, Sexually Explicit, and Threat.
With the following Rating Code definitions:
  • V01: Non-toxic content detected
  • V02: Toxic content detected

HEADERS


X-Masala-APIKey:
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type:
application/json

PARAMS         N/A


BODY raw


{
  "payload": "Sample text segment provided here"
}

SAMPLE RESPONSE raw

{
    "Description": "Safe",
    "RatingCode": "V01",
    "Scores": {
        "Hate": "0.0019561406",
        "Insult": "0.0015367505",
        "Obscene": "0.0052989633",
        "Severely Toxic": "0.00064276945",
        "Sexually Explicit": "0.0007140828",
        "Threat": "0.00077044003",
        "Toxic": "0.007277018"
    }
}
curl --request POST "https://text.masala.one/v1/textrating" \
--header "X-Masala-APIKey: xxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--header "Content-Type: application/json" \
--data '{"payload":"Sample text segment provided here"}'

import requests

url = 'https://text.masala.one/v1/textrating'
payload = "{\r\n \"payload\": \"Sample text segment provided here\"\r\n}\r\n"
headers = {
      'X-Masala-APIKey':'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      'Content-Type':'application/json'
}
response = requests.request('POST', url, headers=headers, data=payload,allow_redirects=false,timeout=undefined,allow_redirects=false)

print(response.text)

var https = require('https');

var options = {
  'method': 'POST',
  'hostname': 'text.masala.one',
  'path': '/v1/textrating',
  'headers': {
    'X-Masala-APIKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json'
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData =  "{\r\n  \"payload\": \"Sample text segment provided here\"\r\n}\r\n";

req.write(postData);

req.end();

1