fix(api): add User-Agent header to APIs.guru fetch to fix CI 403

APIs.guru CDN blocks requests with Python's default User-Agent
(Python-urllib/3.x) from datacenter IPs, causing the weekly
Generate API Providers workflow to fail with HTTP 403.
This commit is contained in:
2026-03-22 20:03:09 -07:00
parent f22f249fbd
commit db9245595d
@@ -251,7 +251,8 @@ def fetch_oapis_slop(name: str) -> dict | None:
def fetch_apis_guru() -> dict:
"""Fetch API list from APIs.guru."""
url = "https://api.apis.guru/v2/list.json"
with urllib.request.urlopen(url, timeout=60) as response:
req = urllib.request.Request(url, headers={"User-Agent": "hanzo-tools-api/0.2"})
with urllib.request.urlopen(req, timeout=60) as response:
return json.loads(response.read().decode())