@2captcha/captcha-solver 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,863 +1,1268 @@
1
- export interface paramsRecaptcha {
2
- pageurl: string;
3
- googlekey: string;
4
- invisible?: 0 | 1;
5
- datas?: string;
6
- domain?: string;
7
- cookies?: string;
8
- userAgent?: string;
9
- header_acao?: boolean;
10
- pingback?: string;
11
- soft_id?: number;
12
- proxy?: string;
13
- proxytype?: string;
14
- action?: string;
15
- enterprise?: 0 | 1;
16
- min_score?: number;
17
- version?: string;
18
- }
19
- export interface paramsHCaptcha {
20
- sitekey: string;
21
- pageurl: string;
22
- header_acao?: boolean;
23
- pingback?: string;
24
- proxy?: string;
25
- proxytype?: string;
26
- invisible?: 0 | 1;
27
- data?: string;
28
- userAgent?: string;
29
- soft_id?: number;
30
- domain?: string;
31
- }
32
- export interface paramsFunCaptcha {
33
- publickey: string;
34
- pageurl: string;
35
- surl?: string;
36
- header_acao?: boolean;
37
- pingback?: string;
38
- proxy?: string;
39
- proxytype?: string;
40
- userAgent?: string;
41
- data?: string;
42
- }
43
- export interface paramsImageCaptcha {
44
- body: string;
45
- phrase?: 0 | 1;
46
- regsense?: 0 | 1;
47
- numeric?: 0 | 1 | 2 | 3 | 4;
48
- calc?: 0 | 1;
49
- min_len?: 0 | string | number;
50
- max_len?: 0 | string | number;
51
- language?: 0 | 1 | 2;
52
- lang?: string;
53
- pingback?: string;
54
- textinstructions?: string;
55
- }
56
- export interface paramsGeetest {
57
- gt: string;
58
- challenge: string;
59
- pageurl: string;
60
- api_server?: string;
61
- offline?: number | boolean;
62
- new_captcha?: number | boolean;
63
- pingback?: string;
64
- soft_id?: number;
65
- proxy?: string;
66
- proxytype?: string;
67
- userAgent?: string;
68
- }
69
- /**
70
- * Interface for yandexSmart captcha
71
- *
72
- * @typedef {object} yandexSmart
73
- * @property {string} pageurl URL of the page where the captcha is located
74
- * @property {string} sitekey The `sitekey` value you found on the captcha page
75
- * @property {string} pingback
76
- * @property {string} proxy Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
77
- * @property {string} proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
78
- * @property {string} userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
79
- *
80
- */
81
- export interface yandexSmart {
82
- pageurl: string;
83
- sitekey: string;
84
- pingback?: string;
85
- proxy?: string;
86
- proxytype?: string;
87
- userAgent?: string;
88
- }
89
- /**
90
- * Interface for GeeTest V4 captcha
91
- *
92
- * @typedef {object} paramsGeeTestV4
93
- * @property {string} pageurl Required parameter. URL of the page where the captcha is located
94
- * @property {string} captcha_id Required parameter. Value of `captcha_id` parameter you found on target website.
95
- * @property {string} pingback An optional param. [More info here](https://2captcha.com/2captcha-api#pingback).
96
- * @property {string} proxy An optional param. Format: `login:password@123.123.123.123:3128`
97
- * @property {string} proxytype An optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
98
- * @property {string} userAgent An optional param. Your `userAgent` that will be passed to our worker and used to solve the captcha.
99
- *
100
- */
101
- export interface paramsGeeTestV4 {
102
- pageurl: string;
103
- captcha_id: string;
104
- pingback?: string;
105
- proxy?: string;
106
- proxytype?: string;
107
- userAgent?: string;
108
- }
109
- export interface paramsLemin {
110
- pageurl: string;
111
- captcha_id: string;
112
- div_id: string;
113
- api_server?: string;
114
- pingback?: string;
115
- proxy?: string;
116
- proxytype?: string;
117
- }
118
- export interface paramsAmazonWAF {
119
- pageurl: string;
120
- sitekey: string;
121
- iv: string;
122
- context: string;
123
- challenge_script?: string;
124
- captcha_script?: string;
125
- header_acao?: boolean;
126
- pingback?: string;
127
- soft_id?: number;
128
- proxy?: string;
129
- proxytype?: string;
130
- }
131
- export interface paramsTurnstile {
132
- pageurl: string;
133
- sitekey: string;
134
- action?: string;
135
- data?: string;
136
- header_acao?: boolean;
137
- pingback?: string;
138
- soft_id?: number;
139
- proxy?: string;
140
- proxytype?: string;
141
- }
142
- export interface paramsCapyPuzzle {
143
- pageurl: string;
144
- captchakey: string;
145
- api_server?: string;
146
- version?: string;
147
- pingback?: string;
148
- proxy?: string;
149
- proxytype?: string;
150
- }
151
- export interface paramsCoordinates {
152
- body: string;
153
- language?: 0 | 1 | 2;
154
- lang?: string;
155
- pingback?: string;
156
- textinstructions?: string;
157
- imginstructions?: string;
158
- }
159
- export interface paramsDataDome {
160
- pageurl: string;
161
- captcha_url: string;
162
- userAgent: string;
163
- pingback?: string;
164
- proxy: string;
165
- proxytype: string;
166
- }
167
- export interface paramsCyberSiARA {
168
- pageurl: string;
169
- master_url_id: string;
170
- userAgent: string;
171
- pingback?: string;
172
- proxy?: string;
173
- proxytype?: string;
174
- }
175
- export interface paramsMTCaptcha {
176
- pageurl: string;
177
- sitekey: string;
178
- userAgent?: string;
179
- pingback?: string;
180
- proxy?: string;
181
- proxytype?: string;
182
- }
183
- export interface friendlyCaptcha {
184
- pageurl: string;
185
- sitekey: string;
186
- pingback?: string;
187
- proxy?: string;
188
- proxytype?: string;
189
- }
190
- export interface paramsBoundingBox {
191
- image: string;
192
- textinstructions?: string;
193
- imginstructions?: string;
194
- }
195
- export interface paramsGrid {
196
- body: string;
197
- recaptcha: 1;
198
- rows?: number;
199
- cols?: number;
200
- minСlicks?: number;
201
- maxСlicks?: number;
202
- previousId?: string;
203
- textinstructions?: string;
204
- imginstructions?: string;
205
- canSkip?: number;
206
- lang?: string;
207
- pingback?: string;
208
- }
209
- /**
210
- * An object containing properties of the captcha solution.
211
- * @typedef {Object} CaptchaAnswer
212
- * @param {string} data The solution to the captcha
213
- * @param {string} id The captcha ID
214
- */
215
- interface CaptchaAnswer {
216
- /** The solution to the captcha */
217
- data: string;
218
- /** The ID of the captcha solve */
219
- id: string;
220
- }
221
- /**
222
- * The main 2captcha class, housing all API calls and api interactions.
223
- *
224
- */
225
- export declare class Solver {
226
- _apikey: string;
227
- _pollingFrequency: number;
228
- _headerACAO: number;
229
- /**
230
- * The constructor for the 2captcha Solver class.
231
- *
232
- * @param {string} apikey The API key to use
233
- * @param {number} pollingFrequency The frequency to poll for requests
234
- *
235
- */
236
- constructor(apikey: string, pollingFrequency?: number, enableACAO?: boolean);
237
- /** The API key this instance is using */
238
- get apikey(): string;
239
- /** Frequency the instance polls for updates */
240
- get pollingFrequency(): number;
241
- /** Set the API key for this instance */
242
- set apikey(update: string);
243
- private get in();
244
- private get res();
245
- private get defaultPayload();
246
- /**
247
- * Returns the remaining account balance.
248
- *
249
- * @return {Promise<Number>} Remaining balance
250
- * @throws APIError
251
- * @example
252
- * solver.balance()
253
- * .then((res) => {
254
- * console.log(res)
255
- * })
256
- */
257
- balance(): Promise<number>;
258
- /**
259
- * @private
260
- *
261
- * Polls for a captcha, finding out if it's been completed
262
- * @param {string} id Captcha ID
263
- *
264
- * @returns {Promise<CaptchaAnswer>}
265
- * @throws APIError
266
- */
267
- private pollResponse;
268
- /**
269
- * ### Solves a google reCAPTCHA V2 | V3.
270
- *
271
- * [Read more about other reCAPTCHA parameters](https://2captcha.com/2captcha-api#solving_recaptchav2_new).
272
- *
273
- * @param {{pageurl, googlekey, cookies, proxy, proxytype, userAgent, invisible, datas, pingback, action, enterprise, min_score, version, domain}} params Object
274
- * @param {string} params.pageurl The URL the captcha appears on.
275
- * @param {string} params.googlekey Value of `k` or `data-sitekey` parameter you found on page.
276
- * @param {string} params.cookies Your cookies that will be passed to our worker who solve the captha.
277
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
278
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
279
- * @param {string} params.userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
280
- * @param {number} params.invisible `1` - means that reCAPTCHA is invisible. `0` - normal reCAPTCHA.
281
- * @param {string} params.datas Value of `data-s` parameter you found on page. Curenttly applicable for Google Search and other Google services.
282
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
283
- * @param {string} params.action Value of `action` parameter you found on page.
284
- * @param {number} params.enterprise `1` - defines that you're sending reCAPTCHA Enterpise.
285
- * @param {number} params.min_score The score needed for resolution reCAPTCHA V3. Currently it's almost impossible to get token with score higher than `0.3`
286
- * @param {string} params.version `v2` — defines that you're sending a reCAPTCHA V2. `v3` — defines that you're sending a reCAPTCHA V3.
287
- * @param {string} params.domain Domain used to load the captcha: `google.com` or `recaptcha.net`
288
- *
289
- * @returns {Promise<CaptchaAnswer>} The result from the solve.
290
- * @throws APIError
291
- * @example
292
- * solver.recaptcha({
293
- * pageurl: 'https://2captcha.com/demo/recaptcha-v2',
294
- * googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u'
295
- * })
296
- * .then((res) => {
297
- * console.log(res);
298
- * })
299
- * .catch((err) => {
300
- * console.log(err);
301
- * })
302
- */
303
- recaptcha(params: paramsRecaptcha): Promise<CaptchaAnswer>;
304
- /**
305
- * ### Solves a hCaptcha
306
- *
307
- * [Read more about other hCaptcha parameters](https://2captcha.com/2captcha-api#solving_hcaptcha).
308
- *
309
- * @param {{sitekey, pageurl, data, userAgent, invisible, pingback, proxy, proxytype, domain}} params Object
310
- * @param {string} params.sitekey The hcaptcha site key. Value of `k` or `data-sitekey` parameter you found on page.
311
- * @param {string} params.pageurl The URL the captcha appears on.
312
- * @param {string} params.data Custom `data` that is used in some implementations of hCaptcha, mostly with `invisible=1`. In most cases you see it as `rqdata` inside network requests. IMPORTANT: you MUST provide `userAgent` if you submit captcha with `data` paramater. The value should match the User-Agent you use when interacting with the target website.
313
- * @param {string} params.userAgent Your userAgent that will be passed to our worker and used to solve the captcha. Required for hCaptcha with `data` parameter.
314
- * @param {number} params.invisible Use `1` for invisible version of hcaptcha. Currently it is a very rare case.
315
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. More info [here](https://2captcha.com/2captcha-api#pingback).
316
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
317
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
318
- * @param {string} params.domain Domain used to load the captcha: `hcaptcha.com` or `js.hcaptcha.com`
319
- *
320
- * @returns {Promise<CaptchaAnswer>} The result from the solve
321
- * @throws APIError
322
- * @example
323
- * solver.hcaptcha({
324
- * pageurl: "https://2captcha.com/demo/hcaptcha",
325
- * sitekey: "b76cd927-d266-4cfb-a328-3b03ae07ded6"
326
- * .then((res) => {
327
- * console.log(res);
328
- * })
329
- * .catch((err) => {
330
- * console.log(err);
331
- * })
332
- */
333
- hcaptcha(params: paramsHCaptcha): Promise<CaptchaAnswer>;
334
- /**
335
- * ### Solves a GeeTest Captcha.
336
- *
337
- * [Read more about parameters and solving for Geetest captcha](https://2captcha.com/2captcha-api#solving_geetest).
338
- *
339
- * @param {{ gt, challenge, api_server, offline, new_captcha,
340
- * pageurl, pingback, proxy, proxytype, userAgent }} params
341
- * @param {string} params.gt Value of gt parameter found on site
342
- * @param {string} params.challenge Value of challenge parameter found on site
343
- * @param {string} params.pageurl The URL the captcha appears on
344
- * @param {string} params.api_server The URL of the api_server (recommended)
345
- * @param {number} params.offline In rare cases `initGeetest` can be called with `offline` parameter on the target page. If the call uses offline: true, set the value to `1`.
346
- * @param {number} params.new_captcha In rare cases `initGeetest` can be called with `new_captcha` parameter. If the call uses `new_captcha: true`, set the value to `1`. Mostly used with offline parameter.
347
- * @param {string} params.pingback URL for `pingback` (callback) response that will be sent when captcha is solved. [More info here](https://2captcha.com/2captcha-api#pingback).
348
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
349
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
350
- * @param {string} params.userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
351
- *
352
- * @returns {Promise<CaptchaAnswer>} The result from the solve.
353
- * @throws APIError
354
- * @example
355
- * ;(async () => {
356
- *
357
- * // Warning: Attention, the `challenge` value is not static but dynamic.
358
- * // You need to find the queries that makes the captcha on the page to API.
359
- * // Then you need to make request to this API and get new `challenge`.
360
- *
361
- * // For page https://rucaptcha.com/demo/geetest, api address is https://rucaptcha.com/api/v1/captcha-demo/gee-test/init-params?t=${t}
362
- * // Also note that when make request to API, the request uses the dynamic parameter `t`
363
- *
364
- * // You can read more about sending GeeTest here https://2captcha.com/2captcha-api#solving_geetest, or here https://2captcha.com/p/geetest
365
- * // In this example I solve GeeTest from page https://2captcha.com/demo/geetest
366
- *
367
- * const t = new Date().getTime()
368
- * // below i make a request to get a new `challenge`.
369
- * const response = await fetch(`https://2captcha.com/api/v1/captcha-demo/gee-test/init-params?t=${t}`)
370
- * const data = await response.json()
371
- *
372
- * const params = {
373
- * pageurl: 'https://rucaptcha.com/demo/geetest',
374
- * gt: data.gt,
375
- * challenge: data.challenge
376
- * }
377
- *
378
- * const res = await solver.geetest(params)
379
- * try {
380
- * console.log(res)
381
- * } catch (error) {
382
- * console.error(error);
383
- * }
384
- * })()
385
- */
386
- geetest(params: paramsGeetest): Promise<CaptchaAnswer>;
387
- /**
388
- * ### Solves a GeeTest V4 Captcha.
389
- *
390
- * This method accepts an object with the following fields: `pageurl`, `captcha_id`, `pingback`, `proxy`, `proxytype`, `userAgent`.
391
- * The `pageurl` and `captcha_id` fields are required.
392
- *
393
- * @param {{pageurl, captcha_id, pingback, proxy, proxytype, userAgent}} params The method geetestV4 takes arguments as an object.
394
- * @param {string} params.pageurl Full URL of the page where you see Geetest V4 captcha.
395
- * @param {string} params.captcha_id Required parameter. Value of `captcha_id` parameter you found on target website.
396
- * @param {string} params.pingback An optional param. [More info here](https://2captcha.com/2captcha-api#pingback).
397
- * @param {string} params.proxy An optional param. Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
398
- * @param {string} params.proxytype An optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
399
- * @param {string} params.userAgent An optional param. Your `userAgent` that will be passed to our worker and used to solve the captcha.
400
- *
401
- * @returns {Promise<CaptchaAnswer>} The result from the solve.
402
- * @throws APIError
403
- * @example
404
- * solver.geetestV4({
405
- * pageurl: 'https://2captcha.com/demo/geetest-v4',
406
- * captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73'
407
- * })
408
- * .then((res) => {
409
- * console.log(res)
410
- * })
411
- * .catch((err) => {
412
- * console.log(err);
413
- * })
414
- */
415
- geetestV4(params: paramsGeeTestV4): Promise<CaptchaAnswer>;
416
- /**
417
- * ### Method for sending Yandex Smart Captcha.
418
- *
419
- * This method accepts an object with the following fields: `pageurl`, `sitekey`, `pingback`, `proxy`, `proxytype`.
420
- * The `pageurl` and `sitekey` fields are required.
421
- *
422
- * @param {{pageurl, sitekey, pingback, proxy, proxytype, userAgent}} params The method takes arguments as an object.
423
- * @param {string} params.pageurl Required parameter. URL of the page where the captcha is located.
424
- * @param {string} params.sitekey Required parameter. The `sitekey` value you found on the captcha page.
425
- * @param {string} params.pingback An optional param.
426
- * @param {string} params.proxy An optional param. Format: `login:password@123.123.123.123:3128`.
427
- * @param {string} params.proxytype An optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
428
- * @param {string} params.userAgent An optional param. Your `userAgent` that will be passed to our worker and used to solve the captcha.
429
- *
430
- * @returns {Promise<CaptchaAnswer>} The result from the solve.
431
- * @throws APIError
432
- * @example
433
- * solver.yandexSmart({
434
- * pageurl: "https://captcha-api.yandex.ru/demo",
435
- * sitekey: "FEXfAbHQsToo97VidNVk3j4dC74nGW1DgdxjtNB9"
436
- * })
437
- * .then((res) => {
438
- * console.log(res)
439
- * })
440
- * .catch((err) => {
441
- * console.log(err);
442
- * })
443
- */
444
- yandexSmart(params: yandexSmart): Promise<CaptchaAnswer>;
445
- /**
446
- * ### Solves a image-based captcha.
447
- *
448
- * [Read more about parameters for image captcha](https://2captcha.com/2captcha-api#solving_normal_captcha).
449
- *
450
- * @param {{ body,
451
- * phrase,
452
- * regsense,
453
- * numeric,
454
- * calc,
455
- * min_len,
456
- * max_len,
457
- * language,
458
- * lang,
459
- * textinstructions,
460
- * pingback }} params Extra properties to pass to 2captcha.
461
- * @param {string} params.body Base64 image data for the captcha.
462
- * @param {number} params.phrase Captcha contains two or more words? `1` - Yes. `0` - No.
463
- * @param {number} params.regsense Captcha is case sensitive? `1` - Yes. `0` - No.
464
- * @param {number} params.numeric `0` - not specified. `1` - captcha contains only numbers. `2` - captcha contains only letters. `3` - captcha contains only numbers OR only letters. `4` - captcha MUST contain both numbers AND letters.
465
- * @param {number} params.calc Does captcha require calculations? (e.g. type the result 4 + 8 = ) `1` - Yes. `0` - No.
466
- * @param {number} params.min_len `1..20` - minimal number of symbols in captcha. `0` - not specified.
467
- * @param {number} params.max_len `1..20` - maximal number of symbols in captcha. `0` - not specified.
468
- * @param {number} params.language `0` - not specified. `1` - Cyrillic captcha. `2` - Latin captcha
469
- * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
470
- * @param {string} params.textinstructions Text will be shown to worker to help him to solve the captcha correctly. For example: type red symbols only.
471
- * @param {string} params.pingback URL for `pingback` (callback) response that will be sent when captcha is solved. [More info here](https://2captcha.com/2captcha-api#pingback).
472
- *
473
- * @returns {Promise<CaptchaAnswer>} The result from the solve
474
- * @throws APIError
475
- * @example
476
- * const imageBase64 = fs.readFileSync("./tests/media/imageCaptcha_6e584.png", "base64")
477
- *
478
- * solver.imageCaptcha({
479
- * body: imageBase64,
480
- * numeric: 4,
481
- * min_len: 5,
482
- * max_len: 5
483
- * })
484
- * .then((res) => {
485
- * console.log(res);
486
- * })
487
- * .catch((err) => {
488
- * console.log(err);
489
- * })
490
- */
491
- imageCaptcha(params: paramsImageCaptcha): Promise<CaptchaAnswer>;
492
- /**
493
- * ### Solves Arkose Labs FunCaptcha.
494
- *
495
- * [Read more](https://2captcha.com/2captcha-api#solving_funcaptcha_new) about other solving and other parameters for Arkose Labs FunCaptcha.
496
- *
497
- * @param {{pageurl, publicKey, surl, data, pingback, proxy, proxytype, userAgent}} params Object
498
- * @param {string} params.publicKey The FunCaptcha Public Key
499
- * @param {string} params.pageurl The URL to the website the captcha is seen on
500
- * @param {string} params.surl The FunCaptcha Service URL (recommended)
501
- * @param {string} params.data Custom data to pass to FunCaptcha. For example: `'data': '{"blob": "foo"}'`.
502
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
503
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
504
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
505
- * @param {string} params.userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
506
- *
507
- * @returns {Promise<CaptchaAnswer>} The result from the solve
508
- * @throws APIError
509
- *
510
- * @example
511
- * solver.funCaptcha({
512
- * pageurl: "https://funcaptcha.com/tile-game-lite-mode/fc/api/nojs/?pkey=804380F4-6844-FFA1-ED4E-5877CA1F1EA4&lang=en",
513
- * publickey: "804380F4-6844-FFA1-ED4E-5877CA1F1EA4"
514
- * })
515
- * .then((res) => {
516
- * console.log(res);
517
- * })
518
- * .catch((err) => {
519
- * console.log(err);
520
- * })
521
- */
522
- funCaptcha(params: paramsFunCaptcha): Promise<CaptchaAnswer>;
523
- /**
524
- *
525
- * ### Solves a Lemin captcha
526
- *
527
- * [Read more about other Lemin captcha parameters](https://2captcha.com/2captcha-api#lemin).
528
- *
529
- * @param {{ pageurl, captcha_id, div_id, api_server, pingback, proxy, proxytype}} params Object
530
- * @param {string} params.pageurl The URL the captcha appears on.
531
- * @param {string} params.captcha_id Value of `captcha_id` parameter you found on page.
532
- * @param {string} params.div_id Value `id` of captcha pareent `<div></div>` element.
533
- * @param {string} params.api_server The domain part of script URL you found on page. Default value: `https://api.leminnow.com/`
534
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
535
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
536
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
537
- *
538
- * @example
539
- * solver.lemin({
540
- * pageurl:'https://2captcha.com/demo/lemin',
541
- * captcha_id: 'CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b',
542
- * div_id: 'lemin-cropped-captcha',
543
- * api_server: 'api.leminnow.com'
544
- * })
545
- * .then((res) => {
546
- * console.log(res);
547
- * })
548
- * .catch((err) => {
549
- * console.log(err);
550
- * })
551
- */
552
- lemin(params: paramsLemin): Promise<CaptchaAnswer>;
553
- /**
554
- *
555
- * ### Solves Amazon WAF captcha
556
- *
557
- * [Read more about "Amazon WAF" captcha](https://2captcha.com/2captcha-api#amazon-waf).
558
- *
559
- * @param {{ pageurl, sitekey, iv, context, challenge_script, captcha_script, pingback, proxy, proxytype}} params The `amazonWaf` method takes arguments as an object. Thus, the `pageurl`, `sitekey`, `iv`, `context` fields in the passed object are mandatory.
560
- * @param {string} params.pageurl Is the full `URL` of page where you were challenged by the captcha.
561
- * @param {string} params.sitekey Is a value of `key` parameter in the page source.
562
- * @param {string} params.iv Is a value of `iv` parameter in the page source.
563
- * @param {string} params.context Is a value of `context` parameter in the page source.
564
- * @param {string} params.challenge_script The source URL of `challenge.js` script on the page.
565
- * @param {string} params.captcha_script The source URL of `captcha.js` script on the page.
566
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
567
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
568
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
569
- *
570
- * @example
571
- * solver.amazonWaf({
572
- * pageurl: "https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest",
573
- * sitekey: "AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AHMDLodoefdvyOnsHMRtEKQAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMUX+ZqwwuANRnZujSAgEQgDvHSxUQmVBuyUtumoW2n4ccTG7xQN1r3X/zz41qmQaYv9SSSvQrjIoDXKaUQ23tVb4ii8+uljuRdz/HPA==",
574
- * context: "9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb+sUNLoukWedAQZKrlY4RdbOOzvcFqmD/ZepQFS9N5w15Exr4VwnVq+HIxTsDJwRviElWCdzKDebN/mk8/eX2n7qJi5G3Riq0tdQw9+C4diFZU5E97RSeahejOAAJTDqduqW6uLw9NsjJBkDRBlRjxjn5CaMMo5pYOxYbGrM8Un1JH5DMOLeXbq1xWbC17YSEoM1cRFfTgOoc+VpCe36Ai9Kc=",
575
- * iv: "CgAHbCe2GgAAAAAj",
576
- * })
577
- * .then((res) => {
578
- * console.log(res);
579
- * })
580
- * .catch((err) => {
581
- * console.log(err);
582
- * })
583
- */
584
- amazonWaf(params: paramsAmazonWAF): Promise<CaptchaAnswer>;
585
- /**
586
- *
587
- * ### Solves Cloudflare Turnstile captcha
588
- *
589
- * [Read more about Cloudflare Turnstile captcha](https://2captcha.com/2captcha-api#turnstile).
590
- *
591
- * @param {{ pageurl, sitekey, action, data, pingback, proxy, proxytype}} params The `сloudflareTurnstile` method takes arguments as an object. Thus, the `pageurl`, `sitekey` fields in the passed object are mandatory.
592
- * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
593
- * @param {string} params.sitekey Is a value of `sitekey` parameter in the page source.
594
- * @param {string} params.action Value of optional `action` parameter you found on page.
595
- * @param {string} params.data Value of optional `data` parameter you found on page.
596
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
597
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
598
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
599
- *
600
- * @example
601
- * solver.cloudflareTurnstile({
602
- * pageurl: "https://app.nodecraft.com/login",
603
- * sitekey: "0x4AAAAAAAAkg0s3VIOD10y4"
604
- * })
605
- * .then((res) => {
606
- * console.log(res);
607
- * })
608
- * .catch((err) => {
609
- * console.log(err);
610
- * })
611
- */
612
- cloudflareTurnstile(params: paramsTurnstile): Promise<CaptchaAnswer>;
613
- /**
614
- * ### Solves a Coordinates captcha.
615
- *
616
- * @param {{ body, imginstructions, textinstructions, language, lang, pingback }} params parameters Сoordinates Captcha as an object.
617
- * @param {string} params.body Base64-encoded captcha image.
618
- * @param {string} params.imginstructions Base64-encoded image with instruction for solving captcha.
619
- * @param {string} params.textinstructions Text will be shown to worker to help him to solve the captcha correctly. For example: click on all objects in red color.
620
- * @param {number} params.language `0` - not specified. `1` - Cyrillic captcha. `2` - Latin captcha
621
- * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
622
- * @param {string} params.pingback URL for `pingback` (callback) response that will be sent when captcha is solved. [More info here](https://2captcha.com/2captcha-api#pingback).
623
- *
624
- * @returns {Promise<CaptchaAnswer>} The result from the solve
625
- *
626
- * @example
627
- * const imageBase64 = fs.readFileSync("./tests/media/hCaptchaImage.jpg", "base64")
628
- *
629
- * solver.coordinates({
630
- * body: imageBase64,
631
- * textinstructions: 'Select all photos containing the boat'
632
- * })
633
- * .then((res) => {
634
- * console.log(res);
635
- * })
636
- * .catch((err) => {
637
- * console.log(err);
638
- * })
639
- */
640
- coordinates(params: paramsCoordinates): Promise<CaptchaAnswer>;
641
- /**
642
- * ### Solves Capy Puzzle captcha
643
- *
644
- * @param {{ pageurl, captchakey, api_server, version, pingback, proxy, proxytype}} params Parameters Capy Puzzle Captcha as an object.
645
- * @param {string} params.pageurl Full `URL`of the page where you see the captcha.
646
- * @param {string} params.captchakey Value of `captchakey` parameter you found on page.
647
- * @param {string} params.api_server The domain part of script URL you found on page. Default value: `https://jp.api.capy.me/`.
648
- * @param {string} params.version The version of captcha task: `puzzle` (assemble a puzzle) or `avatar` (drag an object)..
649
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
650
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
651
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
652
- *
653
- * @example
654
- * solver.capyPuzzle({
655
- * pageurl: "https://www.capy.me/account/register/",
656
- * captchakey: "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w"
657
- * })
658
- * .then((res) => {
659
- * console.log(res);
660
- * })
661
- * .catch((err) => {
662
- * console.log(err);
663
- * })
664
- */
665
- capyPuzzle(params: paramsCapyPuzzle): Promise<CaptchaAnswer>;
666
- /**
667
- * ### Solves DataDome captcha
668
- *
669
- * @param {{ pageurl, captcha_url, userAgent, pingback, proxy, proxytype}} params Parameters DataDome Captcha as an object.
670
- * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
671
- * @param {string} params.captcha_url The value of the `src` parameter for the `iframe` element containing the captcha on the page.
672
- * @param {string} params.userAgent ser-Agent of your MODERN browser
673
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
674
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
675
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
676
- *
677
- * @example
678
- * solver.dataDome({
679
- * pageurl: "https://rendezvousparis.hermes.com/client/register",
680
- * captcha_url: "https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAEuQtkf4k1c0ABZhYZA%3D%3D&hash=789361B674144528D0B7EE76B35826&cid=mY4z7GNmh7Nt1lAFwpbNHAOcWPhyPgjHD2K1Pm~Od1iEKYLUnK3t7N2ZGUj8OqDK65cnwJHtHwd~t902vlwpSBA5l4ZHbS1Qszv~jEuEUJNQ_jMAjar2Kj3kq20MRJYh&t=fe&referer=https%3A%2F%2Frendezvousparis.hermes.com%2Fclient%2Fregister&s=40119&e=67fef144ac1a54dbd7507776367d2f9d5e36ec3add17fa22f3cb881db8385838",
681
- * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
682
- * proxy: "1.2.3.4:8888:user:password",
683
- * proxytype: "http"
684
- * })
685
- * .then((res) => {
686
- * console.log(res);
687
- * })
688
- * .catch((err) => {
689
- * console.log(err);
690
- * })
691
- */
692
- dataDome(params: paramsDataDome): Promise<CaptchaAnswer>;
693
- /**
694
- * ### Solves CyberSiARA captcha
695
- *
696
- * @param {{ pageurl, master_url_id, userAgent, pingback, proxy, proxytype}} params Parameters CyberSiARA Captcha as an object.
697
- * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
698
- * @param {string} params.master_url_id The value of `MasterUrlId` parameter obtained from the request to the endpoint `API/CyberSiara/GetCyberSiara`.
699
- * @param {string} params.userAgent ser-Agent of your MODERN browser
700
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
701
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
702
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
703
- *
704
- * @example
705
- * solver.cyberSiARA({
706
- * pageurl: "https://www.cybersiara.com/book-a-demo",
707
- * master_url_id: "OXR2LVNvCuXykkZbB8KZIfh162sNT8S2",
708
- * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
709
- * })
710
- * .then((res) => {
711
- * console.log(res);
712
- * })
713
- * .catch((err) => {
714
- * console.log(err);
715
- * })
716
- */
717
- cyberSiARA(params: paramsCyberSiARA): Promise<CaptchaAnswer>;
718
- /**
719
- * ### Solves MTCaptcha
720
- *
721
- * @param {{ pageurl, sitekey, userAgent, pingback, proxy, proxytype}} params Parameters MTCaptcha as an object.
722
- * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
723
- * @param {string} params.sitekey TThe value of `sitekey` parameter found on the page.
724
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
725
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
726
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
727
- *
728
- * @example
729
- * solver.mtCaptcha({
730
- * pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html",
731
- * sitekey: "MTPublic-DemoKey9M"
732
- * })
733
- * .then((res) => {
734
- * console.log(res);
735
- * })
736
- * .catch((err) => {
737
- * console.log(err);
738
- * })
739
- */
740
- mtCaptcha(params: paramsMTCaptcha): Promise<CaptchaAnswer>;
741
- /**
742
- * ### Solves Cutcaptcha
743
- *
744
- * @param {{ pageurl, sitekey, userAgent, pingback, proxy, proxytype}} params Parameters MTCaptcha as an object.
745
- * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
746
- * @param {string} params.sitekey TThe value of `sitekey` parameter found on the page.
747
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
748
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
749
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
750
- *
751
- * @example
752
- * solver.cutCaptcha({
753
- * pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html",
754
- * sitekey: "MTPublic-DemoKey9M"
755
- * })
756
- * .then((res) => {
757
- * console.log(res);
758
- * })
759
- * .catch((err) => {
760
- * console.log(err);
761
- * })
762
- */
763
- cutCaptcha(params: paramsMTCaptcha): Promise<CaptchaAnswer>;
764
- /**
765
- * ### Solves Friendly Captcha
766
- *
767
- * @param {{ pageurl, sitekey, pingback, proxy, proxytype}} params Parameters Friendly Captcha as an object.
768
- * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
769
- * @param {string} params.sitekey The value of `data-apikey` or `data-sitekey` parameter found on the page.
770
- * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
771
- * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
772
- * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
773
- *
774
- * @example
775
- * solver.friendlyCaptcha({
776
- * pageurl: "https://geizhals.de/?liftban=1&from=/455973138?fsean=5901747021356",
777
- * sitekey: "FCMST5VUMCBOCGQ9"
778
- * })
779
- * .then((res) => {
780
- * console.log(res);
781
- * })
782
- * .catch((err) => {
783
- * console.log(err);
784
- * })
785
- */
786
- friendlyCaptcha(params: friendlyCaptcha): Promise<CaptchaAnswer>;
787
- /**
788
- * ### Bounding Box Method
789
- *
790
- * @param {{ image, textinstructions, imginstructions }} params Parameters Bounding Box Method as an object.
791
- * @param {string} params.image Image containing data for markup. The image must be encoded in `Base64` format.
792
- * @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
793
- * @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
794
- *
795
- * @example
796
- * solver.boundingBox({
797
- * image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgG...",
798
- * textinstructions: "Select cars in the image"
799
- * })
800
- * .then((res) => {
801
- * console.log(res);
802
- * })
803
- * .catch((err) => {
804
- * console.log(err);
805
- * })
806
- */
807
- boundingBox(params: paramsBoundingBox): Promise<CaptchaAnswer>;
808
- /**
809
- * ### Grid method
810
- *
811
- * The method can be used to bypass tasks where a grid is applied to an image and you need to click on grid tiles, like reCAPTCHA or hCaptcha images.
812
- *
813
- * @param {{ body, textinstructions, imginstructions, rows, cols, minСlicks, maxСlicks, previousId, canSkip, lang, pingback}} params Parameters Grid Method as an object.
814
- * @param {string} params.body `Base64`- encoded captcha image.
815
- * @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
816
- * @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
817
- * @param {number} params.rows Number of rows in grid captcha.
818
- * @param {number} params.cols Number of columns in grid captcdha.
819
- * @param {number} params.minСlicks The minimum number of tiles that must be selected. Can't be more than `rows` * `cols`.
820
- * @param {number} params.maxСlicks The maximum number of tiles that can be selected on the image.
821
- * @param {string} params.previousId Id of your previous request with the same captcha challenge.
822
- * @param {number} params.canSkip Set the value to `1` only if it's possible that there's no images matching to the instruction. We'll provide a button "No matching images" to worker and you will receive `No_matching_images` as answer.
823
- * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
824
- * @param {string} params.pingback params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
825
- *
826
- * @example
827
- * solver.grid({
828
- * body: 'iVBORw0KGgoAAAANSUhEUgAAAcIA...',
829
- * textinstructions: "Select cars in the image",
830
- * imginstructions: '/9j/4AAQSkZJRgABAQEA...'
831
- * })
832
- * .then((res) => {
833
- * console.log(res);
834
- * })
835
- * .catch((err) => {
836
- * console.log(err);
837
- * })
838
- */
839
- grid(params: paramsGrid): Promise<CaptchaAnswer>;
840
- /**
841
- * Reports a captcha as correctly solved.
842
- *
843
- * @param {string} id The ID of the captcha
844
- * @throws APIError
845
- * @example
846
- * solver.goodReport("7031854546")
847
- *
848
- */
849
- goodReport(id: string): Promise<void>;
850
- /**
851
- * Report an unsuccessful solve
852
- *
853
- * @param {string} id The id of the captcha solve
854
- *
855
- * @returns {Promise<void>} Resolves on completion
856
- * @throws APIError
857
- * @example
858
- * solver.badReport("7031854546")
859
- */
860
- badReport(id: string): Promise<void>;
861
- }
862
- export {};
1
+ export interface paramsRecaptcha {
2
+ pageurl: string;
3
+ googlekey: string;
4
+ invisible?: 0 | 1;
5
+ datas?: string;
6
+ domain?: string;
7
+ cookies?: string;
8
+ userAgent?: string;
9
+ header_acao?: boolean;
10
+ pingback?: string;
11
+ soft_id?: number;
12
+ proxy?: string;
13
+ proxytype?: string;
14
+ action?: string;
15
+ enterprise?: 0 | 1;
16
+ min_score?: number;
17
+ version?: string;
18
+ }
19
+ export interface paramsHCaptcha {
20
+ sitekey: string;
21
+ pageurl: string;
22
+ header_acao?: boolean;
23
+ pingback?: string;
24
+ proxy?: string;
25
+ proxytype?: string;
26
+ invisible?: 0 | 1;
27
+ data?: string;
28
+ userAgent?: string;
29
+ soft_id?: number;
30
+ domain?: string;
31
+ }
32
+ export interface paramsFunCaptcha {
33
+ publickey: string;
34
+ pageurl: string;
35
+ surl?: string;
36
+ header_acao?: boolean;
37
+ pingback?: string;
38
+ proxy?: string;
39
+ proxytype?: string;
40
+ userAgent?: string;
41
+ data?: string;
42
+ }
43
+ export interface paramsImageCaptcha {
44
+ body: string;
45
+ phrase?: 0 | 1;
46
+ regsense?: 0 | 1;
47
+ numeric?: 0 | 1 | 2 | 3 | 4;
48
+ calc?: 0 | 1;
49
+ min_len?: 0 | string | number;
50
+ max_len?: 0 | string | number;
51
+ language?: 0 | 1 | 2;
52
+ lang?: string;
53
+ pingback?: string;
54
+ textinstructions?: string;
55
+ }
56
+ export interface paramsGeetest {
57
+ gt: string;
58
+ challenge: string;
59
+ pageurl: string;
60
+ api_server?: string;
61
+ offline?: number | boolean;
62
+ new_captcha?: number | boolean;
63
+ pingback?: string;
64
+ soft_id?: number;
65
+ proxy?: string;
66
+ proxytype?: string;
67
+ userAgent?: string;
68
+ }
69
+ export interface yandexSmart {
70
+ pageurl: string;
71
+ sitekey: string;
72
+ pingback?: string;
73
+ proxy?: string;
74
+ proxytype?: string;
75
+ userAgent?: string;
76
+ }
77
+ export interface paramsGeeTestV4 {
78
+ pageurl: string;
79
+ captcha_id: string;
80
+ pingback?: string;
81
+ proxy?: string;
82
+ proxytype?: string;
83
+ userAgent?: string;
84
+ }
85
+ export interface paramsLemin {
86
+ pageurl: string;
87
+ captcha_id: string;
88
+ div_id: string;
89
+ api_server?: string;
90
+ pingback?: string;
91
+ proxy?: string;
92
+ proxytype?: string;
93
+ }
94
+ export interface paramsAmazonWAF {
95
+ pageurl: string;
96
+ sitekey: string;
97
+ iv: string;
98
+ context: string;
99
+ challenge_script?: string;
100
+ captcha_script?: string;
101
+ header_acao?: boolean;
102
+ pingback?: string;
103
+ soft_id?: number;
104
+ proxy?: string;
105
+ proxytype?: string;
106
+ }
107
+ export interface paramsTurnstile {
108
+ pageurl: string;
109
+ sitekey: string;
110
+ action?: string;
111
+ data?: string;
112
+ header_acao?: boolean;
113
+ pingback?: string;
114
+ soft_id?: number;
115
+ proxy?: string;
116
+ proxytype?: string;
117
+ }
118
+ export interface paramsCapyPuzzle {
119
+ pageurl: string;
120
+ captchakey: string;
121
+ api_server?: string;
122
+ version?: string;
123
+ pingback?: string;
124
+ proxy?: string;
125
+ proxytype?: string;
126
+ }
127
+ export interface paramsCoordinates {
128
+ body: string;
129
+ language?: 0 | 1 | 2;
130
+ lang?: string;
131
+ pingback?: string;
132
+ textinstructions?: string;
133
+ imginstructions?: string;
134
+ }
135
+ export interface paramsDataDome {
136
+ pageurl: string;
137
+ captcha_url: string;
138
+ userAgent: string;
139
+ pingback?: string;
140
+ proxy: string;
141
+ proxytype: string;
142
+ }
143
+ export interface paramsCyberSiARA {
144
+ pageurl: string;
145
+ master_url_id: string;
146
+ userAgent: string;
147
+ pingback?: string;
148
+ proxy?: string;
149
+ proxytype?: string;
150
+ }
151
+ export interface paramsMTCaptcha {
152
+ pageurl: string;
153
+ sitekey: string;
154
+ userAgent?: string;
155
+ pingback?: string;
156
+ proxy?: string;
157
+ proxytype?: string;
158
+ }
159
+ export interface paramsCutcaptcha {
160
+ pageurl: string;
161
+ miseryKey: string;
162
+ apiKey: string;
163
+ pingback?: string;
164
+ proxy?: string;
165
+ proxytype?: string;
166
+ }
167
+ export interface friendlyCaptcha {
168
+ pageurl: string;
169
+ sitekey: string;
170
+ pingback?: string;
171
+ proxy?: string;
172
+ proxytype?: string;
173
+ }
174
+ export interface paramsBoundingBox {
175
+ image: string;
176
+ textinstructions?: string;
177
+ imginstructions?: string;
178
+ }
179
+ export interface paramsGrid {
180
+ body: string;
181
+ recaptcha: number;
182
+ canvas?: number;
183
+ rows?: number;
184
+ cols?: number;
185
+ minClicks?: number;
186
+ maxClicks?: number;
187
+ previousId?: string;
188
+ imgType?: string;
189
+ textinstructions?: string;
190
+ imginstructions?: string;
191
+ canSkip?: number;
192
+ lang?: string;
193
+ pingback?: string;
194
+ }
195
+ export interface paramsTextcaptcha {
196
+ textcaptcha: string;
197
+ lang?: string;
198
+ pingback?: string;
199
+ }
200
+ export interface paramsRotateCaptcha {
201
+ body: string;
202
+ angle?: number;
203
+ pingback?: string;
204
+ lang?: string;
205
+ textinstructions?: string;
206
+ imginstructions?: string;
207
+ }
208
+ export interface paramsKeyCaptcha {
209
+ pageurl: string;
210
+ userId: string;
211
+ sessionId: string;
212
+ webServerSign: string;
213
+ webServerSign2: string;
214
+ pingback?: string;
215
+ proxy?: string;
216
+ proxytype?: string;
217
+ }
218
+ export interface paramsTencent {
219
+ pageurl: string;
220
+ appId: string;
221
+ pingback?: string;
222
+ proxy?: string;
223
+ proxytype?: string;
224
+ }
225
+ export interface paramsAtbCaptcha {
226
+ pageurl: string;
227
+ appId: string;
228
+ apiServer: string;
229
+ pingback?: string;
230
+ proxy?: string;
231
+ proxytype?: string;
232
+ }
233
+ export interface paramsProsopo {
234
+ pageurl: string;
235
+ sitekey: string;
236
+ proxy?: string;
237
+ proxytype?: string;
238
+ }
239
+ export interface paramsCaptchaFox {
240
+ pageurl: string;
241
+ sitekey: string;
242
+ userAgent: string;
243
+ proxy: string;
244
+ proxytype: string;
245
+ }
246
+ export interface paramsVkImage {
247
+ body: string;
248
+ steps: string;
249
+ }
250
+ export interface paramsVkCaptcha {
251
+ redirect_uri: string;
252
+ userAgent: string;
253
+ proxy: string;
254
+ proxytype: string;
255
+ }
256
+ export interface paramsTemu {
257
+ body: string;
258
+ part1: string;
259
+ part2: string;
260
+ part3: string;
261
+ }
262
+ export interface paramsAudioCaptcha {
263
+ body: string;
264
+ lang: string;
265
+ pingback?: string;
266
+ }
267
+ /**
268
+ * An object containing properties of the captcha solution.
269
+ * @typedef {Object} CaptchaAnswer
270
+ * @param {string} data The solution to the captcha
271
+ * @param {string} id The captcha ID
272
+ */
273
+ interface CaptchaAnswer {
274
+ /** The solution to the captcha */
275
+ data: string;
276
+ /** The ID of the captcha solve */
277
+ id: string;
278
+ }
279
+ /**
280
+ * The main 2captcha class, housing all API calls and api interactions.
281
+ *
282
+ */
283
+ export declare class Solver {
284
+ _apikey: string;
285
+ _pollingFrequency: number;
286
+ _headerACAO: number;
287
+ /**
288
+ * The constructor for the 2captcha Solver class.
289
+ *
290
+ * @param {string} apikey The API key to use
291
+ * @param {number} pollingFrequency The frequency to poll for requests
292
+ *
293
+ */
294
+ constructor(apikey: string, pollingFrequency?: number, enableACAO?: boolean);
295
+ /** The API key this instance is using */
296
+ get apikey(): string;
297
+ /** Frequency the instance polls for updates */
298
+ get pollingFrequency(): number;
299
+ /** Set the API key for this instance */
300
+ set apikey(update: string);
301
+ private get in();
302
+ private get res();
303
+ private get defaultPayload();
304
+ /**
305
+ * Returns the remaining account balance.
306
+ *
307
+ * @return {Promise<Number>} Remaining balance
308
+ * @throws APIError
309
+ * @example
310
+ * solver.balance()
311
+ * .then((res) => {
312
+ * console.log(res)
313
+ * })
314
+ */
315
+ balance(): Promise<number>;
316
+ /**
317
+ * @private
318
+ *
319
+ * Polls for a captcha, finding out if it's been completed
320
+ * @param {string} id Captcha ID
321
+ *
322
+ * @returns {Promise<CaptchaAnswer>}
323
+ * @throws APIError
324
+ */
325
+ private pollResponse;
326
+ /**
327
+ * ### Solves a google reCAPTCHA V2 | V3.
328
+ *
329
+ * [Read more about other reCAPTCHA parameters](https://2captcha.com/2captcha-api#solving_recaptchav2_new).
330
+ *
331
+ * @param {{pageurl, googlekey, cookies, proxy, proxytype, userAgent, invisible, datas, pingback, action, enterprise, min_score, version, domain}} params Object
332
+ * @param {string} params.pageurl The URL the captcha appears on.
333
+ * @param {string} params.googlekey Value of `k` or `data-sitekey` parameter you found on page.
334
+ * @param {string} params.cookies Your cookies that will be passed to our worker who solve the captha.
335
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
336
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
337
+ * @param {string} params.userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
338
+ * @param {number} params.invisible `1` - means that reCAPTCHA is invisible. `0` - normal reCAPTCHA.
339
+ * @param {string} params.datas Value of `data-s` parameter you found on page. Curenttly applicable for Google Search and other Google services.
340
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
341
+ * @param {string} params.action Value of `action` parameter you found on page.
342
+ * @param {number} params.enterprise `1` - defines that you're sending reCAPTCHA Enterpise.
343
+ * @param {number} params.min_score The score needed for resolution reCAPTCHA V3. Currently it's almost impossible to get token with score higher than `0.3`
344
+ * @param {string} params.version `v2` defines that you're sending a reCAPTCHA V2. `v3` — defines that you're sending a reCAPTCHA V3.
345
+ * @param {string} params.domain Domain used to load the captcha: `google.com` or `recaptcha.net`
346
+ *
347
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
348
+ * @throws APIError
349
+ * @example
350
+ * solver.recaptcha({
351
+ * pageurl: 'https://2captcha.com/demo/recaptcha-v2',
352
+ * googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u'
353
+ * })
354
+ * .then((res) => {
355
+ * console.log(res);
356
+ * })
357
+ * .catch((err) => {
358
+ * console.log(err);
359
+ * })
360
+ */
361
+ recaptcha(params: paramsRecaptcha): Promise<CaptchaAnswer>;
362
+ /**
363
+ * ### Solves a hCaptcha
364
+ *
365
+ * [Read more about other hCaptcha parameters](https://2captcha.com/2captcha-api#solving_hcaptcha).
366
+ *
367
+ * @param {{sitekey, pageurl, data, userAgent, invisible, pingback, proxy, proxytype, domain}} params Object
368
+ * @param {string} params.sitekey The hcaptcha site key. Value of `k` or `data-sitekey` parameter you found on page.
369
+ * @param {string} params.pageurl The URL the captcha appears on.
370
+ * @param {string} params.data Custom `data` that is used in some implementations of hCaptcha, mostly with `invisible=1`. In most cases you see it as `rqdata` inside network requests. IMPORTANT: you MUST provide `userAgent` if you submit captcha with `data` paramater. The value should match the User-Agent you use when interacting with the target website.
371
+ * @param {string} params.userAgent Your userAgent that will be passed to our worker and used to solve the captcha. Required for hCaptcha with `data` parameter.
372
+ * @param {number} params.invisible Use `1` for invisible version of hcaptcha. Currently it is a very rare case.
373
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. More info [here](https://2captcha.com/2captcha-api#pingback).
374
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
375
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
376
+ * @param {string} params.domain Domain used to load the captcha: `hcaptcha.com` or `js.hcaptcha.com`
377
+ *
378
+ * @returns {Promise<CaptchaAnswer>} The result from the solve
379
+ * @throws APIError
380
+ * @example
381
+ * solver.hcaptcha({
382
+ * pageurl: "https://2captcha.com/demo/hcaptcha",
383
+ * sitekey: "b76cd927-d266-4cfb-a328-3b03ae07ded6"
384
+ * .then((res) => {
385
+ * console.log(res);
386
+ * })
387
+ * .catch((err) => {
388
+ * console.log(err);
389
+ * })
390
+ */
391
+ hcaptcha(params: paramsHCaptcha): Promise<CaptchaAnswer>;
392
+ /**
393
+ * ### Solves a GeeTest Captcha.
394
+ *
395
+ * [Read more about parameters and solving for Geetest captcha](https://2captcha.com/2captcha-api#solving_geetest).
396
+ *
397
+ * @param {{ gt, challenge, api_server, offline, new_captcha,
398
+ * pageurl, pingback, proxy, proxytype, userAgent }} params
399
+ * @param {string} params.gt Value of gt parameter found on site
400
+ * @param {string} params.challenge Value of challenge parameter found on site
401
+ * @param {string} params.pageurl The URL the captcha appears on
402
+ * @param {string} params.api_server The URL of the api_server (recommended)
403
+ * @param {number} params.offline In rare cases `initGeetest` can be called with `offline` parameter on the target page. If the call uses offline: true, set the value to `1`.
404
+ * @param {number} params.new_captcha In rare cases `initGeetest` can be called with `new_captcha` parameter. If the call uses `new_captcha: true`, set the value to `1`. Mostly used with offline parameter.
405
+ * @param {string} params.pingback URL for `pingback` (callback) response that will be sent when captcha is solved. [More info here](https://2captcha.com/2captcha-api#pingback).
406
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
407
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
408
+ * @param {string} params.userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
409
+ *
410
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
411
+ * @throws APIError
412
+ * @example
413
+ * ;(async () => {
414
+ *
415
+ * // Warning: Attention, the `challenge` value is not static but dynamic.
416
+ * // You need to find the queries that makes the captcha on the page to API.
417
+ * // Then you need to make request to this API and get new `challenge`.
418
+ *
419
+ * // For page https://rucaptcha.com/demo/geetest, api address is https://rucaptcha.com/api/v1/captcha-demo/gee-test/init-params?t=${t}
420
+ * // Also note that when make request to API, the request uses the dynamic parameter `t`
421
+ *
422
+ * // You can read more about sending GeeTest here https://2captcha.com/2captcha-api#solving_geetest, or here https://2captcha.com/p/geetest
423
+ * // In this example I solve GeeTest from page https://2captcha.com/demo/geetest
424
+ *
425
+ * const t = new Date().getTime()
426
+ * // below i make a request to get a new `challenge`.
427
+ * const response = await fetch(`https://2captcha.com/api/v1/captcha-demo/gee-test/init-params?t=${t}`)
428
+ * const data = await response.json()
429
+ *
430
+ * const params = {
431
+ * pageurl: 'https://rucaptcha.com/demo/geetest',
432
+ * gt: data.gt,
433
+ * challenge: data.challenge
434
+ * }
435
+ *
436
+ * const res = await solver.geetest(params)
437
+ * try {
438
+ * console.log(res)
439
+ * } catch (error) {
440
+ * console.error(error);
441
+ * }
442
+ * })()
443
+ */
444
+ geetest(params: paramsGeetest): Promise<CaptchaAnswer>;
445
+ /**
446
+ * ### Solves a GeeTest V4 Captcha.
447
+ *
448
+ * This method accepts an object with the following fields: `pageurl`, `captcha_id`, `pingback`, `proxy`, `proxytype`, `userAgent`.
449
+ * The `pageurl` and `captcha_id` fields are required.
450
+ *
451
+ * @param {{pageurl, captcha_id, pingback, proxy, proxytype, userAgent}} params The method geetestV4 takes arguments as an object.
452
+ * @param {string} params.pageurl Full URL of the page where you see Geetest V4 captcha.
453
+ * @param {string} params.captcha_id Required parameter. Value of `captcha_id` parameter you found on target website.
454
+ * @param {string} params.pingback An optional param. [More info here](https://2captcha.com/2captcha-api#pingback).
455
+ * @param {string} params.proxy An optional param. Format: `login:password@123.123.123.123:3128`. You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
456
+ * @param {string} params.proxytype An optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
457
+ * @param {string} params.userAgent An optional param. Your `userAgent` that will be passed to our worker and used to solve the captcha.
458
+ *
459
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
460
+ * @throws APIError
461
+ * @example
462
+ * solver.geetestV4({
463
+ * pageurl: 'https://2captcha.com/demo/geetest-v4',
464
+ * captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73'
465
+ * })
466
+ * .then((res) => {
467
+ * console.log(res)
468
+ * })
469
+ * .catch((err) => {
470
+ * console.log(err);
471
+ * })
472
+ */
473
+ geetestV4(params: paramsGeeTestV4): Promise<CaptchaAnswer>;
474
+ /**
475
+ * ### Method for sending Yandex Smart Captcha.
476
+ *
477
+ * This method accepts an object with the following fields: `pageurl`, `sitekey`, `pingback`, `proxy`, `proxytype`.
478
+ * The `pageurl` and `sitekey` fields are required.
479
+ *
480
+ * @param {{pageurl, sitekey, pingback, proxy, proxytype, userAgent}} params The method takes arguments as an object.
481
+ * @param {string} params.pageurl Required parameter. URL of the page where the captcha is located.
482
+ * @param {string} params.sitekey Required parameter. The `sitekey` value you found on the captcha page.
483
+ * @param {string} params.pingback An optional param.
484
+ * @param {string} params.proxy An optional param. Format: `login:password@123.123.123.123:3128`.
485
+ * @param {string} params.proxytype An optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
486
+ * @param {string} params.userAgent An optional param. Your `userAgent` that will be passed to our worker and used to solve the captcha.
487
+ *
488
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
489
+ * @throws APIError
490
+ * @example
491
+ * solver.yandexSmart({
492
+ * pageurl: "https://captcha-api.yandex.ru/demo",
493
+ * sitekey: "FEXfAbHQsToo97VidNVk3j4dC74nGW1DgdxjtNB9"
494
+ * })
495
+ * .then((res) => {
496
+ * console.log(res)
497
+ * })
498
+ * .catch((err) => {
499
+ * console.log(err);
500
+ * })
501
+ */
502
+ yandexSmart(params: yandexSmart): Promise<CaptchaAnswer>;
503
+ /**
504
+ * ### Solves a image-based captcha.
505
+ *
506
+ * [Read more about parameters for image captcha](https://2captcha.com/2captcha-api#solving_normal_captcha).
507
+ *
508
+ * @param {{ body,
509
+ * phrase,
510
+ * regsense,
511
+ * numeric,
512
+ * calc,
513
+ * min_len,
514
+ * max_len,
515
+ * language,
516
+ * lang,
517
+ * textinstructions,
518
+ * pingback }} params Extra properties to pass to 2captcha.
519
+ * @param {string} params.body Base64 image data for the captcha.
520
+ * @param {number} params.phrase Captcha contains two or more words? `1` - Yes. `0` - No.
521
+ * @param {number} params.regsense Captcha is case sensitive? `1` - Yes. `0` - No.
522
+ * @param {number} params.numeric `0` - not specified. `1` - captcha contains only numbers. `2` - captcha contains only letters. `3` - captcha contains only numbers OR only letters. `4` - captcha MUST contain both numbers AND letters.
523
+ * @param {number} params.calc Does captcha require calculations? (e.g. type the result 4 + 8 = ) `1` - Yes. `0` - No.
524
+ * @param {number} params.min_len `1..20` - minimal number of symbols in captcha. `0` - not specified.
525
+ * @param {number} params.max_len `1..20` - maximal number of symbols in captcha. `0` - not specified.
526
+ * @param {number} params.language `0` - not specified. `1` - Cyrillic captcha. `2` - Latin captcha
527
+ * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
528
+ * @param {string} params.textinstructions Text will be shown to worker to help him to solve the captcha correctly. For example: type red symbols only.
529
+ * @param {string} params.pingback URL for `pingback` (callback) response that will be sent when captcha is solved. [More info here](https://2captcha.com/2captcha-api#pingback).
530
+ *
531
+ * @returns {Promise<CaptchaAnswer>} The result from the solve
532
+ * @throws APIError
533
+ * @example
534
+ * const imageBase64 = fs.readFileSync("./tests/media/imageCaptcha_6e584.png", "base64")
535
+ *
536
+ * solver.imageCaptcha({
537
+ * body: imageBase64,
538
+ * numeric: 4,
539
+ * min_len: 5,
540
+ * max_len: 5
541
+ * })
542
+ * .then((res) => {
543
+ * console.log(res);
544
+ * })
545
+ * .catch((err) => {
546
+ * console.log(err);
547
+ * })
548
+ */
549
+ imageCaptcha(params: paramsImageCaptcha): Promise<CaptchaAnswer>;
550
+ /**
551
+ * ### Solves Arkose Labs FunCaptcha.
552
+ *
553
+ * [Read more](https://2captcha.com/2captcha-api#solving_funcaptcha_new) about other solving and other parameters for Arkose Labs FunCaptcha.
554
+ *
555
+ * @param {{pageurl, publicKey, surl, data, pingback, proxy, proxytype, userAgent}} params Object
556
+ * @param {string} params.publicKey The FunCaptcha Public Key
557
+ * @param {string} params.pageurl The URL to the website the captcha is seen on
558
+ * @param {string} params.surl The FunCaptcha Service URL (recommended)
559
+ * @param {string} params.data Custom data to pass to FunCaptcha. For example: `'data': '{"blob": "foo"}'`.
560
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
561
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
562
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
563
+ * @param {string} params.userAgent Your `userAgent` that will be passed to our worker and used to solve the captcha.
564
+ *
565
+ * @returns {Promise<CaptchaAnswer>} The result from the solve
566
+ * @throws APIError
567
+ *
568
+ * @example
569
+ * solver.funCaptcha({
570
+ * pageurl: "https://funcaptcha.com/tile-game-lite-mode/fc/api/nojs/?pkey=804380F4-6844-FFA1-ED4E-5877CA1F1EA4&lang=en",
571
+ * publickey: "804380F4-6844-FFA1-ED4E-5877CA1F1EA4"
572
+ * })
573
+ * .then((res) => {
574
+ * console.log(res);
575
+ * })
576
+ * .catch((err) => {
577
+ * console.log(err);
578
+ * })
579
+ */
580
+ funCaptcha(params: paramsFunCaptcha): Promise<CaptchaAnswer>;
581
+ /**
582
+ *
583
+ * ### Solves a Lemin captcha
584
+ *
585
+ * [Read more about other Lemin captcha parameters](https://2captcha.com/2captcha-api#lemin).
586
+ *
587
+ * @param {{ pageurl, captcha_id, div_id, api_server, pingback, proxy, proxytype}} params Object
588
+ * @param {string} params.pageurl The URL the captcha appears on.
589
+ * @param {string} params.captcha_id Value of `captcha_id` parameter you found on page.
590
+ * @param {string} params.div_id Value `id` of captcha pareent `<div></div>` element.
591
+ * @param {string} params.api_server The domain part of script URL you found on page. Default value: `https://api.leminnow.com/`
592
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
593
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
594
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
595
+ *
596
+ * @example
597
+ * solver.lemin({
598
+ * pageurl:'https://2captcha.com/demo/lemin',
599
+ * captcha_id: 'CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b',
600
+ * div_id: 'lemin-cropped-captcha',
601
+ * api_server: 'api.leminnow.com'
602
+ * })
603
+ * .then((res) => {
604
+ * console.log(res);
605
+ * })
606
+ * .catch((err) => {
607
+ * console.log(err);
608
+ * })
609
+ */
610
+ lemin(params: paramsLemin): Promise<CaptchaAnswer>;
611
+ /**
612
+ *
613
+ * ### Solves Amazon WAF captcha
614
+ *
615
+ * [Read more about "Amazon WAF" captcha](https://2captcha.com/2captcha-api#amazon-waf).
616
+ *
617
+ * @param {{ pageurl, sitekey, iv, context, challenge_script, captcha_script, pingback, proxy, proxytype}} params The `amazonWaf` method takes arguments as an object. Thus, the `pageurl`, `sitekey`, `iv`, `context` fields in the passed object are mandatory.
618
+ * @param {string} params.pageurl Is the full `URL` of page where you were challenged by the captcha.
619
+ * @param {string} params.sitekey Is a value of `key` parameter in the page source.
620
+ * @param {string} params.iv Is a value of `iv` parameter in the page source.
621
+ * @param {string} params.context Is a value of `context` parameter in the page source.
622
+ * @param {string} params.challenge_script The source URL of `challenge.js` script on the page.
623
+ * @param {string} params.captcha_script The source URL of `captcha.js` script on the page.
624
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
625
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
626
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
627
+ *
628
+ * @example
629
+ * solver.amazonWaf({
630
+ * pageurl: "https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest",
631
+ * sitekey: "AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AHMDLodoefdvyOnsHMRtEKQAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMUX+ZqwwuANRnZujSAgEQgDvHSxUQmVBuyUtumoW2n4ccTG7xQN1r3X/zz41qmQaYv9SSSvQrjIoDXKaUQ23tVb4ii8+uljuRdz/HPA==",
632
+ * context: "9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb+sUNLoukWedAQZKrlY4RdbOOzvcFqmD/ZepQFS9N5w15Exr4VwnVq+HIxTsDJwRviElWCdzKDebN/mk8/eX2n7qJi5G3Riq0tdQw9+C4diFZU5E97RSeahejOAAJTDqduqW6uLw9NsjJBkDRBlRjxjn5CaMMo5pYOxYbGrM8Un1JH5DMOLeXbq1xWbC17YSEoM1cRFfTgOoc+VpCe36Ai9Kc=",
633
+ * iv: "CgAHbCe2GgAAAAAj",
634
+ * })
635
+ * .then((res) => {
636
+ * console.log(res);
637
+ * })
638
+ * .catch((err) => {
639
+ * console.log(err);
640
+ * })
641
+ */
642
+ amazonWaf(params: paramsAmazonWAF): Promise<CaptchaAnswer>;
643
+ /**
644
+ *
645
+ * ### Solves Cloudflare Turnstile captcha
646
+ *
647
+ * [Read more about Cloudflare Turnstile captcha](https://2captcha.com/2captcha-api#turnstile).
648
+ *
649
+ * @param {{ pageurl, sitekey, action, data, pingback, proxy, proxytype}} params The `cloudflareTurnstile` method takes arguments as an object. Thus, the `pageurl`, `sitekey` fields in the passed object are mandatory.
650
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
651
+ * @param {string} params.sitekey Is a value of `sitekey` parameter in the page source.
652
+ * @param {string} params.action Value of optional `action` parameter you found on page.
653
+ * @param {string} params.data Value of optional `data` parameter you found on page.
654
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
655
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
656
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
657
+ *
658
+ * @example
659
+ * solver.cloudflareTurnstile({
660
+ * pageurl: "https://app.nodecraft.com/login",
661
+ * sitekey: "0x4AAAAAAAAkg0s3VIOD10y4"
662
+ * })
663
+ * .then((res) => {
664
+ * console.log(res);
665
+ * })
666
+ * .catch((err) => {
667
+ * console.log(err);
668
+ * })
669
+ */
670
+ cloudflareTurnstile(params: paramsTurnstile): Promise<CaptchaAnswer>;
671
+ /**
672
+ * ### Solves a Coordinates captcha.
673
+ *
674
+ * @param {{ body, imginstructions, textinstructions, language, lang, pingback }} params parameters Coordinates Captcha as an object.
675
+ * @param {string} params.body Base64-encoded captcha image.
676
+ * @param {string} params.imginstructions Base64-encoded image with instruction for solving captcha.
677
+ * @param {string} params.textinstructions Text will be shown to worker to help him to solve the captcha correctly. For example: click on all objects in red color.
678
+ * @param {number} params.language `0` - not specified. `1` - Cyrillic captcha. `2` - Latin captcha
679
+ * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
680
+ * @param {string} params.pingback URL for `pingback` (callback) response that will be sent when captcha is solved. [More info here](https://2captcha.com/2captcha-api#pingback).
681
+ *
682
+ * @returns {Promise<CaptchaAnswer>} The result from the solve
683
+ *
684
+ * @example
685
+ * const imageBase64 = fs.readFileSync("./tests/media/hCaptchaImage.jpg", "base64")
686
+ *
687
+ * solver.coordinates({
688
+ * body: imageBase64,
689
+ * textinstructions: 'Select all photos containing the boat'
690
+ * })
691
+ * .then((res) => {
692
+ * console.log(res);
693
+ * })
694
+ * .catch((err) => {
695
+ * console.log(err);
696
+ * })
697
+ */
698
+ coordinates(params: paramsCoordinates): Promise<CaptchaAnswer>;
699
+ /**
700
+ * ### Solves Capy Puzzle captcha
701
+ *
702
+ * @param {{ pageurl, captchakey, api_server, version, pingback, proxy, proxytype}} params Parameters Capy Puzzle Captcha as an object.
703
+ * @param {string} params.pageurl Full `URL`of the page where you see the captcha.
704
+ * @param {string} params.captchakey Value of `captchakey` parameter you found on page.
705
+ * @param {string} params.api_server The domain part of script URL you found on page. Default value: `https://jp.api.capy.me/`.
706
+ * @param {string} params.version The version of captcha task: `puzzle` (assemble a puzzle) or `avatar` (drag an object)..
707
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
708
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
709
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
710
+ *
711
+ * @example
712
+ * solver.capyPuzzle({
713
+ * pageurl: "https://www.capy.me/account/register/",
714
+ * captchakey: "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w"
715
+ * })
716
+ * .then((res) => {
717
+ * console.log(res);
718
+ * })
719
+ * .catch((err) => {
720
+ * console.log(err);
721
+ * })
722
+ */
723
+ capyPuzzle(params: paramsCapyPuzzle): Promise<CaptchaAnswer>;
724
+ /**
725
+ * ### Solves DataDome captcha
726
+ *
727
+ * @param {{ pageurl, captcha_url, userAgent, pingback, proxy, proxytype}} params Parameters DataDome Captcha as an object.
728
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
729
+ * @param {string} params.captcha_url The value of the `src` parameter for the `iframe` element containing the captcha on the page.
730
+ * @param {string} params.userAgent ser-Agent of your MODERN browser
731
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
732
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
733
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
734
+ *
735
+ * @example
736
+ * solver.dataDome({
737
+ * pageurl: "https://rendezvousparis.hermes.com/client/register",
738
+ * captcha_url: "https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAEuQtkf4k1c0ABZhYZA%3D%3D&hash=789361B674144528D0B7EE76B35826&cid=mY4z7GNmh7Nt1lAFwpbNHAOcWPhyPgjHD2K1Pm~Od1iEKYLUnK3t7N2ZGUj8OqDK65cnwJHtHwd~t902vlwpSBA5l4ZHbS1Qszv~jEuEUJNQ_jMAjar2Kj3kq20MRJYh&t=fe&referer=https%3A%2F%2Frendezvousparis.hermes.com%2Fclient%2Fregister&s=40119&e=67fef144ac1a54dbd7507776367d2f9d5e36ec3add17fa22f3cb881db8385838",
739
+ * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
740
+ * proxy: "1.2.3.4:8888:user:password",
741
+ * proxytype: "http"
742
+ * })
743
+ * .then((res) => {
744
+ * console.log(res);
745
+ * })
746
+ * .catch((err) => {
747
+ * console.log(err);
748
+ * })
749
+ */
750
+ dataDome(params: paramsDataDome): Promise<CaptchaAnswer>;
751
+ /**
752
+ * ### Solves CyberSiARA captcha
753
+ *
754
+ * @param {{ pageurl, master_url_id, userAgent, pingback, proxy, proxytype}} params Parameters CyberSiARA Captcha as an object.
755
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
756
+ * @param {string} params.master_url_id The value of `MasterUrlId` parameter obtained from the request to the endpoint `API/CyberSiara/GetCyberSiara`.
757
+ * @param {string} params.userAgent ser-Agent of your MODERN browser
758
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
759
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
760
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
761
+ *
762
+ * @example
763
+ * solver.cyberSiARA({
764
+ * pageurl: "https://www.cybersiara.com/book-a-demo",
765
+ * master_url_id: "OXR2LVNvCuXykkZbB8KZIfh162sNT8S2",
766
+ * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
767
+ * })
768
+ * .then((res) => {
769
+ * console.log(res);
770
+ * })
771
+ * .catch((err) => {
772
+ * console.log(err);
773
+ * })
774
+ */
775
+ cyberSiARA(params: paramsCyberSiARA): Promise<CaptchaAnswer>;
776
+ /**
777
+ * ### Solves MTCaptcha
778
+ *
779
+ * @param {{ pageurl, sitekey, userAgent, pingback, proxy, proxytype}} params Parameters MTCaptcha as an object.
780
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
781
+ * @param {string} params.sitekey TThe value of `sitekey` parameter found on the page.
782
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
783
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
784
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
785
+ *
786
+ * @example
787
+ * solver.mtCaptcha({
788
+ * pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html",
789
+ * sitekey: "MTPublic-DemoKey9M"
790
+ * })
791
+ * .then((res) => {
792
+ * console.log(res);
793
+ * })
794
+ * .catch((err) => {
795
+ * console.log(err);
796
+ * })
797
+ */
798
+ mtCaptcha(params: paramsMTCaptcha): Promise<CaptchaAnswer>;
799
+ /**
800
+ * ### Solves a Cutcaptcha.
801
+ *
802
+ * Use this method to solve Cutcaptcha. Returns the response in JSON.
803
+ * [Read more about Cutcaptcha Method](https://2captcha.com/2captcha-api#cutcaptcha).
804
+ *
805
+ * @param {{ pageurl, miseryKey, apiKey, pingback, proxy, proxytype }} params Parameters for solving Cutcaptcha as an object.
806
+ * @param {string} params.pageurl The URL where the captcha is located.
807
+ * @param {string} params.miseryKey The value of `CUTCAPTCHA_MISERY_KEY` variable defined on page.
808
+ * @param {string} params.apiKey The value of `data-apikey` attribute of iframe's body. Also the name of javascript file included on the page
809
+ * @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
810
+ * @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
811
+ * @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
812
+ *
813
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
814
+ * @throws APIError
815
+ *
816
+ * @example
817
+ * solver.cutCaptcha({
818
+ * pageurl: "https://mysite.com/page/with/cutcaptcha",
819
+ * miseryKey: "098e6a849af406142e3150dbf4e6d0538db2b51f",
820
+ * apiKey: "SAs61IAI",
821
+ * })
822
+ * .then((res) => {
823
+ * console.log(res);
824
+ * })
825
+ * .catch((err) => {
826
+ * console.log(err);
827
+ * })
828
+ */
829
+ cutCaptcha(params: paramsCutcaptcha): Promise<CaptchaAnswer>;
830
+ /**
831
+ * ### Solves Friendly Captcha
832
+ *
833
+ * @param {{ pageurl, sitekey, pingback, proxy, proxytype}} params Parameters Friendly Captcha as an object.
834
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
835
+ * @param {string} params.sitekey The value of `data-apikey` or `data-sitekey` parameter found on the page.
836
+ * @param {string} params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
837
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
838
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
839
+ *
840
+ * @example
841
+ * solver.friendlyCaptcha({
842
+ * pageurl: "https://geizhals.de/?liftban=1&from=/455973138?fsean=5901747021356",
843
+ * sitekey: "FCMST5VUMCBOCGQ9"
844
+ * })
845
+ * .then((res) => {
846
+ * console.log(res);
847
+ * })
848
+ * .catch((err) => {
849
+ * console.log(err);
850
+ * })
851
+ */
852
+ friendlyCaptcha(params: friendlyCaptcha): Promise<CaptchaAnswer>;
853
+ /**
854
+ * ### Bounding Box Method
855
+ *
856
+ * @param {{ image, textinstructions, imginstructions }} params Parameters Bounding Box Method as an object.
857
+ * @param {string} params.image Image containing data for markup. The image must be encoded in `Base64` format.
858
+ * @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
859
+ * @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
860
+ *
861
+ * @example
862
+ * solver.boundingBox({
863
+ * image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgG...",
864
+ * textinstructions: "Select cars in the image"
865
+ * })
866
+ * .then((res) => {
867
+ * console.log(res);
868
+ * })
869
+ * .catch((err) => {
870
+ * console.log(err);
871
+ * })
872
+ */
873
+ boundingBox(params: paramsBoundingBox): Promise<CaptchaAnswer>;
874
+ /**
875
+ * ### Grid method
876
+ *
877
+ * The method can be used to bypass tasks where a grid is applied to an image and you need to click on grid tiles, like reCAPTCHA or hCaptcha images.
878
+ *
879
+ * @param {{ body, textinstructions, imginstructions, rows, cols, minClicks, maxClicks, imgType, previousId, canSkip, lang, pingback}} params Parameters Grid Method as an object.
880
+ * @param {string} params.body `Base64`- encoded captcha image.
881
+ * @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
882
+ * @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
883
+ * @param {number} params.rows Number of rows in grid captcha.
884
+ * @param {number} params.cols Number of columns in grid captcdha.
885
+ * @param {number} params.minClicks The minimum number of tiles that must be selected. Can't be more than `rows` * `cols`.
886
+ * @param {number} params.maxClicks The maximum number of tiles that can be selected on the image.
887
+ * @param {string} params.imgType The image will be recognized using Computer Vision. Supported value options: `recaptcha`, `hcaptcha`, `funcaptcha`, `funcaptcha_compare`. [More info here](https://2captcha.com/2captcha-api#grid).
888
+ * @param {string} params.previousId Id of your previous request with the same captcha challenge.
889
+ * @param {number} params.canSkip Set the value to `1` only if it's possible that there's no images matching to the instruction. We'll provide a button "No matching images" to worker and you will receive `No_matching_images` as answer.
890
+ * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
891
+ * @param {string} params.pingback params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
892
+ *
893
+ * @example
894
+ * solver.grid({
895
+ * body: 'iVBORw0KGgoAAAANSUhEUgAAAcIA...',
896
+ * textinstructions: "Select cars in the image",
897
+ * imginstructions: '/9j/4AAQSkZJRgABAQEA...'
898
+ * })
899
+ * .then((res) => {
900
+ * console.log(res);
901
+ * })
902
+ * .catch((err) => {
903
+ * console.log(err);
904
+ * })
905
+ */
906
+ grid(params: paramsGrid): Promise<CaptchaAnswer>;
907
+ /**
908
+ * ### Text Captcha method
909
+ *
910
+ * Text Captcha is a type of captcha that is represented as text and doesn't contain images. Usually you have to answer a question to pass the verification. For example: "If tomorrow is Saturday, what day is today?".
911
+ * [Read more about Text Captcha Method](https://2captcha.com/2captcha-api#text-captcha).
912
+ *
913
+ * @param {{ textcaptcha, lang, pingback}} params Parameters Text Captcha Method as an object.
914
+ * @param {string} params.textcaptcha Text Captcha is a type of captcha that is represented as text and doesn't contain images. Usually you have to answer a question to pass the verification.
915
+ * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
916
+ * @param {string} params.pingback params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
917
+ *
918
+ * @example
919
+ * solver.text({
920
+ * textcaptcha: "If tomorrow is Saturday, what day is today?",
921
+ * lang: 'en'
922
+ * })
923
+ * .then((res) => {
924
+ * console.log(res);
925
+ * })
926
+ * .catch((err) => {
927
+ * console.log(err);
928
+ * })
929
+ */
930
+ text(params: paramsTextcaptcha): Promise<CaptchaAnswer>;
931
+ /**
932
+ * ### Canvas method
933
+ *
934
+ * This method can be used to bypass tasks in which you need to circle an object or line in an image.
935
+ * [Read more about Canvas Method](https://2captcha.com/2captcha-api#canvas).
936
+ *
937
+ * @param {{ body, textinstructions, imginstructions, canSkip, lang, pingback}} params Parameters Canvas as an object.
938
+ * @param {string} params.body `Base64`- encoded captcha image.
939
+ * @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
940
+ * @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
941
+ * @param {number} params.canSkip Set the value to `1` only if it's possible that there's no images matching to the instruction. We'll provide a button "No matching images" to worker and you will receive `No_matching_images` as answer.
942
+ * @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
943
+ * @param {string} params.pingback params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
944
+ *
945
+ * @example
946
+ * solver.canvas({
947
+ * body: 'iVBORw0KGgoAAAANSgAAAcIA...',
948
+ * imginstructions: '/9j/4AAQSkZJRgABAQEA...',
949
+ * textinstructions: 'Highlight the red CIRCLE'
950
+ * })
951
+ * .then((res) => {
952
+ * console.log(res);
953
+ * })
954
+ * .catch((err) => {
955
+ * console.log(err);
956
+ * })
957
+ */
958
+ canvas(params: paramsGrid): Promise<CaptchaAnswer>;
959
+ /**
960
+ * ### Rotate method
961
+ *
962
+ * This method can be used to solve a captcha that asks to rotate an object. It is mostly used to bypass FunCaptcha. Returns the rotation angle.
963
+ * [Read more about Rotate Method](https://2captcha.com/2captcha-api#solving_rotatecaptcha).
964
+ *
965
+ * @param {{ body, angle, pingback, lang, textinstructions, imginstructions }} params Parameters for solving Rotate Captcha as an object.
966
+ * @param {string} params.body Base64-encoded image of the captcha that needs to be rotated.
967
+ * @param {number} params.angle Angle to which the captcha needs to be rotated to solve it correctly. Value between `0` to `360`.
968
+ * @param {string} params.textinstructions Optional param. Text instruction that will be shown to worker to help solve the captcha correctly.
969
+ * @param {string} params.imginstructions Optional param. Base64-encoded image instruction that will be shown to worker to help solve the captcha correctly.
970
+ * @param {string} params.lang Optional param. Language code for worker to use while solving the captcha.
971
+ * @param {string} params.pingback Optional param. URL for pingback (callback) response when captcha is solved.
972
+ *
973
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
974
+ * @throws APIError
975
+ *
976
+ * @example
977
+ * solver.rotate({
978
+ * body: "iVBORw0KGgoAAAANSUhEUgAAAcIA...",
979
+ * angle: 15,
980
+ * textinstructions: "Rotate the object to the correct position"
981
+ * })
982
+ * .then((res) => {
983
+ * console.log(res);
984
+ * })
985
+ * .catch((err) => {
986
+ * console.log(err);
987
+ * })
988
+ */
989
+ rotate(params: paramsRotateCaptcha): Promise<CaptchaAnswer>;
990
+ /**
991
+ * ### Solves a KeyCaptcha.
992
+ *
993
+ * This method can be used to solve a KeyCaptcha. It is mostly used to bypass captchas that use KeyCaptcha technology.
994
+ * [Read more about KeyCaptcha Method](https://2captcha.com/2captcha-api#solving_keycaptcha).
995
+ *
996
+ * @param {{ pageurl, userId, sessionId, webServerSign, webServerSign2, pingback, proxy, proxytype }} params Parameters for solving KeyCaptcha as an object.
997
+ * @param {string} params.pageurl The URL where the captcha is located.
998
+ * @param {string} params.userId Value of `s_s_c_user_id` parameter you found on page.
999
+ * @param {string} params.sessionId Value of `s_s_c_session_id` parameter you found on page.
1000
+ * @param {string} params.webServerSign Value of `s_s_c_web_server_sign` parameter you found on page.
1001
+ * @param {string} params.webServerSign2 Value of `s_s_c_web_server_sign2` parameter you found on page.
1002
+ * @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
1003
+ * @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
1004
+ * @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
1005
+ *
1006
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
1007
+ * @throws APIError
1008
+ *
1009
+ * @example
1010
+ * solver.keyCaptcha({
1011
+ * pageurl: "https://2captcha.com/demo/keycaptcha",
1012
+ * userId: "184015",
1013
+ * sessionId: "11975dc265ce9174a54edb1619af15b7",
1014
+ * webServerSign: "73ef77fd3cf0ce02947d9088bdc8412a",
1015
+ * webServerSign2: "93836d9e7007f38f072ce07d89bb7e2b"
1016
+ * })
1017
+ * .then((res) => {
1018
+ * console.log(res);
1019
+ * })
1020
+ * .catch((err) => {
1021
+ * console.log(err);
1022
+ * })
1023
+ */
1024
+ keyCaptcha(params: paramsKeyCaptcha): Promise<CaptchaAnswer>;
1025
+ /**
1026
+ * ### Solves a Tencent.
1027
+ *
1028
+ * Use this method to solve Tencent captcha. Returns a token.
1029
+ * [Read more about Tencent Method](https://2captcha.com/2captcha-api#tencent).
1030
+ *
1031
+ * @param {{ pageurl, appId, pingback, proxy, proxytype }} params Parameters for solving Tencent as an object.
1032
+ * @param {string} params.pageurl The URL where the captcha is located.
1033
+ * @param {string} params.appId The value of `appId` parameter in the website source code.
1034
+ * @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
1035
+ * @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
1036
+ * @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
1037
+ *
1038
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
1039
+ * @throws APIError
1040
+ *
1041
+ * @example
1042
+ * solver.tencent({
1043
+ * pageurl: "https://mysite.com/page/with/tencent",
1044
+ * appId: "189956587"
1045
+ * })
1046
+ * .then((res) => {
1047
+ * console.log(res);
1048
+ * })
1049
+ * .catch((err) => {
1050
+ * console.log(err);
1051
+ * })
1052
+ */
1053
+ tencent(params: paramsTencent): Promise<CaptchaAnswer>;
1054
+ /**
1055
+ * ### Solves a atbCAPTCHA.
1056
+ *
1057
+ * Use this method to solve atbCAPTCHA captcha. Returns a token.
1058
+ * [Read more about atbCAPTCHA Method](https://2captcha.com/2captcha-api#atb-captcha).
1059
+ *
1060
+ * @param {{ pageurl, appId, apiServer, pingback, proxy, proxytype }} params Parameters for solving atbCAPTCHA as an object.
1061
+ * @param {string} params.pageurl The URL where the captcha is located.
1062
+ * @param {string} params.appId The value of `appId` parameter in the website source code.
1063
+ * @param {string} params.apiServer The value of `apiServer` parameter in the website source code.
1064
+ * @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
1065
+ * @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
1066
+ * @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
1067
+ *
1068
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
1069
+ * @throws APIError
1070
+ *
1071
+ * @example
1072
+ * solver.atbCaptcha({
1073
+ * pageurl: "https://mysite.com/page/with/tencent",
1074
+ * appId: "af25e409b33d722a95e56a230ff8771c",
1075
+ apiServer: "https://cap.aisecurius.com"
1076
+ * })
1077
+ * .then((res) => {
1078
+ * console.log(res);
1079
+ * })
1080
+ * .catch((err) => {
1081
+ * console.log(err);
1082
+ * })
1083
+ */
1084
+ atbCaptcha(params: paramsAtbCaptcha): Promise<CaptchaAnswer>;
1085
+ /**
1086
+ * ### Solves Prosopo
1087
+ *
1088
+ * Use this method to solve Prosopo. Returns a token.
1089
+ * [Read more about Prosopo Method](https://2captcha.com/2captcha-api#prosopo-procaptcha).
1090
+ *
1091
+ * @param {{ pageurl, sitekey, proxy, proxytype}} params Parameters Prosopo as an object.
1092
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
1093
+ * @param {string} params.sitekey The value of `data-apikey` or `data-sitekey` parameter found on the page.
1094
+ * @param {string} params.proxy Optional param. Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
1095
+ * @param {string} params.proxytype Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
1096
+ *
1097
+ * @example
1098
+ * solver.prosopo({
1099
+ * pageurl: "https://geizhals.de/?liftban=1&from=/455973138?fsean=5901747021356",
1100
+ * sitekey: "FCMST5VUMCBOCGQ9"
1101
+ * })
1102
+ * .then((res) => {
1103
+ * console.log(res);
1104
+ * })
1105
+ * .catch((err) => {
1106
+ * console.log(err);
1107
+ * })
1108
+ */
1109
+ prosopo(params: paramsProsopo): Promise<CaptchaAnswer>;
1110
+ /**
1111
+ * ### Solves CaptchaFox
1112
+ *
1113
+ * Use this method to solve CaptchaFox. Returns a token.
1114
+ * [Read more about CaptchaFox Method](https://2captcha.com/2captcha-api#captchafox).
1115
+ *
1116
+ * @param {{ pageurl, sitekey, userAgent, proxy, proxytype}} params Parameters CaptchaFox as an object.
1117
+ * @param {string} params.pageurl Full `URL` of the page where you see the captcha.
1118
+ * @param {string} params.sitekey The value of `sitekey` parameter found on the page.
1119
+ * @param {string} params.userAgent User-Agent of your MODERN browser
1120
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
1121
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
1122
+ *
1123
+ * @example
1124
+ * solver.captchaFox({
1125
+ * pageurl: "https://mysite.com/page/with/captchafox",
1126
+ * sitekey: "sk_ILKWN...",
1127
+ * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit...",
1128
+ * proxy: "login:password@1.2.3.4:8888",
1129
+ * proxytype: "HTTP"
1130
+ * })
1131
+ * .then((res) => {
1132
+ * console.log(res);
1133
+ * })
1134
+ * .catch((err) => {
1135
+ * console.log(err);
1136
+ * })
1137
+ */
1138
+ captchaFox(params: paramsCaptchaFox): Promise<CaptchaAnswer>;
1139
+ /**
1140
+ * ### VkImage method
1141
+ *
1142
+ * This method can be used to solve a captcha VkImage. Returns the number of steps and solution value in the target site's API format.
1143
+ * [Read more about VkImage Method](https://2captcha.com/2captcha-api#vkcaptcha).
1144
+ *
1145
+ * @param {{ body, steps }} params Parameters for solving VkImage Captcha.
1146
+ * @param {string} params.body Captcha image as a base64 string.
1147
+ * @param {string} params.steps Array of steps.
1148
+ *
1149
+ * @returns {Promise<CaptchaAnswer>} The result from the solve.
1150
+ * @throws APIError
1151
+ *
1152
+ * @example
1153
+ * solver.vkimage({
1154
+ * body: "iVBORw0KGgoAAAANSUhEUgAAAcIA...",
1155
+ * steps: "[5,19,4,3,23,8,20,4,18,10,6,10,5,12,13,18,9,14,9,15,12,19,3,12,...]",
1156
+ * })
1157
+ * .then((res) => {
1158
+ * console.log(res);
1159
+ * })
1160
+ * .catch((err) => {
1161
+ * console.log(err);
1162
+ * })
1163
+ */
1164
+ vkimage(params: paramsVkImage): Promise<CaptchaAnswer>;
1165
+ /**
1166
+ * ### Solves VkCaptcha
1167
+ *
1168
+ * This method can be used to solve VK Captcha using a token. Returns a token.
1169
+ * [Read more about VkCaptcha Method](https://2captcha.com/2captcha-api#vkcaptcha).
1170
+ *
1171
+ * @param {{ redirect_uri, userAgent, proxy, proxytype}} params Parameters VkCaptcha as an object.
1172
+ * @param {string} params.redirect_uri The URL that is returned for requests to the captchas API.
1173
+ * @param {string} params.userAgent User-Agent of your MODERN browser
1174
+ * @param {string} params.proxy Format: `login:password@123.123.123.123:3128` You can find more info about proxies [here](https://2captcha.com/2captcha-api#proxies).
1175
+ * @param {string} params.proxytype Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
1176
+ *
1177
+ * @example
1178
+ * solver.vkcaptcha({
1179
+ * redirect_uri: "https://id.vk.com/not_robot_captcha?domain=vk.com&session_token=eyJhbGciOiJBM...",
1180
+ * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit...",
1181
+ * proxy: "login:password@1.2.3.4:8888",
1182
+ * proxytype: "HTTP"
1183
+ * })
1184
+ * .then((res) => {
1185
+ * console.log(res);
1186
+ * })
1187
+ * .catch((err) => {
1188
+ * console.log(err);
1189
+ * })
1190
+ */
1191
+ vkcaptcha(params: paramsVkCaptcha): Promise<CaptchaAnswer>;
1192
+ /**
1193
+ * ### Solves Temu
1194
+ *
1195
+ * This method can be used to solve Temu captcha. Returns a coordinates.
1196
+ * [Read more about Temu Method](https://2captcha.com/2captcha-api#temucaptcha).
1197
+ *
1198
+ * @param {{ body, part1, part2, part3}} params Parameters Temu as an object.
1199
+ * @param {string} params.body Main captcha image as a base64 string.
1200
+ * @param {string} params.part1 Tile element as a base64 string.
1201
+ * @param {string} params.part2 Tile element as a base64 string.
1202
+ * @param {string} params.part3 Tile element as a base64 string.
1203
+ *
1204
+ * @example
1205
+ * solver.temu({
1206
+ * body: "data:image/png;base64,iVBORw0KG...",
1207
+ * part1: "data:image/png;base64,iVBORw0KG...",
1208
+ * part2: "data:image/png;base64,iVBORw0KG...",
1209
+ * part3: "data:image/png;base64,iVBORw0KG..."
1210
+ * })
1211
+ * .then((res) => {
1212
+ * console.log(res);
1213
+ * })
1214
+ * .catch((err) => {
1215
+ * console.log(err);
1216
+ * })
1217
+ */
1218
+ temu(params: paramsTemu): Promise<CaptchaAnswer>;
1219
+ /**
1220
+ * ### Method for solving Audio captcha.
1221
+ *
1222
+ * Use the following method to bypass an audio captcha (`mp3` formats only). You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
1223
+ * [Read more about Audio recognition Method](https://2captcha.com/2captcha-api#audio-recognition).
1224
+ *
1225
+ * @param {{ body, lang, pingback }} params Object containing parameters for the audio captcha.
1226
+ * @param {string} params.body Base64 encoded audio file in `mp3` format. Max file size: 1 MB.
1227
+ * @param {string} params.lang The language of audio record. Supported languages are: "en", "ru", "de", "el", "pt", "fr".
1228
+ * @param {string} [params.pingback] URL for pingback response once captcha is solved.
1229
+ *
1230
+ * @returns {Promise<CaptchaAnswer>} The result from solving the audio captcha.
1231
+ * @throws APIError
1232
+ * @example
1233
+ * solver.audio({
1234
+ * body: "SUQzBAAAAAAAHFRTU0UAAAA...",
1235
+ * lang: "en"
1236
+ * })
1237
+ * .then((res) => {
1238
+ * console.log(res);
1239
+ * })
1240
+ * .catch((err) => {
1241
+ * console.log(err);
1242
+ * })
1243
+ */
1244
+ audio(params: paramsAudioCaptcha): Promise<CaptchaAnswer>;
1245
+ /**
1246
+ * Reports a captcha as correctly solved.
1247
+ *
1248
+ * @param {string} id The ID of the captcha
1249
+ * @throws APIError
1250
+ * @example
1251
+ * solver.goodReport("7031854546")
1252
+ *
1253
+ */
1254
+ goodReport(id: string): Promise<void>;
1255
+ /**
1256
+ * Report an unsuccessful solve
1257
+ *
1258
+ * @param {string} id The id of the captcha solve
1259
+ *
1260
+ * @returns {Promise<void>} Resolves on completion
1261
+ * @throws APIError
1262
+ * @example
1263
+ * solver.badReport("7031854546")
1264
+ */
1265
+ badReport(id: string): Promise<void>;
1266
+ }
1267
+ export {};
863
1268
  //# sourceMappingURL=2captcha.d.ts.map