{"id":18030282,"url":"https://github.com/screamz/anti-captcha","last_synced_at":"2025-03-27T03:31:18.668Z","repository":{"id":26135612,"uuid":"107442087","full_name":"ScreamZ/anti-captcha","owner":"ScreamZ","description":"A modern JS/TS wrapper around anti-captcha API (Captcha Breaker Software)","archived":false,"fork":false,"pushed_at":"2023-07-11T07:41:51.000Z","size":60,"stargazers_count":21,"open_issues_count":5,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T03:41:15.003Z","etag":null,"topics":["anti-captcha","captcha","captcha-breaker","nodejs","re-captcha","recaptcha"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScreamZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-10-18T17:38:49.000Z","updated_at":"2024-02-26T03:43:31.000Z","dependencies_parsed_at":"2024-06-18T18:23:21.488Z","dependency_job_id":null,"html_url":"https://github.com/ScreamZ/anti-captcha","commit_stats":{"total_commits":33,"total_committers":15,"mean_commits":2.2,"dds":0.6363636363636364,"last_synced_commit":"9e9d4a4420286bbbd17ba4c9f99b85826254b530"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fanti-captcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fanti-captcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fanti-captcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fanti-captcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScreamZ","download_url":"https://codeload.github.com/ScreamZ/anti-captcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245778706,"owners_count":20670682,"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":["anti-captcha","captcha","captcha-breaker","nodejs","re-captcha","recaptcha"],"created_at":"2024-10-30T09:13:55.131Z","updated_at":"2025-03-27T03:31:17.993Z","avatar_url":"https://github.com/ScreamZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  AntiCaptcha\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eModern NodeJS API wrapper for Anticaptcha service\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.typescriptlang.org\"\u003e\u003cimg src=\"https://anti-captcha.com/images/mainpage/herofront_nocape.png\" alt=\"Anticaptcha Logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\nThis library is a NodeJS wrapper that expose an modern API in order to exploit the https://anti-captcha.com/ service.\n\nPlease keep in mind that this is a work in progress and it only supports certain tasks types. Pull requests welcome!\n\n## Documentation\n\nInstall using either `yarn add anticaptcha` or `npm i anticaptcha`.\n\nFor the example, we will use the nice feature that are [ES7 Async Function](https://developers.google.com/web/fundamentals/primers/async-functions) this will make the syntax more concise, but feel free to use good old Promises.\n\n**Caution** : Keep in mind that real people are working behind the network to break the hash. This can lead to some delay depending on the service charge's load, therefore you might require to set a greater timeout for your calls if you're using this through an REST API.\n\n```typescript\n// main.js\nimport {\n  AntiCaptcha,\n  AntiCaptchaError,\n  ErrorCodes,\n  INoCaptchaTaskProxyless,\n  INoCaptchaTaskProxylessResult,\n  QueueTypes,\n  TaskTypes\n} from \"anticaptcha\";\n\n// Registering the API Client.\nconst AntiCaptchaAPI = new AntiCaptcha(\"\u003cyour_client_ID\u003e\"); // You can pass true as second argument to enable debug logs.\n\nconst mainProcess = async () =\u003e {\n  try {\n    // Checking the account balance before creating a task. This is a conveniance method.\n    if (!(await AntiCaptchaAPI.isBalanceGreaterThan(10))) {\n      // You can dispatch a warning using mailer or do whatever.\n      console.warn(\"Take care, you're running low on money !\");\n    }\n\n    // Get service stats\n    const stats = await this.getQueueStats(QueueTypes.RECAPTCHA_PROXYLESS);\n\n    // Creating nocaptcha proxyless task\n    const taskId = await AntiCaptchaAPI.createTask\u003cINoCaptchaTaskProxyless\u003e({\n      type: TaskTypes.NOCAPTCHA_PROXYLESS,\n      websiteKey: \"7Lfh5tkSBBBFGBGN56s8fAVds_Fl-HP0xQGNGFDK\", // Some key from website\n      websiteURL: \"http://www.some-site.com\" // Some URL from website\n    });\n\n    // Waiting for resolution and do something\n    const response = await AntiCaptchaAPI.getTaskResult\u003c\n      INoCaptchaTaskProxylessResult\n    \u003e(taskId);\n\n    console.log(`Response Code: ${response.solution.gRecaptchaResponse}`);\n  } catch (e) {\n    if (\n      e instanceof AntiCaptchaError \u0026\u0026\n      e.code === ErrorCodes.ERROR_IP_BLOCKED\n    ) {\n      // do something...\n    }\n  }\n};\n```\n\nWhen calling `createTask` or `getTaskResult` you'll need to specify the task type. Check the TypeScript definition file that are given. This will give you nice view of the object properties. The following tasks are currently supported (other types are defined at: https://anticaptcha.atlassian.net/wiki/spaces/API/pages/5079084/Captcha+Task+Types):\n\n- `IImageToTextTask` (result type `IImageToTextTaskResult`)\n- `INoCaptchaTaskProxyless` (result type `INoCaptchaTaskProxylessResult`)\n- `IRecaptchaV3TaskProxyless` (result type `IRecaptchaV3TaskProxylessResult`)\n\n```typescript\n{\n  status: \"ready\" | \"processing\";\n  solution: T;\n  cost: number;\n  ip: string;\n  createTime: number;\n  endTime: number;\n  /**\n   * Number of workers who tried to complete your task\n   *\n   * @type {number}\n   * @memberof IGetTaskResponse\n   */\n  solveCount: number;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fanti-captcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscreamz%2Fanti-captcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fanti-captcha/lists"}