Integrations and API
Connect a Bunny CDN site to AI Crawlers
Record the AI bot requests to a site on Bunny CDN with a small Edge Script on your own Pull Zone, then check it works with the test link.
5 minute read · Last reviewed: November 17, 2026
This guide connects a site served through Bunny CDN to AI Crawlers, so you can see which AI bots read it. You add one small script to your own Pull Zone in Bunny. It passes every request through unchanged and sends us a short record of the bot requests only. Read it all, including the cost, before you start.
Before you start
- You need: your site served through a Bunny CDN Pull Zone, and access to that Bunny.net account.
- Time: about 10 minutes.
- Where: every step after the key is done in your Bunny.net dashboard.
- Use one connection per site. If this site is already connected another way, do not also set up this one, or each bot visit is counted twice.
- If someone else manages your Bunny account, choose Copy steps for a teammate on the setup screen, and send them
bunny-edge-script.jsover a private channel such as a password manager, never email or chat. The file holds your site key.
What it costs
We don't charge for the connection. Bunny bills the script as Edge Scripting usage: $0.20 per million requests and $0.02 per 1,000 seconds of CPU time. Bunny's account-wide $1 monthly minimum applies, and there is no free tier for scripting.
Every request to the Pull Zone runs the script, visitors included, not only bots. A busy site pays for all of its requests. Check your usage in Bunny after a day.
What is sent
The script looks at each request's user agent and keeps bot-like requests only:
- Only requests whose name looks like a bot's
- Address, method, status, time, bot name, request id, linking site
- Never IP addresses, cookies or query strings
Requests from people pass straight through and nothing about them is kept or sent. Paths are sent as your Pull Zone received them. If a path can carry something private, such as a password reset link, do not attach the script to that Pull Zone.
Bots that Bunny Shield or Bunny CDN blocks before the script runs don't show in AI Crawlers.
1. Choose Bunny CDN and create your key
- Open AI Crawlers in the sidebar and pick your brand in the header. If the page says Set your site URL first, add your site address in Settings.
- Under "How is your site served?", choose Bunny CDN.
- Choose Create key and start setup. The key window offers
bunny-edge-script.jswith your key already inside. Choose Copy code, or download the file. Save it now: we can't show the key again.
2. Create the Edge Script
- In your Bunny.net dashboard, under Edge Platform, open Scripting and choose Add Script.
- Choose Deploy With bunny.net (the "Deploy and edit on Bunny.net" option).
- Name the script
aipeekaboo-crawlers, set Type to Middleware and keep the Default middleware template. - Leave Pull Zone empty for now. You connect it under "Attach to your Pull Zone" below, once your code is in.
- Choose Add Script.
3. Paste and publish
A new script comes with starter code. Select all of it, paste your bunny-edge-script.js over it, then choose Save and Publish.
The file needs no settings: your key and our address are inside it.
4. Attach to your Pull Zone
On the script's page, open Connected pull zones, choose Connect Pull Zone, and pick the Pull Zone that serves your site.
A Pull Zone links one Edge Script at a time. Linking this one replaces any Middleware script already on that Pull Zone, without a warning from Bunny. If the Pull Zone already runs a script of yours, stop and write to team@aipeekaboo.com first.
5. Enable pre-cache execution
In the Pull Zone's settings, under General and Origin, switch Run script before cache on.
6. Check it works
- Wait a minute after you created the key. A new key takes about a minute to start working.
- Open the test link from your setup screen. It is your site's address followed by
/__aipeekaboo-check. The script answers it itself and sends us one test record, which is never counted as a visit. - The page should say
sent. Then press Check now in AI Crawlers.
If the page says something else, this is what each word means:
sent: it works. We received the test.key_refused: the key is wrong, was replaced, or is not active yet. Wait a minute and reopen the link.not_configured: the script has no usable key or address, and the page names which. Fix or remove theAIPEEKABOO_environment variable it names, or paste yourbunny-edge-script.jsagain, then Save and Publish.not_accepted: we received it but did not keep it. Check that the site's address matches the one in AI Peekaboo and that tracking is on.rate_limitedorsend_failed: try again in a minute. Ifsend_failedrepeats, look in the script's log forredirectedorrejected.
If the link opens your own site instead of a short check page, the request did not reach the script. Go back to steps 4 and 5.
AI Crawlers explains what happens once real bots arrive.
Nothing arriving?
- Run script before cache must be on, under the Pull Zone's General and Origin settings.
- The script must be connected to the Pull Zone that serves your site. Its Connected pull zones page lists it.
- Your
bunny-edge-script.jsmust be pasted, then Save and Publish. - A new key takes about a minute.
- The test link must say
sent. - The script should have no old
AIPEEKABOO_KEYunder Environment (Variables or Secrets). It overrides the key in the file.
The script also writes to its own log: open the script in Bunny and choose Logs. It shares most of its words with the test link. Among the words above, two are only in the log: delivering when we accepted the first send (a test link that says sent writes it too) and redirected when the address in use is wrong. sent and not_accepted are only ever on the test link. After key_refused the script pauses for 5 minutes before it sends bot visits again. The test link is never paused.
Changing the key
Lost your key, or think it leaked? Choose New key on the AI Crawlers page. The old key stops working within a minute.
Your script sends nothing we accept until you paste the new bunny-edge-script.js and choose Save and Publish. Bot requests in between are not recorded.
To stop it
In Bunny, open the Pull Zone and go to General, then Origin. In the Middleware card, use the X beside the script ("Remove Script"). To remove it for good, open the script's menu and choose Delete Script.
Disconnecting in AI Crawlers revokes your key, but it does not stop the script. The script keeps running on every request to your Pull Zone, and Bunny keeps billing it, until you remove it in Bunny.
Need help?
Not sure what a screen means, or something looks wrong? Stop there and write to team@aipeekaboo.com or see Contact support. Tell us which step you were on, and include the word the test link shows.
