Google 官方提供 JSON 接口 用于实时获取 Google 搜索爬虫使用的 IP

社区话题 Linux/macOS 与自动化运维 Fail2ban 搜索引擎白名单分享涵盖 Google/Bing/Baidu等主流搜索引擎 Google 官方提供 JSON 接口 用于实时获取 Google 搜索爬虫使用的 IP

#942

追光
管理员

Google 官方提供 JSON 接口 用于实时获取 Google 搜索爬虫使用的 IP:https://developers.google.com/search/apis/ipranges/googlebot.json,想动态获取 GoogleBot、BingBot 这类爬虫(bot)所使用的 IP 段 / IP 列表:

#!/usr/bin/env bash
curl -s https://developers.google.com/search/apis/ipranges/googlebot.json \
 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+' > googlebot_ip.txt
echo "GoogleBot IP ranges updated: googlebot_ip.txt"