web hits traffic in python

main.py
import requests

url = 'https://www.example.com'
response = requests.get(url)

if response.status_code == 200:
    print(f"Number of hits traffic: {response.headers.get('X-RateLimit-Limit')}")
else:
    print("Error fetching the URL")
235 chars
10 lines

related categories

gistlibby LogSnag