Bot detection API
Customers in, bots out
Bot detection and bot management in one API call: before a login, a sign-up, a checkout or any page bots go after, your server asks Bot Protection about the visitor and gets back a class, a score and an action. No proxy in front of your site, no puzzles for your customers.
14-day free trial · plans from $29 a month
# Ask before the protected action curl -X POST https://eu.korzen.dev/v1/decide \ -H "Authorization: Bearer $KORZEN_API_KEY" \ -d '{ "ip": "203.0.113.10", "ip_from": "peer", "user_agent": "Mozilla/5.0 …", "token": "<_kz cookie>", "path": "/checkout" }'
// Ask before the protected action; the API: https://eu.korzen.dev // The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency const d = await fetch(API + "/v1/decide", { method: "POST", headers: { Authorization: `Bearer ${KEY}` }, body: JSON.stringify({ ip, ip_from: "peer", user_agent, token, path }), signal: AbortSignal.timeout(200), }).then((r) => r.json()).catch(() => null); if (d?.action === "block") return res.status(403).end();
# Ask before the protected action; the API: https://eu.korzen.dev # The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency try: d = requests.post(API + "/v1/decide", headers={"Authorization": f"Bearer {KEY}"}, json={"ip": ip, "ip_from": "peer", "user_agent": ua, "token": token}, timeout=0.2).json() except requests.RequestException: d = {} if d.get("action") == "block": abort(403)
// Ask before the protected action; the API: https://eu.korzen.dev // The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency c := &http.Client{Timeout: 200 * time.Millisecond} r, _ := http.NewRequest("POST", api+"/v1/decide", body) r.Header.Set("Authorization", "Bearer "+key) var d struct{ Action string } if res, err := c.Do(r); err == nil { json.NewDecoder(res.Body).Decode(&d) res.Body.Close() } if d.Action == "block" { http.Error(w, "try again later", 403) return }
// Ask before the protected action; the API: https://eu.korzen.dev // The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency var req = HttpRequest .newBuilder(URI.create(API + "/v1/decide")) .header("Authorization", "Bearer " + KEY) .timeout(Duration.ofMillis(200)) .POST(BodyPublishers.ofString(json)).build(); String act = ""; try { var res = http.send(req, BodyHandlers.ofString()); act = mapper.readTree(res.body()) .path("action").asText(); } catch (Exception e) { /* no answer in time */ } if (act.equals("block")) { response.sendError(403); return; }
// Ask before the protected action; the API: https://eu.korzen.dev
// The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency
$ch = curl_init(API . '/v1/decide');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($visitor),
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . KEY],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT_MS => 200,
]);
$d = json_decode(curl_exec($ch) ?: '{}', true);
if (($d['action'] ?? '') === 'block') {
http_response_code(403);
exit;
}
// Ask before the protected action; the API: https://eu.korzen.dev // http: an HttpClient with "Authorization: Bearer KEY" // The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency var act = ""; try { using var cts = new CancellationTokenSource(200); var res = await http.PostAsJsonAsync( Api + "/v1/decide", visitor, cts.Token); var d = await res.Content .ReadFromJsonAsync<JsonElement>(cts.Token); act = d.GetProperty("action").GetString(); } catch { /* no answer in time */ } if (act == "block") return Results.StatusCode(403);
# Ask before the protected action; the API: https://eu.korzen.dev # The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency uri = URI(API + "/v1/decide") d = begin Net::HTTP.start(uri.host, uri.port, use_ssl: true, open_timeout: 0.2, read_timeout: 0.2, write_timeout: 0.2) do |http| res = http.post(uri.path, visitor.to_json, "Authorization" => "Bearer #{KEY}", "Content-Type" => "application/json") res.is_a?(Net::HTTPOK) ? JSON.parse(res.body) : {} end rescue StandardError {} end head :forbidden if d["action"] == "block"
// Ask before the protected action; the API: https://eu.korzen.dev // http: one reqwest::Client for the process, with .timeout(Duration::from_millis(200)) // The timeout for your server's region: https://korzen.dev/bot-protection/docs/server-call#latency let d: Option<Value> = async { let res = http.post(format!("{API}/v1/decide")) .bearer_auth(KEY).json(&visitor) .send().await.ok()?; if res.status() != StatusCode::OK { return None; } res.json().await.ok() }.await; if d.as_ref().and_then(|d| d["action"].as_str()) == Some("block") { return StatusCode::FORBIDDEN.into_response(); }
Or follow the Django and Flask guide
Or follow the Spring Boot guide
200 OK RESPONSE
{
"request_id": "AQEAmJ3…",
"decided_by": "bot_engine",
"class": "bot",
"bot_score": 96,
"action": "block",
"mode": "block",
"token_required": false
}Measured, not promised
Every action bots go after
Malicious bots and automated attacks go after one step of any site they hurt. Your server asks Bot Protection at that step, whatever your industry. It is application security for the steps that cost money, with no security team needed.
-
Sign-ups
Fake accounts and free-trial abuse Scripts that open accounts by the hundred for credits, promotions, trials or spam. Read → -
Logins
Credential stuffing and account takeover Leaked email and password pairs replayed against your login until some work. Read → -
Checkouts
Card testing Small payments with stolen cards, to find which still work before they are sold. Read → -
Queues and drops
Bots at the front of the line Scripts that join a queue or a limited drop many times over and take the stock before people load the page. Read → -
Resale
Scalping for resale Seats, sneakers and limited stock bought by automation and listed again at a markup. Read → -
Forms
Spam and fake submissions Contact, comment, review and lead forms filled by scripts, burying the real ones. Read → -
APIs
Scripted calls to your API Clients that skip your pages and call the endpoints behind them: bulk queries, farmed free usage, data pulled out. Read → -
Content and prices
Scraping Prices, content and listings taken by automation, faster than any person. Read →
The dashboard
See every decision, and why
The dashboard your team opens when traffic spikes: what Bot Protection answered, hour by hour, and the reasons behind each answer.
Every answer, with its reasons
The latest decisions, newest first, refreshed every few seconds. Filter by class, path, country, reason or time. Hover a reason to read what it means.
Or ask your AI assistant: Claude, Codex or Cursor read the same views through a read-only MCP server
How it works
Two pieces of code. No change to your traffic
Add the tag
A small script in your pages sends what the browser shows about itself straight to Bot Protection and keeps a signed token in a first-party cookie.
<script src="…/v1/tag.js" data-site-key="kz_sk_…" async></script>
Ask before the action
Before a login, a sign-up, a checkout or any page bots go after, your server sends the request's IP, User-Agent and token, with a short timeout.
POST /v1/decide {"ip": "…", "ip_from": "peer", "user_agent": "…", "token": "…", "path": "/checkout"}
Apply the action
Each answer says allow or block. You start in monitor mode, where it is always allow, and turn on block mode when you trust it.
if d.Action == "block" { return http.StatusForbidden }
Or let your coding agent do it
Paste one prompt into Claude Code, Cursor or Codex and it does the integration; you only review the diff. No DNS, domain list or rules to tune, and everything starts in monitor mode: nobody is blocked until you trust the numbers.
Guides for Next.js, Express, Django, Rails, Laravel, Spring Boot, ASP.NET Core, Cloudflare Workers and more, in the docs.
Why it catches what edge tools miss
Judged per action, with evidence across requests
IP lists, JA4 fingerprints, rate limits and CAPTCHA tokens judge each request alone. Bot Protection judges the action your server asks about, with what the visitor did before it.
A token earned on a real visit
The tag earns a token when a visitor's browser runs your page. An action can require one, spent once: a request that never ran your page cannot take it.
How the input came
Before the action, the tag reads whether the input on the page came from a person's hands, together with what the visitor did before it.
Your site's audience, learned
What your own traffic taught: your domains, the browsers your visitors run. Nothing to configure, and nothing shared with any other site.
No proxy, one prompt to set up
Your server asks through an SDK for Node, Python, Go, Java, PHP, .NET or Rust, the WordPress plugin, a Cloudflare Worker, or one HTTP call from anything else. One prompt to your coding agent writes the integration, in monitor mode first. Set it up with AI
Every decision explained
Each answer names the kinds of evidence. The dashboard shows each decision with its bot score, its class and its kinds of evidence, and you choose what uncertain visitors get.
Alongside your edge, not instead of it
Keep your CDN, your WAF and your rate limits. Bot Protection adds the per-action judgement they cannot make, at the step that costs you.
What it does not have yet: a global network's view across thousands of sites, and attestation from its own mobile SDK. Your server can report a platform attestation it checked, such as a passkey, App Attest or Play Integrity, as evidence.
Why an API
Protection that lives in your code
Bot defense, bot mitigation, anti-bot, a fraud detection API for automated abuse: the names differ and the job is the same. Here it is one call from your code, not a puzzle on every form or a proxy in front of your site.
| Bot Protection | CAPTCHA | Proxy in front of your site | |
|---|---|---|---|
| Your visitors meet a check | Only a visitor judged a bot, for a few seconds | Every time | Sometimes |
| Your traffic goes through it | No | No, but every form waits on it | All of it |
| Setting it up | One prompt to your coding agent | A widget on every form | Your DNS pointed at it |
| Tells you why | The class, the score and the kind of evidence | Pass or fail | A score |
| Where you decide | In your code | In their widget | In their rules |
The answer
A class you can act on, not a number to guess at
A person, with two kinds of proof and no evidence of a bot.
allowNot enough evidence either way. Most first visits land here.
allowAutomation, from what the client does.
blockWhat Bot Protection reads
Evidence a bot cannot fake for long
Consistency
Whether what the browser says about itself holds together, on the page and in the request.
Real input
Whether a person is at the page: the input it saw before the action.
The network
Where each request comes from: the network, the country, the connection.
Farms
The same few devices behind many accounts, networks and sessions, seen across your traffic.
Behaviour over time
How a visitor moves through your site, request after request.
Protection in embeds
Your widget, protected on your customers' sites
A booking form, a shop, a ticket box or a chat your customers embed on their own sites: Bot Protection works inside it, in the frame you serve.
One account, one domain
Serve the widget in a frame on your domain and put the tag in it. Whatever site frames it, your plan counts one domain: yours.
Nothing for them to install
The sites that embed your widget add no script and no key. The tag comes with your frame.
A token without third-party cookies
Where browsers keep a frame's cookies apart or refuse them, the tag still hands your page its token, and your page sends it to your server with the request.
How to set it up, with the code: widgets on other sites.
Questions
Before you ask
Will real customers be blocked?
Being on a VPN, a mobile network or a shared office connection never makes a person a bot on its own. What you know of a returning customer, such as a card they paid with before, counts as proof of a person.
Does Bot Protection store personal data?
Identifiers are hashed with a key per customer that rotates every day, so they cannot be joined across customers or days. Behaviour is forgotten after ten minutes; only counts and the latest decisions are kept for your dashboard.
Does a blocked bot still see my site?
Yes. Bot Protection judges the actions your server asks about, such as a sign-up, a login or a checkout, not page loads. A bot still loads your pages in block mode; what your server refuses is the action.
Your site, without the bots
Create an account, copy two snippets, and watch the decisions arrive.