Our lookup endpoint provides another way for you to query details about your account or submitted images.
/api/lookup/?apikey=apikey&check=credits
You can check the remaining credits on your account by providing any site apikey
// 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;
}
/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.
// 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!