{"id":24860,"library":"zaproxy","title":"ZAP API Python Client","description":"Python client for the OWASP ZAP (Zed Attack Proxy) API. Version 0.5.0 supports ZAP 2.15+. Released irregularly; maintained by the ZAP project.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/zaproxy/zap-api-python","tags":["zap","security","penetration-testing","owasp"],"install":[{"cmd":"pip install zaproxy","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP requests to ZAP API","package":"requests","optional":false},{"reason":"WebSocket support for ZAP events","package":"websocket-client","optional":false}],"imports":[{"note":"Official import path","symbol":"ZAPv2","correct":"from zapv2 import ZAPv2"}],"quickstart":{"code":"from zapv2 import ZAPv2\n\nzapi = ZAPv2(apikey=os.environ.get('ZAP_API_KEY', ''), proxy={'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'})\nprint(zapi.urlopen('http://127.0.0.1'))\n# Core API example\nprint(zapi.core.version)","lang":"python","description":"Connect to local ZAP instance (must be running on port 8080) and call the core version endpoint."},"warnings":[{"fix":"Always provide the proxy argument: ZAPv2(proxy={'http': 'http://127.0.0.1:8080', 'https': '...'})","message":"In version 0.5.0, the default proxy changed. Previously the proxy was optional; now it must be explicitly passed or set to None if no proxy.","severity":"breaking","affected_versions":"0.5.0"},{"fix":"Set ZAP_API_KEY environment variable or pass apikey='' to ZAPv2 for unauthenticated access.","message":"The ZAP API key is required by default starting ZAP 2.9. If not set, you may get a 401 error. Pass an empty apikey if ZAP is configured without one.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from zapv2 import ZAPv2' instead of 'import zaproxy'.","cause":"Importing incorrectly from top-level 'zaproxy' package instead of 'zapv2' submodule.","error":"AttributeError: module 'zaproxy' has no attribute 'ZAPv2'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}