{
  "@context": "https://schema.org",
  "@type": "WebPage",
  "name": "Protecting APIs from Bot Abuse | Edge Academy",
  "headline": "Protecting APIs from Bot Abuse | Edge Academy",
  "description": "Attach Edge Shield tokens to API requests, verify them with siteverify or locally against the JWKS endpoint, and identify signed AI agents with agentverify.",
  "url": "https://edge.network/academy/protecting-apis-from-bots",
  "image": "https://edge.network/og/academy__protecting-apis-from-bots.png",
  "inLanguage": "en",
  "publisher": {
    "@type": "Organization",
    "name": "Edge Network",
    "url": "https://edge.network",
    "logo": "https://edge.network/favicon.svg"
  },
  "isPartOf": {
    "@type": "WebSite",
    "name": "Edge Network",
    "url": "https://edge.network"
  },
  "breadcrumb": {
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://edge.network"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "Academy",
        "item": "https://edge.network/academy"
      },
      {
        "@type": "ListItem",
        "position": 3,
        "name": "Protecting apis from bots",
        "item": "https://edge.network/academy/protecting-apis-from-bots"
      }
    ]
  },
  "section": "academy",
  "articleBody": "Security Forms are the front door; APIs are every other door # \n\n Once your web app moves logic into fetch calls (search, autocomplete, pricing lookups, content feeds), those endpoints become the cheapest way to abuse your service. A scraper doesn’t render your page or fill in your form; it calls /api/search ten thousand times.\n\n Rate limiting helps but is blunt: attackers rotate IPs, and your heaviest legitimate users look exactly like abusers by request count alone. What’s missing is the question Shield answers on forms, is a human driving this? , attached to each request.\n\n 1. Attach a Shield token to API calls # \n\n The widget’s JavaScript API can produce tokens on demand as well as on form submit. Request one and send it in a header your server checks:\n\n JavaScript Copy // Render an invisible widget once: it verifies in the background \n // and keeps its token fresh automatically \n const widgetId = edgeShield. render (document. getElementById ( 'shield' ), { \n sitekey: 'es_your_sitekey' , \n mode: 'invisible' , \n }) \n \n // Attach the current token to each protected request \n await fetch ( '/api/search' , { \n method: 'POST' , \n headers: { \n 'Content-Type' : 'application/json' , \n 'X-Edge-Shield-Token' : edgeShield. getResponse (widgetId), \n }, \n body: JSON . stringify ({ query }), \n }) \n The verification runs invisibly in a background thread, so your users never see anything. See the JS API docs for the full programmatic interface.\n\n 2. Pick the right verification path # \n\n For forms, one call to siteverify per submission is nothing. For an API taking hundreds of requests a second, a network round trip per request is real latency. Shield gives you a second option: tokens are Ed25519-signed JWTs , and the public key is published at a standard JWKS endpoint. Your server can verify them locally, with zero network calls.\n\n JavaScript Copy import { createRemoteJWKSet, jwtVerify } from 'jose' \n \n const JWKS = createRemoteJWKSet ( \n new URL ( 'https://shield.edge.network/.well-known/jwks.json' ) \n ) \n \n // Zero network calls per request: the key set is cached \n async function verifyOffline ( token ) { \n const { payload } = await jwtVerify (token, JWKS , { \n issuer: 'edge-shield' , \n subject: process.env. SHIELD_SITEKEY , // REQUIRED: binds tokens to YOUR widget \n }) \n // Narrow the replay window: reject tokens older than 60s \n if (Date. now () / 1000 - payload.iat > 60 ) throw new Error ( 'stale token' ) \n return payload.score // 1–100 \n } \n The trade-off: offline verification cannot enforce single-use . The ledger of spent tokens lives on Shield’s servers, so a token verified offline stays valid for its full five-minute lifetime, however many times it’s presented. The iat age check above narrows that window, but the rule of thumb is:\n\n Offline: for high-throughput, lower-stakes endpoints (search, previews, read APIs) where latency matters more than strict single-use.\n\n siteverify : for anything a replayed token shouldn’t touch, such as signups, payments and mutations. It’s the only path with a strict single-use guarantee.\n\n Full details, including key rotation behaviour, are in the offline verification docs .\n\n 3. Don’t lock out the automation you want # \n\n Some clients hitting your API without a widget token are exactly who you want: AI agents shopping or researching on behalf of real customers. Agents that sign their requests with Web Bot Auth can be identified without any widget at all. Forward the signature headers to agentverify :\n\n JavaScript Copy // A signed agent request hit your API directly, with no widget involved. \n // Forward its signature headers and Shield verifies the identity. \n const res = await fetch ( 'https://shield.edge.network/agentverify' , { \n method: 'POST' , \n headers: { 'Content-Type' : 'application/json' }, \n body: JSON . stringify ({ \n secret: process.env. SHIELD_SECRET , \n authority: req.headers.host, \n headers: { \n 'signature-agent' : req.headers[ 'signature-agent' ], \n 'signature-input' : req.headers[ 'signature-input' ], \n 'signature' : req.headers[ 'signature' ], \n }, \n }), \n }) \n const { success , agent } = await res. json () \n if (success && agent.verified) allowFor (agent.domain) \n So the full policy for an API endpoint becomes:\n\n Valid Shield token with a decent score → human, allow.\n\n Valid Web Bot Auth signature → known agent, allow (with its own rate tier if you like).\n\n Neither → the automation that refused to identify itself, which is the traffic you wanted to stop.\n\n Verified AI agents with Web Bot Auth covers this in depth.\n\n Next steps\n\n Docs Offline verification docs \n Academy Verified AI agents \n Coming soon Edge Accreditation\n\n Become a certified Edge practitioner: a structured programme across the platform, with a verifiable certificate. Sign up for updates.\n\n Email address Sign up for updates Learn more about accreditation Keep learning\n\n Security 3 min read \n\n Bot protection with Edge Shield\n\n Stop form spam, credential stuffing and fake signups without ever showing a human a puzzle. Two lines on the page, one HTTP call on the server. Free forever.\n\n Security 4 min read \n\n Verified AI agents with Web Bot Auth\n\n The bot problem changed. Some automation is your customers&#x27; AI agents trying to buy from you. Security now means telling declared automation apart from anonymous automation and treating each accordingly.\n\n Security 4 min read \n\n Securing login & signup flows\n\n Credential stuffing and fake account waves are the two most common attacks on any site with a login form. Here&#x27;s how to stop both without adding friction for the humans you actually want.",
  "headings": [
    {
      "level": 1,
      "text": "Protecting APIs from bot abuse"
    },
    {
      "level": 2,
      "text": "Next steps"
    },
    {
      "level": 2,
      "text": "Edge Accreditation"
    },
    {
      "level": 2,
      "text": "Keep learning"
    },
    {
      "level": 3,
      "text": "Bot protection with Edge Shield"
    },
    {
      "level": 3,
      "text": "Verified AI agents with Web Bot Auth"
    },
    {
      "level": 3,
      "text": "Securing login &amp; signup flows"
    }
  ],
  "relatedLinks": [
    {
      "@type": "WebPage",
      "name": "Network",
      "url": "https://edge.network/network"
    },
    {
      "@type": "WebPage",
      "name": "Pricing",
      "url": "https://edge.network/pricing"
    },
    {
      "@type": "WebPage",
      "name": "Docs",
      "url": "https://edge.network/docs"
    },
    {
      "@type": "WebPage",
      "name": "Sign in",
      "url": "https://edge.network/console/access"
    },
    {
      "@type": "WebPage",
      "name": "Shield",
      "url": "https://edge.network/shield"
    },
    {
      "@type": "WebPage",
      "name": "JS API docs",
      "url": "https://edge.network/docs/shield/js-api"
    },
    {
      "@type": "WebPage",
      "name": "offline verification docs",
      "url": "https://edge.network/docs/shield/offline-verification"
    },
    {
      "@type": "WebPage",
      "name": "Verified AI agents with Web Bot Auth",
      "url": "https://edge.network/academy/verified-ai-agents"
    },
    {
      "@type": "WebPage",
      "name": "Learn more about accreditation",
      "url": "https://edge.network/accreditation"
    },
    {
      "@type": "WebPage",
      "name": "CDN",
      "url": "https://edge.network/cdn"
    },
    {
      "@type": "WebPage",
      "name": "Compute",
      "url": "https://edge.network/compute"
    },
    {
      "@type": "WebPage",
      "name": "Storage",
      "url": "https://edge.network/storage"
    },
    {
      "@type": "WebPage",
      "name": "DNS",
      "url": "https://edge.network/dns"
    },
    {
      "@type": "WebPage",
      "name": "Assist",
      "url": "https://edge.network/assist"
    },
    {
      "@type": "WebPage",
      "name": "Pulse",
      "url": "https://edge.network/pulse"
    },
    {
      "@type": "WebPage",
      "name": "Agent API &amp; MCP",
      "url": "https://edge.network/docs/agent"
    },
    {
      "@type": "WebPage",
      "name": "Academy",
      "url": "https://edge.network/academy"
    },
    {
      "@type": "WebPage",
      "name": "Case Studies",
      "url": "https://edge.network/case-studies"
    },
    {
      "@type": "WebPage",
      "name": "Releases",
      "url": "https://edge.network/releases"
    },
    {
      "@type": "WebPage",
      "name": "Roadmap",
      "url": "https://edge.network/roadmap"
    },
    {
      "@type": "WebPage",
      "name": "Status",
      "url": "https://edge.network/status"
    },
    {
      "@type": "WebPage",
      "name": "About",
      "url": "https://edge.network/about"
    },
    {
      "@type": "WebPage",
      "name": "Environment",
      "url": "https://edge.network/environment"
    },
    {
      "@type": "WebPage",
      "name": "Latest",
      "url": "https://edge.network/latest"
    },
    {
      "@type": "WebPage",
      "name": "Blog",
      "url": "https://edge.network/blog"
    },
    {
      "@type": "WebPage",
      "name": "Careers",
      "url": "https://edge.network/careers"
    },
    {
      "@type": "WebPage",
      "name": "Contact",
      "url": "https://edge.network/contact"
    },
    {
      "@type": "WebPage",
      "name": "Terms of Service",
      "url": "https://edge.network/terms"
    },
    {
      "@type": "WebPage",
      "name": "Privacy Policy",
      "url": "https://edge.network/privacy"
    },
    {
      "@type": "WebPage",
      "name": "Security",
      "url": "https://edge.network/security"
    }
  ],
  "alternateFormats": [
    {
      "@type": "MediaObject",
      "contentType": "text/html",
      "url": "https://edge.network/academy/protecting-apis-from-bots",
      "name": "HTML version"
    }
  ],
  "dateModified": "2026-11-28T22:16:38.571Z"
}