Handling Verified Bots
Handling Verified Bots
Available in botid@1.5.0 and above
BotID allows you to identify and handle verified bots differently from regular bots. This feature enables you to permit certain trusted bots (like AI assistants) to access your application while blocking others.
Vercel maintains a directory of known and verified bots across the web at bots.fyi
When using checkBotId()
, the response includes fields that help you identify verified bots:
import { checkBotId } from "botid/server";
import { NextResponse } from "next/server";
export async function POST(request: Request) {
const botResult = await checkBotId();
const { isBot, verifiedBotName, isVerifiedBot, verifiedBotCategory } = botResult;
// Check if it's ChatGPT Operator
const isOperator = isVerifiedBot && verifiedBotName === "chatgpt-operator";
if (isBot && !isOperator) {
return Response.json({ error: "Access denied" }, { status: 403 });
}
// ... rest of your handler
return Response.json(botResult);
}
View our directory of verified bot names and categories here.
The checkBotId()
function returns the following fields for verified bots:
isVerifiedBot
: Boolean indicating whether the bot is verifiedverifiedBotName
: String identifying the specific verified botverifiedBotCategory
: String categorizing the type of verified bot
Verified bots are useful when you want to:
- Allow AI assistants to interact with your API while blocking other bots
- Provide different responses or functionality for verified bots
- Track usage by specific verified bot services
- Enable AI-powered features while maintaining security
Last updated on August 14, 2025
Was this helpful?