Spam Score API
Check the community-reported spam score for an email address or domain.
Spam Score API
Check the community-reported spam score for an email address or domain.Endpoint
GET /api/v1/spam-score
Query Parameters
query
(string, required): The email address or domain name to check.
Successful Response (200 OK)
Returns a JSON object with the score and report count:
{
"query": "spammer@example.com",
"score": 30,
"reportCount": 3
}
query
: The email or domain that was checked.score
: A score from 0 to 100 indicating the likelihood of being spam based on community reports (higher is more likely). Currently calculated as `reportCount * 10`, capped at 100.reportCount
: The number of times this email or domain has been reported as spam by users.
Error Responses
400 Bad Request
: If thequery
parameter is missing.{ "error": "Missing required query parameter: query" }
500 Internal Server Error
: If there was a problem retrieving the score.{ "error": "Failed to retrieve spam score." }
Example – cURL
curl "YOUR_APP_URL/api/v1/spam-score?query=suspicious-domain.com"
Replace YOUR_APP_URL
with the actual base URL of the running application.
Example – JavaScript Fetch
fetch('/api/v1/spam-score?query=bad-actor@spam.net')
.then(response => response.json())
.then(data => {
console.log(data);
// Example output: { query: 'bad-actor@spam.net', score: 50, reportCount: 5 }
})
.catch(error => console.error('Error fetching spam score:', error));