{"id":13775790,"url":"https://github.com/zaproxy/zap-api-nodejs","last_synced_at":"2025-05-11T08:33:24.764Z","repository":{"id":8724985,"uuid":"59484115","full_name":"zaproxy/zap-api-nodejs","owner":"zaproxy","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-05T11:07:01.000Z","size":444,"stargazers_count":49,"open_issues_count":3,"forks_count":18,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-08T21:37:34.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaproxy.png","metadata":{"funding":{"custom":["https://www.zaproxy.org/sponsor/"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-23T13:13:46.000Z","updated_at":"2025-04-28T16:50:21.000Z","dependencies_parsed_at":"2023-10-02T13:03:36.601Z","dependency_job_id":"56f3ed82-c079-4bb0-8655-6527581fc7c9","html_url":"https://github.com/zaproxy/zap-api-nodejs","commit_stats":{"total_commits":113,"total_committers":8,"mean_commits":14.125,"dds":0.5309734513274336,"last_synced_commit":"10cd650d132bb101a44f9f12122c539fcdba7d66"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Fzap-api-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Fzap-api-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Fzap-api-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Fzap-api-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaproxy","download_url":"https://codeload.github.com/zaproxy/zap-api-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253540335,"owners_count":21924521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:50.058Z","updated_at":"2025-05-11T08:33:24.491Z","avatar_url":"https://github.com/zaproxy.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://github.com/zaproxy/zap-api-nodejs\" title=\"zaproxy\"\u003e\n    \u003cimg width=186px src=\"assets/images/ZapNodeApi.png\" alt=\"zap-api-nodejs logo\"\u003e\n  \u003c/a\u003e\n  \u003cbr/\u003e\n\u003cbr/\u003e\n\u003ch2\u003eZAP Node API\u003c/h2\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n\n\u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0.html\" title=\"License\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-Apache%202-4EB1BA.svg\" alt=\"License\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://snyk.io/test/github/zaproxy/zap-api-nodejs?targetFile=package.json\"\u003e\n  \u003cimg src=\"https://snyk.io/test/github/zaproxy/zap-api-nodejs/badge.svg?targetFile=package.json\" alt=\"Known Vulnerabilities\"/\u003e\n\u003c/a\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\n\u003c/div\u003e\n\nThe NodeJS implementation to access the [ZAP API](https://www.zaproxy.org/docs/api/). For more information\nabout ZAP consult the (main) [ZAP project](https://github.com/zaproxy/zaproxy/).\n\n## Install\n\n```\nnpm install zaproxy\n```\n\n## Usage\n\nBy default ZAP [requires an API key](https://www.zaproxy.org/faq/why-is-an-api-key-required-by-default/) to be sent with every request. This is done automatically providing you supply the same API key when you instantiate the `ZapClient` that you use to run ZAP with. All following API requests will use this same API key.  \nYou can disable the API key when running ZAP if you are on a trusted network and understand the risks. If you choose to do so, you may omit the `apiKey` property of the `zapOptions` object supplied to `ZapClient`.\n\n### Instantiate the Node API:\n\n```js\nconst ZapClient = require('zaproxy');\n\nconst zapOptions = {\n  apiKey: 'eahhr6h6kal92j21gkcnhkp80t',\n  proxy: {\n    host: '127.0.0.1',\n    port: 8080,\n  },\n};\n\nconst zaproxy = new ZapClient(zapOptions);\n\n```\n\n### Use the Node API:\n\n```js\nlet params = {\n  contextid: contextid,\n  userid: userid,\n  url: sutbaseurl,\n  maxchildren: maxchildren,\n  recurse: recurse,\n  subtreeonly: subtreeonly,\n};\nlet response = await zaproxy.spider.scanAsUser(params);\nconsole.log(response);\n```\n\n### Encountering Errors\n\nWhen encountering an error, like attempting to retrieve a non-existent context, a rejected promise will be returned. The rejection will contain an `ApiClientError` object, which encapsulates the specific details of the original error. This `ApiClientError` object offers valuable information regarding the failed request, and the original error can be accessed through the `cause` property. The response details, if any, are available through the `response` property, containing the `status` and `data` (body).\n\n## API\n\nFor a full API list, see [https://www.zaproxy.org/docs/api/](https://www.zaproxy.org/docs/api/).\n\n\n## Getting Help\n\nFor help using the ZAP API refer to:\n\n  * [API Documentation](https://www.zaproxy.org/docs/api/);\n  * [ZAP User Group](https://groups.google.com/group/zaproxy-users) - for asking questions;\n\n## Issues\n\nTo report issues related to the ZAP Node API, bugs and enhancements requests, use the [issue tracker of this project](https://github.com/zaproxy/zap-api-nodejs/issues).\n","funding_links":["https://www.zaproxy.org/sponsor/"],"categories":["Web","\u003ca id=\"d03d494700077f6a65092985c06bf8e8\"\u003e\u003c/a\u003e工具","Misc","Testing"],"sub_categories":["Development","\u003ca id=\"0ff94312f3ab4898f5996725133ea9d1\"\u003e\u003c/a\u003e未分类","Web"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaproxy%2Fzap-api-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaproxy%2Fzap-api-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaproxy%2Fzap-api-nodejs/lists"}