How to use the JSON API Service
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write and is built into many popular programming languages. Access to this service is free and does not require an API Key. However, its use is bound by a fair use policy. If this service is abused, the offending IP addresses will warned and then blocked.
URL Syntax and Parameters
http://www.stop-registration-spam.org/api/{level}/json?domain=gmail.com
OR http://www.stop-registration-spam.org/api/{level}/json?email=test@gmail.com
Prevention Levels
Each level of the blacklist check includes all levels above it. E.g. Level 3 also passes through levels 1 and 2 of the blacklist check.
| Level | Value | Description |
|---|---|---|
| 1 | level1 | Confirmed permanent mass DED. These domains have been human verified as a source of DEAs. |
| 2 | level2 | Confirmed permanent mass DED or domain with no MX DNS. These domains have been human confirmed or have no MX DNS records so cannot direct incoming mail. |
| 3 | level3 | Web check positive but unconfirmed DED. Our spiders had reason to flag the domain as a DEA source but has not yet been human verified. |
| 4 | level4 | Reported but unconfirmed DED. This domain has been reported by one of our users. If a domain has not failed the blacklist check by this point it has not been flagged by our automated web-check and has a valid MX DNS record. |
| 5 | level5 | Mass free email domain (gmail, hotmail, etc). These domain have been human verified as genuine mass free email providers. These are separate from the DED as they require a detailed registration and users must abide by a terms of service. |
Response
Example: {"request_status": "OK", "request_time": "2012-05-21 02:44:32", "request_ip": "38.107.179.218"}
| Field | Description |
|---|---|
| request_status | The response will carry one of the following statuses:
OVER_LIMIT - you have reached your daily request limit |
| request_time | The time the request was made. |
| request_ip | All IP addresses are logged as a fair use policy applies. To continue user for commercial purposes above the capped limit, please contact us. |
Additional Response Fields
If the request was successful, it is often accompanied by additional response fields based on the version of the API that processed the original request as given below.
Version 1.0
| Field | Description |
|---|---|
| version | The version of the API required to parse the request response. |
| date_added | The date the domain was first queried. |
| server_id | The ID of the server the request was processed by. |
PHP Example
Here is a simple example of how the JSON service can be added using PHP
<?php
$level = 'level3';
$domain = 'gmail.com';
$request = 'http://www.stop-registration-spam.org/api/' . $level . '/json?domain=' . $domain;
$response = file_get_contents($request);
$ded = json_decode($response);
if ($ded->request_status == 'OK')
{
// ok
}
else if ($ded->request_status == 'BLOCK')
{
// block
}
else
{
// failsafe
}