Look up

Our lookup endpoint provides another way for you to query details about your account or submitted images.

Check credits

/api/lookup/?apikey=apikey&check=credits

You can check the remaining credits on your account by providing any site apikey

Accepts

apikey - apikey provided after logging in
check - should equal credits to check remaining credits for your account

Returns

credits - a numeric value for the remaining credits in your account


Example code (PHP)

// check credits
$ch = curl_init();
$url = "https://www.modraptor.com/api/lookup/?apikey=$apikey&check=credits";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);

// decode json response and handle it
$decoded = json_decode($output);
if ($decoded->success) {
  echo "Account has ".$decoded->credits." credits remaining";
} else {
  echo $decoded->error_description;
  echo $decoded->error_code;
}


Look up image

/api/lookup/?apikey=apikey&check=image&imageid=imageid

Although we provide a callback there may be some cases where you may wish to use the lookup image method such as if your server lost connectivity and our callback failed. This method provides all the information we have on the image you submitted such as whether it has been moderated yet or if it was moderated what tags we set.

Accepts

apikey - apikey provided after logging in
check - should equal image to query an image you submitted
imageid - the image id to query

Returns

imageid - The image id you submitted
clientid - Your client id
siteid - Your site id (each apikey is unique to each site you create in our system)
imageurl - The URL to the image you provided
submittime - The unixtime you submitted the image
modtime - The time we moderated the image
returnid - The ID of the image in your system (optional)
returnurl - The callback URL you provided (optional)
httpcode - The http status code the callback received (should be 200)
modid - The ID of the moderator that processed your image
tags - A comma delimited list of all the image tags. If "ok" then image was not tagged. Tags include: 'verysexual', 'sexual', 'mildlysexual', 'offensive', 'politicalreligious', 'drugs', 'alcohol', 'gambling', 'broken', 'quality', 'advertising', 'noface', 'ntu', 'inhuman', 'child', 'rotatec' ,'rotatecc' , 'flip', 'ok'
queuestate - The state of the image in our system. "submitted" - we received the image and we are downloading it, "waitingmoderation" - the image is in our system and awaiting moderation, "awaitingpost" - our callback is in the process of connecting to your server to post the results, "done" - received a 200 ok from your server and the moderation is complete, "failedprocessing" - there was an error connecting to your server or retrieving the image from your server

Example code (PHP)

// check image
$ch = curl_init();
$url = "https://www.modraptor.com/api/lookup/?apikey=$apikey&check=image&imageid=555";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);

// decode json response and handle it
$decoded = json_decode($output);
if ($decoded->success) {
  /*
    $decoded->imageid;
    $decoded->clientid;
    $decoded->siteid;
    $decoded->imageurl;
    $decoded->submittime;
    $decoded->modtime;
    $decoded->returnid;
    $decoded->returnurl;
    $decoded->httpcode;
    $decoded->queuestate;
    $decoded->tags;
    $decoded->modid;
  */
} else {
  echo $decoded->error_description;
  echo $decoded->error_code;
}

Get started with 100 free images!