import urllib.request import json token = "LfObAyuwjRs_X7Emp-kNl4AFjU1FX0XdLqVwgX0p" zone_id = "f019fee4c5b58c48e4493b931f800ff5" # makeanyplace.com print("--- Page Rules ---") req = urllib.request.Request( f'https://api.cloudflare.com/client/v4/zones/{zone_id}/pagerules', headers={'Authorization': f'Bearer {token}', 'Content-Type': 'application/json'} ) try: resp = json.loads(urllib.request.urlopen(req).read()) print(json.dumps(resp, indent=2)) except Exception as e: print("Error:", e) print("\n--- Rulesets ---") req2 = urllib.request.Request( f'https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets', headers={'Authorization': f'Bearer {token}', 'Content-Type': 'application/json'} ) try: resp2 = json.loads(urllib.request.urlopen(req2).read()) print(json.dumps(resp2, indent=2)) except Exception as e: print("Error:", e)