Developers
Spamlyze API and MCP
Check websites against Google's spam policies from your code, your automations (Zapier, n8n, Make) or your AI agent. Every request is paid from a prepaid balance in US dollars: a Quick Check costs $0.15 and a Deep Report $12. Reading results is free, and a request that fails is never charged.
The Deep Report is the one to act on: it reads every page and the site's Google Search Console data, so it tells you whether Google actually cut the site's traffic, after which update, and which pages lost clicks. How Search Console works with the API.
Quick start
1. Sign in at spamlyze.com/account with Google, add credits and create an API key. It starts with spz_live_ and is shown once: keep it secret, on your server.
2. Send it as a Bearer token. Check your balance:
curl https://spamlyze.com/v1/account \
-H "Authorization: Bearer $SPAMLYZE_KEY"3. Run a Quick Check. It answers in 30 to 45 seconds:
curl https://spamlyze.com/v1/checks \
-H "Authorization: Bearer $SPAMLYZE_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"url": "example.com"}'const res = await fetch("https://spamlyze.com/v1/checks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPAMLYZE_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({ url: "example.com" }),
});
const check = await res.json();
if (!res.ok) throw new Error(check.error.message);
console.log(check.riskScore, check.coverage.message);import os, uuid, requests
r = requests.post(
"https://spamlyze.com/v1/checks",
headers={
"Authorization": f"Bearer {os.environ['SPAMLYZE_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"url": "example.com"},
timeout=120,
)
check = r.json()
r.raise_for_status()
print(check["riskScore"], check["coverage"]["message"])Quick Check or Deep Report?
| Quick Check | Deep Report | |
|---|---|---|
| Price | $0.15 | $12 |
| Pages | About 15 (a sample) | Every page, up to 500 |
| Time | 30 to 45 s, synchronous | 5 to 30 min, asynchronous |
| Search Console | No | Yes: real clicks, the updates that hit, the pages that lost traffic |
| Result | Estimated risk score, signals, top 3 fixes | Verdict per page, risk score, action plan tied to real losses |
| Best for | Screening many domains | Diagnosing a site and fixing it |
A Quick Check only sees a sample. Always read coverage.scoreScope: when it is sample, the score describes the pages checked, not the whole site, and headline gives a sentence to show instead of the bare number. Show coverage.message to your users next to the score.
Endpoints
Base URL https://spamlyze.com/v1. JSON in, JSON out. Machine-readable description: openapi.json (OpenAPI 3.1, works with Postman, Insomnia and code generators).
| GET | /v1/account | Balance, daily cap and prices |
| POST | /v1/checks | Run a Quick Check ($0.15) |
| GET | /v1/checks/{id} | Read a Quick Check you ran |
| POST | /v1/reports | Start a Deep Report ($12), with the site's Search Console data |
| GET | /v1/reports/{id} | Progress, then results of a Deep Report |
| GET | /v1/ledger | Credit movements, newest first |
| GET | /v1/webhook | Webhook URL, signing secret and recent deliveries |
| PUT | /v1/webhook | Set the URL that receives report events |
| DELETE | /v1/webhook | Stop sending events and forget the secret |
Both POST endpoints take an optional hitBySpamUpdate ("yes", "no" or "unsure"): whether the site lost traffic after a spam update. It helps us calibrate the scores.
{
"id": "Xk2…",
"object": "quick_check",
"domain": "example.com",
"riskScore": 38,
"riskLevel": "moderate",
"headline": "No major issue on the 15 pages checked",
"coverage": {
"pagesChecked": 15, "knownPages": 412, "pagesNotChecked": 397,
"complete": false, "scoreScope": "sample",
"message": "… The risk score only describes the 15 pages checked …"
},
"signals": [{ "id": "scaled_content", "level": "moderate", "score": 41, "finding": "…" }],
"topIssues": [{ "title": "…", "why": "…", "fix": "…" }],
"reportUrl": "https://spamlyze.com/report/Xk2…",
"cached": false,
"charged": { "cents": 15, "currency": "usd" },
"balance": { "cents": 4985, "currency": "usd" }
}Deep Reports and webhooks
- Create:
POST /v1/reportsanswers202with the reportid, astatusUrlandsearchConsole.connectUrl(send that link to the site owner). - Wait:
GETthestatusUrl(that is/v1/reports/{id}) every 30 to 60 seconds and watchstatusandprogress, or set a webhook and do nothing until it calls you. - Read the result: once
statusisdone, the sameGETreturnsanalysis(risk score, signals, action plan) andmetrics; add?pages=truefor every page's verdict.reportUrlis the same report as a web page you can share with your client.
POST /v1/reports answers 202 at once with the report id. The report then runs on our servers, even if your connection closes. Either poll GET /v1/reports/{id} (every 30 s is plenty) until status is done or failed, or set a webhook. A failed report is credited back to your balance automatically. The same domain can be reported once per hour.
curl https://spamlyze.com/v1/reports \
-H "Authorization: Bearer $SPAMLYZE_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1234" \
-d '{"url": "example.com", "maxPages": 500}'
curl "https://spamlyze.com/v1/reports/REPORT_ID?pages=true" \
-H "Authorization: Bearer $SPAMLYZE_KEY"Set a webhook with PUT /v1/webhook {"url": "https://…"}. You receive report.done, report.failed and report.updated (Search Console added to a finished report) events, retried up to 6 times over about 9 hours until you answer 2xx. Check the Spamlyze-Signature header before trusting a payload, and deduplicate with the event id:
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the request body as a string, before JSON.parse.
function verify(rawBody, header, secret /* whsec_… */) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // replay window
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}import hmac, hashlib, time
def verify(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
if abs(time.time() - int(parts["t"])) > 300:
return False
signed = f"{parts['t']}.".encode() + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])Search Console in Deep Reports
Public pages show how exposed a site is. Only its own traffic shows whether Google acted on it. With the owner's Search Console, the Deep Report adds 16 months of clicks, the impact of each spam and core update, and the pages that lost clicks: they are crawled and reviewed first, and the action plan starts with them. It is included in the $12.
Every Deep Report comes with searchConsole.connectUrl. Send that link to the site owner: they sign in with the Google account that manages the site and allow read-only access. We import the data once, then revoke the access and keep no token. You never handle their Google credentials. Because we keep no access, the owner connects again for each new Deep Report (it takes a minute).
Coming with the Monitoring plan: a lasting Search Console connection per site, which the owner can revoke at any time, so recurring reports and alerts use fresh traffic data without a new link each time.
- Wait for Search Console (recommended): send
"searchConsole": "wait". The report has the statuswaiting_for_search_consoleand starts as soon as the owner connects, built on their traffic from the start. Nothing is crawled or analyzed while it waits. After 72 hours without a connection it runs without Search Console, or, with"onSearchConsoleTimeout": "cancel", it is cancelled and the $12 go back to your balance. - Start now (default): the report runs at once from public pages. If the owner connects later, the report is updated for free with their traffic and you receive
report.updated.
curl https://spamlyze.com/v1/reports \
-H "Authorization: Bearer $SPAMLYZE_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "client-site.com", "searchConsole": "wait", "onSearchConsoleTimeout": "cancel"}'
# 202 → {
# "id": "…", "status": "waiting_for_search_console",
# "searchConsole": {
# "connected": false,
# "connectUrl": "https://spamlyze.com/api/gsc/connect?deep=…",
# "waitUntil": "…", "onTimeout": "cancel"
# }, …
# }Once connected, searchConsole also gives the property, the update after which the site lost the most clicks (worstUpdate) and how many pages lost clicks (pagesThatLostClicks).
MCP server for AI agents
Spamlyze runs a hosted MCP server at https://spamlyze.com/mcp (Streamable HTTP). Add it to Claude, Cursor or any MCP client with your API key: the agent gets four tools, quick_check, start_deep_report, get_deep_report and get_balance. They are billed exactly like the API, and start_deep_report takes the same Search Console options. Agents are told to ask you before starting a paid Deep Report.
claude mcp add --transport http spamlyze https://spamlyze.com/mcp \
--header "Authorization: Bearer $SPAMLYZE_KEY"{
"mcpServers": {
"spamlyze": {
"type": "http",
"url": "https://spamlyze.com/mcp",
"headers": { "Authorization": "Bearer spz_live_…" }
}
}
}Clients that only speak stdio can use a bridge such as npx mcp-remote https://spamlyze.com/mcp --header "Authorization: Bearer spz_live_…". Use a dedicated key for each agent. The daily spend cap of your account ($100 by default) also limits what a runaway agent can spend.
Errors, limits and retries
Every error has the same shape: {"error": {"code": "…", "message": "…"}}. Branch on code, show message.
| 400 | invalid_body, invalid_url, invalid_max_pages, invalid_search_console, invalid_hit_by_spam_update, invalid_webhook_url, invalid_idempotency_key | Fix the request. Nothing was charged. |
| 401 | missing_api_key, invalid_api_key | Send a valid key. |
| 402 | insufficient_credits | Top up your balance. |
| 403 | account_suspended | Contact us. |
| 404 | not_found | Unknown id, or an id from another account. |
| 409 | idempotency_in_progress | The first request with this key is still running. |
| 422 | robots_blocked, bot_challenge, site_unreachable, analysis_failed, idempotency_key_reused | We could not analyze this site. Nothing was charged. |
| 429 | rate_limited, daily_cap_reached, too_many_concurrent, too_many_running, too_many_waiting, domain_cooldown | Wait for Retry-After. |
| 503 | api_not_open, budget_exhausted, busy, unavailable | Retry later (Retry-After when known). |
- 60 requests per minute per key. 3 Quick Checks and 3 Deep Reports running at the same time per account.
- A daily spend cap per account, $100 by default. Write to us to change it.
- Send an
Idempotency-Keyheader on POST requests. If a request times out, retry with the same key and the same body: you get the first answer back, never a second charge. Keys are kept 24 hours. - On 429 and 503, wait for the number of seconds in
Retry-Afterbefore retrying.
Credits and billing
Add credits by card on your account page: $50, $200 (+$20 free) or $500 (+$100 free). You can turn on automatic top-up when the balance runs low, and see every movement with GET /v1/ledger. We email you when your balance gets low. See the API terms.
Questions or a bigger volume: hello@spamlyze.com.