{"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,"search_vec":"'0.5.0':16 '2.15':19 'api':2,14 'attack':12 'client':4,6 'irregular':21 'maintain':22 'owasp':9,32 'penetr':30 'penetration-test':29 'project':26 'proxi':13 'python':3,5 'releas':20 'secur':28 'support':17 'test':31 'version':15 'zap':1,10,18,25,27 'zed':11","created_at":"2026-05-01T08:15:17.898308+00:00","updated_at":"2026-05-01T08:15:17.898308+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.6.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.zaproxy.org/","github":"https://github.com/zaproxy/zap-api-python.git","docs":"https://www.zaproxy.org/docs/api/","changelog":null,"pypi":"https://pypi.org/project/zaproxy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","http-networking","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}