Skip to content

Instantly share code, notes, and snippets.

View brianhaddock's full-sized avatar

Brian Haddock brianhaddock

View GitHub Profile
@diije
diije / verify.py
Last active June 15, 2024 01:13
Verify a list of Googlebot IPs in Python
import ipaddress
import requests
def verify_googlebot_ips(
list_of_ips,
google_ips_list_url="https://developers.google.com/static/search/apis/ipranges/googlebot.json",
):
"""Checks if each IP address in given list is in Google's official list of IP ranges.
Args:
- list_of_ips: list of ipv4 or ipv6 to check,