/**
* Bot Detect (IP) API
* GET https://api.globus.studio/v2/bot_ip?ip=66.249.66.1&format=json
* Response (json): { bot_detect: true|false, bot_name: "google"|"undefined" }
* Response (plain): bot name or "undefined"
*/
async function checkBotIp(ip) {
const res = await fetch(`https://api.globus.studio/v2/bot_ip?ip=${encodeURIComponent(ip)}&format=json`);
return res.json();
}
// Googlebot IP
checkBotIp('66.249.66.1').then(d => console.log(d.bot_detect, d.bot_name));
// Regular IP
checkBotIp('8.8.8.8').then(d => console.log(d.bot_detect, d.bot_name));