Public webhook endpoint for storing AI bot visit data from tracking scripts embedded in AI-optimized sites.
No authentication required - this is a public webhook similar to the Stripe webhook.
How It Works
AI-optimized sites include a tracking script that runs on page load
The script detects AI bots via user-agent patterns
When an AI bot is detected, the script sends visit data to this endpoint
We record the visit and which AI platform made the request
Platform Detection Patterns ChatGPT gptbot, chatgpt-user, oai-searchbot Claude claudebot, claude-web, anthropic Gemini google-extended, gemini Perplexity perplexitybot Copilot bingbot, bingpreview, copilot DeepSeek deepseekbot Grok xai-bot, grok Google AI googlebot, googleother
Request Body
Business/organization identifier
Full URL of the page visited
Type of page: website, blog_post, or ai_site
User-Agent header from the request
IP address of the visitor
Referrer URL if available
Response
"success", "ignored", or "error"
ID of the detected AI platform (e.g., chatgpt, claude)
Display name of the AI platform (e.g., ChatGPT, Claude)
Human-readable status message
curl -X POST https://searchcompany-main.up.railway.app/api/ai-recommendation-store \
-H "Content-Type: application/json" \
-d '{
"business_id": "nike",
"page_url": "https://nike.searchcompany.co/",
"page_type": "ai_site",
"page_title": "Nike - AI Profile",
"user_agent": "Mozilla/5.0 (compatible; GPTBot/1.0; +https://openai.com/gptbot)"
}'
Success
Ignored (not an AI bot)
{
"status" : "success" ,
"platform_id" : "chatgpt" ,
"platform_name" : "ChatGPT" ,
"message" : "Visit from ChatGPT recorded"
}
Tracking Script
The tracking script is automatically included in AI-optimized sites generated by The Search Company:
( function () {
var ua = navigator . userAgent . toLowerCase ();
var aiPatterns = [
"gptbot" ,
"chatgpt" ,
"openai" ,
"claudebot" ,
"anthropic" ,
"gemini" ,
"google-extended" ,
"perplexitybot" ,
"bingbot" ,
"copilot" ,
"deepseek" ,
"grok" ,
"xai" ,
"googlebot" ,
];
var isAI = aiPatterns . some ( function ( p ) {
return ua . indexOf ( p ) !== - 1 ;
});
if ( isAI || ua . indexOf ( "bot" ) !== - 1 ) {
fetch (
"https://searchcompany-main.up.railway.app/api/ai-recommendation-store" ,
{
method: "POST" ,
headers: { "Content-Type" : "application/json" },
body: JSON . stringify ({
business_id: "YOUR_BUSINESS_ID" ,
page_url: window . location . href ,
page_type: "ai_site" ,
page_title: document . title ,
user_agent: navigator . userAgent ,
referrer: document . referrer || null ,
}),
}
). catch ( function () {});
}
})();