API reference

Public API

Send requests to https://api.spamapi.de under the base path /api/v1. Bodies are JSON with Content-Type: application/json, up to 2 MiB. Endpoints marked with a key need your API key in the X-API-Key header; the quickstart shows how to create one. Errors, rate limits and monthly checks are described in Errors and limits. The OpenAPI specification has the complete schemas.

Method Path Key Description
POST /check Yes Check content for spam
POST /submit-spam Yes Report spam that got through
POST /submit-ham Yes Report legitimate content that was flagged
GET /usage Yes This month's checks
GET /sites Yes Sites that used your keys
POST /verify-key No Validate a key
GET /pricing No Plans and prices

The WordPress plugin also uses the shared-model endpoints under /api/v1/training/; see the OpenAPI specification and the WordPress guide.

Check content

POST /api/v1/check classifies one comment or form submission. The quickstart has a complete request and response.

Check request fields

Field Description
blog Required. Your site's URL, up to 2,048 bytes. Site statistics are grouped by it.
user_ip Required. The visitor's IPv4 or IPv6 address.
user_agent The visitor's browser user agent.
referrer The page the visitor came from.
permalink The page the submission was made on.
comment_type The kind of submission, such as comment, contact-form or signup.
comment_author The name the visitor entered, up to 255 bytes.
comment_author_email The email address the visitor entered, up to 255 bytes.
comment_author_url The website the visitor entered.
comment_content The text of the comment or message.
blog_lang Your site's language, such as en or de_DE.
honeypot_field_value The value of a hidden form field that people leave empty.
is_test, user_role Force a ham result; see test mode.
installation_id Used by the WordPress plugin. Omit it.
api_key Optional. If present, it must be the key in the X-API-Key header.
comment_date_gmt, blog_charset, honeypot_field_name, recheck_reason Accepted; currently not used.

Send the fields you have. More context gives SpamAPI more to go on.

Check response fields

Field Description
is_spam true if SpamAPI considers the submission spam.
score From 0 (ham) to 1 (spam).
recommendation allow, review or discard, derived from the score.
request_id Identifies the request; also in the X-Request-ID and X-SpamAPI-Request-ID headers.
prediction_ref Reference to the stored check. Absent for test values.
reasons Optional short notes about the result, for your logs. Their wording can change; don't build logic on them.
statistical Optional diagnostics from SpamAPI's shared comment model, for information only.

A successful check also returns the X-Usage-Limit, X-Usage-Used and X-Usage-Remaining headers, and X-SpamAPI-Pro-Tip with the recommendation.

Report mistakes

POST /api/v1/submit-spam reports spam that got through; POST /api/v1/submit-ham reports legitimate content that was flagged. Both take blog and user_ip (required), user_agent, comment_type, comment_author, comment_author_email, comment_content and optionally api_key, with the same meaning as for checks. Reports don't use checks and are counted in the dashboard's usage history. Both return HTTP 200:

{"status": "ok"}

Monthly usage

GET /api/v1/usage returns this month's checks. It doesn't use one.

{
  "reserved": 1,
  "remaining": 9987,
  "limit": 10000,
  "used": 12,
  "percentage": "0.12",
  "resets_at": "2026-12-01T00:00:00Z",
  "throttled": false
}
  • limit: checks included in your plan this month; 0 for unlimited plans.
  • used: completed checks this month.
  • reserved: checks in progress.
  • remaining: checks left after used and reserved; 0 for unlimited plans.
  • percentage: used as a percentage of limit, as a decimal string.
  • resets_at: when the next month's checks start, in UTC.
  • throttled: true once the checks are used up; checks then get 429.

A paid plan's quota applies until its subscription ends, including the rest of a paid period after cancellation; the account then uses the Free quota.

Sites

GET /api/v1/sites lists the sites (blog values) that used your account's keys, most recently seen first.

curl "https://api.spamapi.de/api/v1/sites?limit=50&offset=0" \
  -H "X-API-Key: $SPAMAPI_KEY"
{
  "sites": [
    {
      "site": "https://example.com",
      "api_calls": 12,
      "spam": 2,
      "ham": 10,
      "missed_spam": 0,
      "false_positives": 0,
      "first_seen": "2026-11-02T09:15:00Z",
      "last_seen": "2026-11-04T16:40:12Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

limit defaults to 50 and is capped at 100. missed_spam and false_positives are currently always 0. The dashboard's sites endpoint uses its own response schema.

Verify a key

POST /api/v1/verify-key checks a key sent in the body, without the X-API-Key header. The WordPress plugin's Test Connection uses it. It is limited to 10 requests a minute per IP address; to test a key from your own code, GET /api/v1/usage is simpler.

{"api_key": "spa_..."}
{
  "valid": true,
  "plan": "free",
  "usage": {
    "reserved": 0,
    "remaining": 100,
    "limit": 100,
    "used": 0,
    "percentage": "0.00",
    "resets_at": "2026-12-01T00:00:00Z"
  }
}

plan is free, pro, business or enterprise. When SpamAPI's shared comment model accepts contributions, the response also contains training_policy for the WordPress plugin. An unknown, revoked or malformed key, or an account that can't use the API, returns HTTP 200 with:

{"valid": false}

Plans and prices

GET /api/v1/pricing needs no API key. It lists the Free, Pro, Business and Enterprise plans with their monthly check quotas, and for Pro and Business the Stripe price that Checkout charges: unit_amount in the currency's minor unit (cents), currency, the billing interval and Stripe's tax_behavior (inclusive, exclusive, or unspecified, which makes no statement about VAT; Checkout shows the final amount). Enterprise has monthly_checks: null (unlimited under its agreement) and purchase: "contact"; it is never sold through Checkout. quota_period is utc_calendar_month: only metered POST /check requests count, toward the UTC month in which they were admitted, independent of the subscription's billing dates. quota_exceeded is rejected: checks over the quota get HTTP 429 usage_limit_exceeded and are never billed.

{
  "livemode": true,
  "quota_period": "utc_calendar_month",
  "quota_exceeded": "rejected",
  "plans": [
    {"id": "free", "name": "Free", "monthly_checks": 100, "purchase": "signup", "price": null},
    {"id": "pro", "name": "Pro", "monthly_checks": 10000, "purchase": "checkout",
     "price": {"currency": "eur", "unit_amount": 900, "interval": "month", "interval_count": 1, "tax_behavior": "unspecified"}},
    {"id": "business", "name": "Business", "monthly_checks": 100000, "purchase": "checkout",
     "price": {"currency": "eur", "unit_amount": 4900, "interval": "month", "interval_count": 1, "tax_behavior": "unspecified"}},
    {"id": "enterprise", "name": "Enterprise", "monthly_checks": null, "purchase": "contact", "price": null}
  ]
}

Prices are read from Stripe and reused for up to five minutes. If either price cannot be read or is not a fixed recurring amount, the endpoint returns HTTP 503 pricing_unavailable instead of default or outdated prices.

Dashboard and auth APIs

The dashboard at https://app.spamapi.de uses the following endpoints. They authenticate with a dashboard session, not an API key, and aren't meant for integrations; use the public API instead.

Dashboard API

Base path: /dashboard/api

Method Path Description
GET /account Get account
PATCH /account Initiate email change
GET /api-keys List keys
POST /api-keys Create key
DELETE /api-keys/{id} Delete key
GET /usage/summary Usage summary
GET /usage/history Usage history
GET /sites Sites stats
GET /billing/subscription Subscription
POST /billing/checkout Checkout session
POST /billing/portal Billing portal

Authenticate with Authorization: Bearer <session-token>, using the token returned by registration or login. Account responses wrap the current user in user. Changing the account email requires both email and the current password; the response still contains the current email until confirmation.

Creating a key returns HTTP 200 with key (the full credential, shown only once) and api_key (its metadata). Listing keys returns a keys array; deleting a key returns HTTP 204 with no body.

Usage history returns a history array with month, spam_checks, spam_detected, ham_detected, submit_spam, and submit_ham. The lookback defaults to six months and is capped at 24. Subscription details are wrapped in subscription. While a canceled subscription remains active, cancel_at gives its scheduled end and status is unchanged; it is absent otherwise.

Checkout requires plan, success_url, and cancel_url; the billing portal requires return_url. Redirect URLs must use the application's origin (https://app.spamapi.de for the hosted service). Both endpoints return url.

Auth API

Base path: /auth

Method Path Description
POST /register Register
POST /login Login
POST /logout Logout
GET /me Current user
POST /verify Verify email
POST /confirm-email-change Confirm email change
POST /forgot Forgot password
POST /reset Reset password

Registration returns HTTP 201; login returns HTTP 200. Both return user, token, and session. GET /auth/me returns user and session, and logout returns HTTP 204 with no body.

Email verification and email-change confirmation accept token and return user. Forgot-password accepts email and returns HTTP 202 with {"status":"email_sent"}. Reset-password accepts token and new_password and returns the user object directly.

Auth handlers return a JSON error string; their rate limiter and the dashboard session middleware can return plain-text errors.