{
  "id": "python/httpx-httperror-403-forbidden",
  "signature": "httpx.HTTPStatusError: Client error '403 Forbidden' for url 'https://api.example.com/v1/restricted'",
  "signature_zh": "httpx.HTTPStatusError: 对URL 'https://api.example.com/v1/restricted' 的客户端错误 '403 禁止访问'",
  "regex": "httpx\\.HTTPStatusError:\\ Client\\ error\\ '403\\ Forbidden'\\ for\\ url\\ 'https://api\\.example\\.com/v1/restricted'",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The server denies access due to insufficient permissions, such as missing API key or IP whitelisting.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器拒绝访问，因为权限不足，例如缺少API密钥或IP白名单。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Re-sending the request without any authentication headers",
      "why_fails": "The server still requires valid credentials.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a different HTTP method (e.g., POST instead of GET)",
      "why_fails": "The issue is authorization, not method.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Include the required API key in headers",
      "success_rate": 0.95,
      "how": "headers = {'Authorization': 'Bearer your-api-key'}\nhttpx.get('https://api.example.com/v1/restricted', headers=headers)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check if the IP address is whitelisted on the server",
      "success_rate": 0.8,
      "how": "import socket\nmy_ip = socket.gethostbyname(socket.gethostname())\nprint(my_ip)  # then verify with server admin",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}