@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.
- package/.github/workflows/publish-to-npm.yml +30 -0
- package/LICENSE +20 -20
- package/README.md +854 -578
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/structs/2captcha.d.ts +1267 -862
- package/dist/structs/2captcha.d.ts.map +1 -1
- package/dist/structs/2captcha.js +1874 -1207
- package/dist/structs/2captchaError.d.ts +5 -5
- package/dist/structs/2captchaError.js +275 -275
- package/dist/structs/2captchaServer.d.ts +35 -35
- package/dist/structs/2captchaServer.js +91 -91
- package/dist/structs/constants/constants.d.ts +14 -14
- package/dist/structs/constants/constants.js +25 -25
- package/dist/structs/providers/providers.d.ts +5 -5
- package/dist/structs/providers/providers.js +20 -20
- package/dist/utils/checkCaptchaParams.d.ts +15 -7
- package/dist/utils/checkCaptchaParams.d.ts.map +1 -1
- package/dist/utils/checkCaptchaParams.js +185 -132
- package/dist/utils/fetch.d.ts +3 -3
- package/dist/utils/fetch.js +6 -6
- package/dist/utils/generic.d.ts +20 -20
- package/dist/utils/generic.js +47 -47
- package/dist/utils/renameParams.d.ts +11 -11
- package/dist/utils/renameParams.d.ts.map +1 -1
- package/dist/utils/renameParams.js +50 -36
- package/package.json +76 -63
- package/tsconfig.json +70 -70
package/README.md
CHANGED
|
@@ -1,578 +1,854 @@
|
|
|
1
|
-
<a href="https://github.com/2captcha/2captcha-python"><img src="https://github.com/user-attachments/assets/37e1d860-033b-4cf3-a158-468fc6b4debc" width="82" height="30"></a>
|
|
2
|
-
<a href="https://github.com/2captcha/2captcha-javascript"><img src="https://github.com/user-attachments/assets/371b271e-33c3-4217-af21-b95517a4677c" width="36" height="30"></a>
|
|
3
|
-
<a href="https://github.com/2captcha/2captcha-go"><img src="https://github.com/user-attachments/assets/ab22182e-6cb2-41fa-91f4-d5e89c6d7c6f" width="63" height="30"></a>
|
|
4
|
-
<a href="https://github.com/2captcha/2captcha-ruby"><img src="https://github.com/user-attachments/assets/0270d56f-79b0-4c95-9b09-4de89579914b" width="75" height="30"></a>
|
|
5
|
-
<a href="https://github.com/2captcha/2captcha-cpp"><img src="https://github.com/user-attachments/assets/36de8512-acfd-44fb-bb1f-b7c793a3f926" width="45" height="30"></a>
|
|
6
|
-
<a href="https://github.com/2captcha/2captcha-php"><img src="https://github.com/user-attachments/assets/e8797843-3f61-4fa9-a155-ab0b21fb3858" width="52" height="30"></a>
|
|
7
|
-
<a href="https://github.com/2captcha/2captcha-java"><img src="https://github.com/user-attachments/assets/a3d923f6-4fec-4c07-ac50-e20da6370911" width="50" height="30"></a>
|
|
8
|
-
<a href="https://github.com/2captcha/2captcha-csharp"><img src="https://github.com/user-attachments/assets/f4d449de-780b-49ed-bb0a-b70c82ec4b32" width="38" height="30"></a>
|
|
9
|
-
|
|
10
|
-
# JavaScript module for 2Captcha API (captcha solver)
|
|
11
|
-
|
|
12
|
-
The easiest way to quickly integrate the [2Captcha]
|
|
13
|
-
Examples of API requests for different captcha types are available on the [JavaScript captcha solver]
|
|
14
|
-
|
|
15
|
-
- [JavaScript module for 2Captcha API (captcha solver)](#javascript-module-for-2captcha-api-captcha-solver)
|
|
16
|
-
- [Installation](#installation)
|
|
17
|
-
- [Configuration](#configuration)
|
|
18
|
-
- [TwoCaptcha instance options](#twocaptcha-instance-options)
|
|
19
|
-
- [Solve captcha](#solve-captcha)
|
|
20
|
-
- [Image
|
|
21
|
-
- [reCAPTCHA v2](#recaptcha-v2)
|
|
22
|
-
- [reCAPTCHA v3](#recaptcha-v3)
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [GeeTest](#geetest-captcha)
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
###
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
.
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
.
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
.
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
.
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
.
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
###
|
|
513
|
-
|
|
514
|
-
<sup>[API method description.](https://2captcha.com/2captcha-api#
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
```js
|
|
519
|
-
solver.
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
})
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
[
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
1
|
+
<a href="https://github.com/2captcha/2captcha-python"><img src="https://github.com/user-attachments/assets/37e1d860-033b-4cf3-a158-468fc6b4debc" width="82" height="30"></a>
|
|
2
|
+
<a href="https://github.com/2captcha/2captcha-javascript"><img src="https://github.com/user-attachments/assets/371b271e-33c3-4217-af21-b95517a4677c" width="36" height="30"></a>
|
|
3
|
+
<a href="https://github.com/2captcha/2captcha-go"><img src="https://github.com/user-attachments/assets/ab22182e-6cb2-41fa-91f4-d5e89c6d7c6f" width="63" height="30"></a>
|
|
4
|
+
<a href="https://github.com/2captcha/2captcha-ruby"><img src="https://github.com/user-attachments/assets/0270d56f-79b0-4c95-9b09-4de89579914b" width="75" height="30"></a>
|
|
5
|
+
<a href="https://github.com/2captcha/2captcha-cpp"><img src="https://github.com/user-attachments/assets/36de8512-acfd-44fb-bb1f-b7c793a3f926" width="45" height="30"></a>
|
|
6
|
+
<a href="https://github.com/2captcha/2captcha-php"><img src="https://github.com/user-attachments/assets/e8797843-3f61-4fa9-a155-ab0b21fb3858" width="52" height="30"></a>
|
|
7
|
+
<a href="https://github.com/2captcha/2captcha-java"><img src="https://github.com/user-attachments/assets/a3d923f6-4fec-4c07-ac50-e20da6370911" width="50" height="30"></a>
|
|
8
|
+
<a href="https://github.com/2captcha/2captcha-csharp"><img src="https://github.com/user-attachments/assets/f4d449de-780b-49ed-bb0a-b70c82ec4b32" width="38" height="30"></a>
|
|
9
|
+
|
|
10
|
+
# JavaScript module for 2Captcha API (captcha solver)
|
|
11
|
+
|
|
12
|
+
The easiest way to quickly integrate the [2Captcha] captcha-solving service into your code and automate the solving of any type of captcha.
|
|
13
|
+
Examples of API requests for different captcha types are available on the [JavaScript captcha solver] page.
|
|
14
|
+
|
|
15
|
+
- [JavaScript module for 2Captcha API (captcha solver)](#javascript-module-for-2captcha-api-captcha-solver)
|
|
16
|
+
- [Installation](#installation)
|
|
17
|
+
- [Configuration](#configuration)
|
|
18
|
+
- [TwoCaptcha instance options](#twocaptcha-instance-options)
|
|
19
|
+
- [Solve captcha](#solve-captcha)
|
|
20
|
+
- [Image Captcha](#image-captcha)
|
|
21
|
+
- [reCAPTCHA v2](#recaptcha-v2)
|
|
22
|
+
- [reCAPTCHA v3](#recaptcha-v3)
|
|
23
|
+
- [FunCaptcha](#funcaptcha)
|
|
24
|
+
- [GeeTest](#geetest-captcha)
|
|
25
|
+
- [GeeTest V4](#geetest-v4-captcha)
|
|
26
|
+
- [Yandex Smart Captcha](#yandex-smart-captcha)
|
|
27
|
+
- [Lemin Cropped Captcha](#lemin-cropped-captcha)
|
|
28
|
+
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
|
29
|
+
- [Amazon WAF](#amazon-waf)
|
|
30
|
+
- [Capy](#capy)
|
|
31
|
+
- [ClickCaptcha](#clickcaptcha)
|
|
32
|
+
- [DataDome CAPTCHA](#datadome-captcha)
|
|
33
|
+
- [CyberSiARA](#cybersiara)
|
|
34
|
+
- [MTCaptcha](#mtcaptcha)
|
|
35
|
+
- [Friendly Captcha](#friendly-captcha)
|
|
36
|
+
- [Bounding Box Method](#bounding-box-method)
|
|
37
|
+
- [Grid](#grid)
|
|
38
|
+
- [Text Captcha](#text-captcha)
|
|
39
|
+
- [Canvas](#canvas)
|
|
40
|
+
- [Rotate](#rotate)
|
|
41
|
+
- [KeyCaptcha](#keycaptcha)
|
|
42
|
+
- [Cutcaptcha](#cutcaptcha)
|
|
43
|
+
- [Tencent](#tencent)
|
|
44
|
+
- [atbCAPTCHA](#atbcaptcha)
|
|
45
|
+
- [Prosopo](#prosopo)
|
|
46
|
+
- [CaptchaFox](#captchafox)
|
|
47
|
+
- [VkImage](#vkimage)
|
|
48
|
+
- [VkCaptcha](#vkcaptcha)
|
|
49
|
+
- [Temu](#temu)
|
|
50
|
+
- [Audio Captcha](#audio-captcha)
|
|
51
|
+
- [Other methods](#other-methods)
|
|
52
|
+
- [goodReport](#goodreport)
|
|
53
|
+
- [badReport](#badreport)
|
|
54
|
+
- [balance](#balance)
|
|
55
|
+
- [Proxies](#proxies)
|
|
56
|
+
- [Examples](#examples)
|
|
57
|
+
- [Examples using Puppeteer](#examples-using-puppeteer)
|
|
58
|
+
- [Useful articles](#useful-articles)
|
|
59
|
+
- [Get in touch](#get-in-touch)
|
|
60
|
+
- [Join the team 👪](#join-the-team-)
|
|
61
|
+
- [License](#license)
|
|
62
|
+
- [Graphics and Trademarks](#graphics-and-trademarks)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
This package can be installed with NPM:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
npm install @2captcha/captcha-solver
|
|
70
|
+
```
|
|
71
|
+
or Yarn:
|
|
72
|
+
```sh
|
|
73
|
+
yarn add @2captcha/captcha-solver
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
TwoCaptcha instance can be created like this:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
const TwoCaptcha = require("@2captcha/captcha-solver")
|
|
82
|
+
const solver = new TwoCaptcha.Solver("<Your 2captcha api key>")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Also, there are a few options that can be configured:
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
const apiKey = 'YOUR_API_KEY'
|
|
89
|
+
const pollingInterval = 10
|
|
90
|
+
|
|
91
|
+
const solver = new TwoCaptcha.Solver(apiKey, pollingInterval)
|
|
92
|
+
```
|
|
93
|
+
### TwoCaptcha instance options
|
|
94
|
+
|
|
95
|
+
| Option | Default value | Description |
|
|
96
|
+
| ---------------- | -------------- | -------------------------------------------------------------------------------------------- |
|
|
97
|
+
| apiKey | - | Your API key |
|
|
98
|
+
| pollingInterval | 5000 | Interval in milliseconds between requests to the `res.php` API endpoint. Setting values less than 5 seconds is not recommended |
|
|
99
|
+
|
|
100
|
+
## Solve captcha
|
|
101
|
+
|
|
102
|
+
When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.
|
|
103
|
+
|
|
104
|
+
### Captcha options
|
|
105
|
+
|
|
106
|
+
| Option | Default Value | Description |
|
|
107
|
+
| ------------- | ------------- | -------------------------------------------------------------------------------------------------- |
|
|
108
|
+
| numeric | 0 | Defines if the captcha contains numeric or other symbols [see more info in the API docs][post options] |
|
|
109
|
+
| min_len | 0 | minimal answer length |
|
|
110
|
+
| max_len | 0 | maximum answer length |
|
|
111
|
+
| phrase | 0 | defines if the answer contains multiple words or not |
|
|
112
|
+
| regsense | 0 | defines if the answer is case sensitive |
|
|
113
|
+
| calc | 0 | defines captcha requires calculation |
|
|
114
|
+
| lang | - | defines the captcha language; see the [list of supported languages] |
|
|
115
|
+
| textinstructions| - | hint or task text shown to workers with the captcha |
|
|
116
|
+
|
|
117
|
+
Below you can find basic examples for every captcha type, check out the code below.
|
|
118
|
+
|
|
119
|
+
### Image captcha
|
|
120
|
+
|
|
121
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_normal_captcha)</sup>
|
|
122
|
+
|
|
123
|
+
To bypass a normal captcha (distorted text on an image) use the following method. This method can also be used to recognize any text in an image.
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
const imageBase64 = fs.readFileSync("./examples/media/imageCaptcha_6e584.png", "base64")
|
|
127
|
+
|
|
128
|
+
solver.imageCaptcha({
|
|
129
|
+
body: imageBase64,
|
|
130
|
+
numeric: 4,
|
|
131
|
+
min_len: 5,
|
|
132
|
+
max_len: 5
|
|
133
|
+
})
|
|
134
|
+
.then((res) => {
|
|
135
|
+
console.log(res);
|
|
136
|
+
})
|
|
137
|
+
.catch((err) => {
|
|
138
|
+
console.log(err);
|
|
139
|
+
})
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### reCAPTCHA V2
|
|
143
|
+
|
|
144
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav2_new)</sup>
|
|
145
|
+
|
|
146
|
+
Use the following method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
solver.recaptcha({
|
|
150
|
+
pageurl: 'https://2captcha.com/demo/recaptcha-v2',
|
|
151
|
+
googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u'
|
|
152
|
+
})
|
|
153
|
+
.then((res) => {
|
|
154
|
+
console.log(res);
|
|
155
|
+
})
|
|
156
|
+
.catch((err) => {
|
|
157
|
+
console.log(err);
|
|
158
|
+
})
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### reCAPTCHA V3
|
|
162
|
+
|
|
163
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav3)</sup>
|
|
164
|
+
|
|
165
|
+
This method provides a reCAPTCHA V3 solver and returns a token.
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
solver.recaptcha({
|
|
169
|
+
pageurl: 'https://2captcha.com/demo/recaptcha-v3',
|
|
170
|
+
googlekey: '6Lcyqq8oAAAAAJE7eVJ3aZp_hnJcI6LgGdYD8lge',
|
|
171
|
+
version: "v3",
|
|
172
|
+
min_score: "0.4",
|
|
173
|
+
action: 'demo_action'
|
|
174
|
+
})
|
|
175
|
+
.then((res) => {
|
|
176
|
+
console.log(res);
|
|
177
|
+
})
|
|
178
|
+
.catch((err) => {
|
|
179
|
+
console.log(err);
|
|
180
|
+
})
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### FunCaptcha
|
|
184
|
+
|
|
185
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_funcaptcha_new)</sup>
|
|
186
|
+
|
|
187
|
+
FunCaptcha (Arkoselabs) solving method. Returns a token.
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
solver.funCaptcha({
|
|
191
|
+
pageurl: "https://funcaptcha.com/tile-game-lite-mode/fc/api/nojs/?pkey=804380F4-6844-FFA1-ED4E-5877CA1F1EA4&lang=en",
|
|
192
|
+
publickey: "804380F4-6844-FFA1-ED4E-5877CA1F1EA4"
|
|
193
|
+
})
|
|
194
|
+
.then((res) => {
|
|
195
|
+
console.log(res);
|
|
196
|
+
})
|
|
197
|
+
.catch((err) => {
|
|
198
|
+
console.log(err);
|
|
199
|
+
})
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### GeeTest Captcha
|
|
203
|
+
|
|
204
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_geetest)</sup>
|
|
205
|
+
|
|
206
|
+
Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.
|
|
207
|
+
|
|
208
|
+
```js
|
|
209
|
+
// Read more about `challenge` on the page https://2captcha.com/p/geetest
|
|
210
|
+
solver.geetest({
|
|
211
|
+
pageurl: 'https://2captcha.com/demo/geetest',
|
|
212
|
+
gt: '81388ea1fc187e0c335c0a8907ff2625',
|
|
213
|
+
challenge: '<you need to get a new challenge value each time>'
|
|
214
|
+
})
|
|
215
|
+
.then((res) => {
|
|
216
|
+
console.log(res);
|
|
217
|
+
})
|
|
218
|
+
.catch((err) => {
|
|
219
|
+
console.log(err);
|
|
220
|
+
})
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### GeeTest V4 Captcha
|
|
224
|
+
|
|
225
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#geetest-v4)</sup>
|
|
226
|
+
|
|
227
|
+
Use this method to solve GeeTest v4. Returns the response in JSON.
|
|
228
|
+
|
|
229
|
+
```js
|
|
230
|
+
solver.geetestV4({
|
|
231
|
+
pageurl: 'https://2captcha.com/demo/geetest-v4',
|
|
232
|
+
captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73'
|
|
233
|
+
})
|
|
234
|
+
.then((res) => {
|
|
235
|
+
console.log(res);
|
|
236
|
+
})
|
|
237
|
+
.catch((err) => {
|
|
238
|
+
console.log(err);
|
|
239
|
+
})
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Yandex Smart Captcha
|
|
243
|
+
|
|
244
|
+
Use this method to solve Yandex Smart Captcha and obtain a token to bypass the protection.
|
|
245
|
+
|
|
246
|
+
```js
|
|
247
|
+
solver.yandexSmart({
|
|
248
|
+
pageurl: "https://captcha-api.yandex.ru/demo",
|
|
249
|
+
sitekey: "FEXfAbHQsToo97VidNVk3j4dC74nGW1DgdxjtNB9"
|
|
250
|
+
})
|
|
251
|
+
.then((res) => {
|
|
252
|
+
console.log(res);
|
|
253
|
+
})
|
|
254
|
+
.catch((err) => {
|
|
255
|
+
console.log(err);
|
|
256
|
+
})
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Lemin Cropped Captcha
|
|
260
|
+
|
|
261
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#lemin)</sup>
|
|
262
|
+
|
|
263
|
+
Use this method to solve Lemin and obtain a token to bypass the protection.
|
|
264
|
+
|
|
265
|
+
```js
|
|
266
|
+
solver.lemin({
|
|
267
|
+
pageurl:'https://2captcha.com/demo/lemin',
|
|
268
|
+
captcha_id: 'CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b',
|
|
269
|
+
div_id: 'lemin-cropped-captcha',
|
|
270
|
+
api_server: 'api.leminnow.com'
|
|
271
|
+
})
|
|
272
|
+
.then((res) => {
|
|
273
|
+
console.log(res);
|
|
274
|
+
})
|
|
275
|
+
.catch((err) => {
|
|
276
|
+
console.log(err);
|
|
277
|
+
})
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Cloudflare Turnstile
|
|
281
|
+
|
|
282
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#turnstile)</sup>
|
|
283
|
+
|
|
284
|
+
Use this method to solve Cloudflare Turnstile. Returns JSON with the token.
|
|
285
|
+
|
|
286
|
+
Turnstile captcha has two types, one of them is Cloudflare Turnstile Challenge page. For Turnstile Challenge page cases, we have a [demo](https://github.com/2captcha/cloudflare-demo). Try this [demo](https://github.com/2captcha/cloudflare-demo) if you need to solve Cloudflare Turnstile Challenge page captcha.
|
|
287
|
+
|
|
288
|
+
```js
|
|
289
|
+
solver.cloudflareTurnstile({
|
|
290
|
+
pageurl: "https://app.nodecraft.com/login",
|
|
291
|
+
sitekey: "0x4AAAAAAAAkg0s3VIOD10y4"
|
|
292
|
+
})
|
|
293
|
+
.then((res) => {
|
|
294
|
+
console.log(res);
|
|
295
|
+
})
|
|
296
|
+
.catch((err) => {
|
|
297
|
+
console.log(err);
|
|
298
|
+
})
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Amazon WAF
|
|
302
|
+
|
|
303
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#amazon-waf)</sup>
|
|
304
|
+
|
|
305
|
+
Use this method to solve Amazon WAF Captcha also known as AWS WAF Captcha is a part of Intelligent threat mitigation for Amazon AWS. Returns JSON with the token.
|
|
306
|
+
|
|
307
|
+
```js
|
|
308
|
+
//INFO: The `context` value is dynamic, it is necessary to take the actual value from the page each time.
|
|
309
|
+
solver.amazonWaf({
|
|
310
|
+
pageurl: "https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest",
|
|
311
|
+
sitekey: "AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AHMDLodoefdvyOnsHMRt...",
|
|
312
|
+
context: "9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ...",
|
|
313
|
+
iv: "CgAHbCe2GgAAAAAj",
|
|
314
|
+
})
|
|
315
|
+
.then((res) => {
|
|
316
|
+
console.log(res);
|
|
317
|
+
})
|
|
318
|
+
.catch((err) => {
|
|
319
|
+
console.log(err);
|
|
320
|
+
})
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Capy
|
|
324
|
+
|
|
325
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_capy)</sup>
|
|
326
|
+
|
|
327
|
+
Token-based method to bypass Capy puzzle captcha.
|
|
328
|
+
|
|
329
|
+
```js
|
|
330
|
+
solver.capyPuzzle({
|
|
331
|
+
pageurl: "https://www.capy.me/account/register/",
|
|
332
|
+
captchakey: "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w"
|
|
333
|
+
})
|
|
334
|
+
.then((res) => {
|
|
335
|
+
console.log(res);
|
|
336
|
+
})
|
|
337
|
+
.catch((err) => {
|
|
338
|
+
console.log(err);
|
|
339
|
+
})
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### DataDome CAPTCHA
|
|
343
|
+
|
|
344
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#datadome)</sup>
|
|
345
|
+
|
|
346
|
+
Use this method to solve DataDome and obtain a token to bypass the protection.
|
|
347
|
+
|
|
348
|
+
> [!IMPORTANT]
|
|
349
|
+
> To solve the DataDome captcha, you must use a proxy. It is recommended to use [residential proxies][Buy residential proxies].
|
|
350
|
+
|
|
351
|
+
```js
|
|
352
|
+
solver.dataDome({
|
|
353
|
+
pageurl: "https://rendezvousparis.hermes.com/client/register",
|
|
354
|
+
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",
|
|
355
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
|
|
356
|
+
proxy: "login:password@1.2.3.4:8888", // The (Username : Password @ Address : Port) of our chosen proxy
|
|
357
|
+
proxytype: "http" // The 'Type' of proxy, http, https, socks, ect.
|
|
358
|
+
})
|
|
359
|
+
.then((res) => {
|
|
360
|
+
console.log(res);
|
|
361
|
+
})
|
|
362
|
+
.catch((err) => {
|
|
363
|
+
console.log(err);
|
|
364
|
+
})
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### CyberSiARA
|
|
368
|
+
|
|
369
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#cybersiara)</sup>
|
|
370
|
+
|
|
371
|
+
Use this method to solve CyberSiARA and obtain a token to bypass the protection.
|
|
372
|
+
|
|
373
|
+
```js
|
|
374
|
+
solver.cyberSiARA({
|
|
375
|
+
pageurl: "https://www.cybersiara.com/book-a-demo",
|
|
376
|
+
master_url_id: "OXR2LVNvCuXykkZbB8KZIfh162sNT8S2",
|
|
377
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
|
|
378
|
+
})
|
|
379
|
+
.then((res) => {
|
|
380
|
+
console.log(res);
|
|
381
|
+
})
|
|
382
|
+
.catch((err) => {
|
|
383
|
+
console.log(err);
|
|
384
|
+
})
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### MTCaptcha
|
|
388
|
+
|
|
389
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#mtcaptcha)</sup>
|
|
390
|
+
|
|
391
|
+
Use this method to solve MTCaptcha and obtain a token to bypass the protection.
|
|
392
|
+
|
|
393
|
+
```js
|
|
394
|
+
solver.mtCaptcha({
|
|
395
|
+
pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html",
|
|
396
|
+
sitekey: "MTPublic-DemoKey9M"
|
|
397
|
+
})
|
|
398
|
+
.then((res) => {
|
|
399
|
+
console.log(res);
|
|
400
|
+
})
|
|
401
|
+
.catch((err) => {
|
|
402
|
+
console.log(err);
|
|
403
|
+
})
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Friendly Captcha
|
|
407
|
+
|
|
408
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#friendly-captcha)</sup>
|
|
409
|
+
|
|
410
|
+
Use this method to solve Friendly Captcha and obtain a token to bypass the protection.
|
|
411
|
+
|
|
412
|
+
> [!IMPORTANT]
|
|
413
|
+
> To successfully use the received token, the captcha widget must not be loaded on the page. To do this, you need to abort request to `/friendlycaptcha/...module.min.js` on the page. When the captcha widget is already loaded on the page, there is a high probability that the received token will not work.
|
|
414
|
+
|
|
415
|
+
```js
|
|
416
|
+
solver.friendlyCaptcha({
|
|
417
|
+
pageurl: "https://geizhals.de/?liftban=1&from=/455973138?fsean=5901747021356",
|
|
418
|
+
sitekey: "FCMST5VUMCBOCGQ9"
|
|
419
|
+
})
|
|
420
|
+
.then((res) => {
|
|
421
|
+
console.log(res);
|
|
422
|
+
})
|
|
423
|
+
.catch((err) => {
|
|
424
|
+
console.log(err);
|
|
425
|
+
})
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### ClickCaptcha
|
|
429
|
+
|
|
430
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#coordinates)</sup>
|
|
431
|
+
|
|
432
|
+
The ClickCaptcha method returns the coordinates of points on the captcha image. It can be used if you need to click on particular points in the image.
|
|
433
|
+
|
|
434
|
+
```js
|
|
435
|
+
const imageBase64 = fs.readFileSync("./tests/media/coordinates.jpg", "base64")
|
|
436
|
+
|
|
437
|
+
solver.coordinates({
|
|
438
|
+
body: imageBase64,
|
|
439
|
+
textinstructions: 'Select all photos containing the boat'
|
|
440
|
+
})
|
|
441
|
+
.then((res) => {
|
|
442
|
+
console.log(res);
|
|
443
|
+
})
|
|
444
|
+
.catch((err) => {
|
|
445
|
+
console.log(err);
|
|
446
|
+
})
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Bounding Box Method
|
|
450
|
+
|
|
451
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#bounding_box)</sup>
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
Use Bounding Box Method when you need to select objects on the image. To do this, you need to pass the markup instructions and image for markup. The instructions can be sent as text or as an image encoded in `base64` format.
|
|
455
|
+
> [!IMPORTANT]
|
|
456
|
+
> You must to send instruction `imginstructions` or `textinstructions`.
|
|
457
|
+
|
|
458
|
+
```js
|
|
459
|
+
solver.boundingBox({
|
|
460
|
+
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAACwCAIAAAB...",
|
|
461
|
+
textinstructions: "Circle all the cars in the image.",
|
|
462
|
+
})
|
|
463
|
+
.then((res) => {
|
|
464
|
+
console.log(res);
|
|
465
|
+
})
|
|
466
|
+
.catch((err) => {
|
|
467
|
+
console.log(err);
|
|
468
|
+
})
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### Grid
|
|
472
|
+
|
|
473
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#grid)</sup>
|
|
474
|
+
|
|
475
|
+
This method allows to solve any captcha where image can be divided into equal parts like reCAPTCHA V2. A grid is applied above the image. And you receive the numbers clicked boxes.
|
|
476
|
+
|
|
477
|
+
> [!IMPORTANT]
|
|
478
|
+
> You must to send instruction `imginstructions` or `textinstructions`.
|
|
479
|
+
|
|
480
|
+
```js
|
|
481
|
+
solver.grid({
|
|
482
|
+
body: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAACwCAIAAAB...",
|
|
483
|
+
textinstructions: "Select cars in the image"
|
|
484
|
+
})
|
|
485
|
+
.then((res) => {
|
|
486
|
+
console.log(res);
|
|
487
|
+
})
|
|
488
|
+
.catch((err) => {
|
|
489
|
+
console.log(err);
|
|
490
|
+
})
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### Text Captcha
|
|
494
|
+
|
|
495
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_text_captcha)</sup>
|
|
496
|
+
|
|
497
|
+
This method can be used to bypass a captcha that requires answering a question provided in clear text.
|
|
498
|
+
|
|
499
|
+
```js
|
|
500
|
+
solver.textCaptcha({
|
|
501
|
+
textcaptcha: "If tomorrow is Saturday, what day is today?",
|
|
502
|
+
lang: 'en'
|
|
503
|
+
})
|
|
504
|
+
.then((res) => {
|
|
505
|
+
console.log(res);
|
|
506
|
+
})
|
|
507
|
+
.catch((err) => {
|
|
508
|
+
console.log(err);
|
|
509
|
+
})
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Canvas
|
|
513
|
+
|
|
514
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#canvas)</sup>
|
|
515
|
+
|
|
516
|
+
The canvas method can be used when you need to draw a line around an object on an image. Returns a set of points' coordinates to draw a polygon.
|
|
517
|
+
|
|
518
|
+
```js
|
|
519
|
+
solver.canvas({
|
|
520
|
+
body: 'iVBORw0KGgoAAAANSgAAAcIA...',
|
|
521
|
+
imginstructions: '/9j/4AAQSkZJRgABAQEA...',
|
|
522
|
+
textinstructions: 'Highlight the red CIRCLE'
|
|
523
|
+
})
|
|
524
|
+
.then((res) => {
|
|
525
|
+
console.log(res);
|
|
526
|
+
})
|
|
527
|
+
.catch((err) => {
|
|
528
|
+
console.log(err);
|
|
529
|
+
})
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Rotate
|
|
533
|
+
|
|
534
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_rotatecaptcha)</sup>
|
|
535
|
+
|
|
536
|
+
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.
|
|
537
|
+
|
|
538
|
+
```js
|
|
539
|
+
solver.rotate({
|
|
540
|
+
body: imageBase64,
|
|
541
|
+
textinstructions: "Rotate the object to the correct position"
|
|
542
|
+
})
|
|
543
|
+
.then((res) => {
|
|
544
|
+
console.log(res);
|
|
545
|
+
})
|
|
546
|
+
.catch((err) => {
|
|
547
|
+
console.log(err);
|
|
548
|
+
})
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### KeyCaptcha
|
|
552
|
+
|
|
553
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_keycaptcha)</sup>
|
|
554
|
+
|
|
555
|
+
Token-based method to solve KeyCaptcha.
|
|
556
|
+
|
|
557
|
+
```js
|
|
558
|
+
solver.keyCaptcha({
|
|
559
|
+
pageurl: "https://2captcha.com/demo/keycaptcha",
|
|
560
|
+
userId: '184015',
|
|
561
|
+
sessionId: '0917788cad24ad3a69813c4fcd556061',
|
|
562
|
+
webServerSign: '02f7f9669f1269595c4c69bcd4a3c52e',
|
|
563
|
+
webServerSign2: 'd888700f6f324ec0f32b44c32c50bde1'
|
|
564
|
+
})
|
|
565
|
+
.then((res) => {
|
|
566
|
+
console.log(res);
|
|
567
|
+
})
|
|
568
|
+
.catch((err) => {
|
|
569
|
+
console.log(err);
|
|
570
|
+
})
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### Cutcaptcha
|
|
574
|
+
|
|
575
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#cutcaptcha)</sup>
|
|
576
|
+
|
|
577
|
+
Use this method to solve Cutcaptcha. Returns the response in JSON.
|
|
578
|
+
|
|
579
|
+
```js
|
|
580
|
+
solver.cutCaptcha({
|
|
581
|
+
pageurl: "https://mysite.com/page/with/cutcaptcha",
|
|
582
|
+
misery_key: "098e6a849af406142e3150dbf4e6d0538db2b51f",
|
|
583
|
+
api_key: "SAs61IAI",
|
|
584
|
+
})
|
|
585
|
+
.then((res) => {
|
|
586
|
+
console.log(res);
|
|
587
|
+
})
|
|
588
|
+
.catch((err) => {
|
|
589
|
+
console.log(err);
|
|
590
|
+
})
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### Tencent
|
|
594
|
+
|
|
595
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#tencent)</sup>
|
|
596
|
+
|
|
597
|
+
Use this method to solve Tencent captcha. Returns the response in JSON.
|
|
598
|
+
|
|
599
|
+
```js
|
|
600
|
+
solver.tencent({
|
|
601
|
+
pageurl: "https://mysite.com/page/with/tencent",
|
|
602
|
+
appId: "189956587"
|
|
603
|
+
})
|
|
604
|
+
.then((res) => {
|
|
605
|
+
console.log(res);
|
|
606
|
+
})
|
|
607
|
+
.catch((err) => {
|
|
608
|
+
console.log(err);
|
|
609
|
+
})
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### atbCAPTCHA
|
|
613
|
+
|
|
614
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#atb-captcha)</sup>
|
|
615
|
+
|
|
616
|
+
Use this method to solve atbCAPTCHA challenge. Returns a token to bypass the captcha.
|
|
617
|
+
|
|
618
|
+
```js
|
|
619
|
+
solver.atbCaptcha({
|
|
620
|
+
pageurl: "https://mysite.com/page/with/atbCAPTCHA",
|
|
621
|
+
appId: "af25e409b33d722a95e56a230ff8771c",
|
|
622
|
+
apiServer: "https://cap.aisecurius.com"
|
|
623
|
+
})
|
|
624
|
+
.then((res) => {
|
|
625
|
+
console.log(res);
|
|
626
|
+
})
|
|
627
|
+
.catch((err) => {
|
|
628
|
+
console.log(err);
|
|
629
|
+
})
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
### Prosopo
|
|
633
|
+
|
|
634
|
+
<sup>[API method description.](http://2captcha.com/2captcha-api#prosopo-procaptcha)</sup>
|
|
635
|
+
|
|
636
|
+
Use this method to solve Prosopo and obtain a token to bypass the protection.
|
|
637
|
+
|
|
638
|
+
```js
|
|
639
|
+
solver.prosopo({
|
|
640
|
+
pageurl: "https://mysite.com/page/with/prosopo",
|
|
641
|
+
sitekey: "5DWvYfCSGqbUiQ..."
|
|
642
|
+
})
|
|
643
|
+
.then((res) => {
|
|
644
|
+
console.log(res);
|
|
645
|
+
})
|
|
646
|
+
.catch((err) => {
|
|
647
|
+
console.log(err);
|
|
648
|
+
})
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
### CaptchaFox
|
|
652
|
+
|
|
653
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#captchafox)</sup>
|
|
654
|
+
|
|
655
|
+
Use this method to solve CaptchaFox and obtain a token to bypass the protection.
|
|
656
|
+
|
|
657
|
+
> [!IMPORTANT]
|
|
658
|
+
> To solve the CaptchaFox, you must use a proxy. It is recommended to use [residential proxies][Buy residential proxies].
|
|
659
|
+
|
|
660
|
+
```js
|
|
661
|
+
solver.captchaFox({
|
|
662
|
+
pageurl: "https://mysite.com/page/with/captchafox",
|
|
663
|
+
sitekey: "sk_ILKWN...",
|
|
664
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit...",
|
|
665
|
+
proxy: "login:password@1.2.3.4:8888", // The (Username : Password @ Address : Port) of our chosen proxy
|
|
666
|
+
proxytype: "http" // The 'Type' of proxy, http, https, socks, ect.
|
|
667
|
+
})
|
|
668
|
+
.then((res) => {
|
|
669
|
+
console.log(res);
|
|
670
|
+
})
|
|
671
|
+
.catch((err) => {
|
|
672
|
+
console.log(err);
|
|
673
|
+
})
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
### VkImage
|
|
677
|
+
|
|
678
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#vkcaptcha)</sup>
|
|
679
|
+
|
|
680
|
+
This method can be used to solve VK captcha using graphical captcha. Returns the number of steps and solution value in the target site's API format.
|
|
681
|
+
|
|
682
|
+
```js
|
|
683
|
+
solver.vkimage({
|
|
684
|
+
body: "iVBORw0KGgoAAAANSUhEUgAAAcIA...",
|
|
685
|
+
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,...]",
|
|
686
|
+
})
|
|
687
|
+
.then((res) => {
|
|
688
|
+
console.log(res);
|
|
689
|
+
})
|
|
690
|
+
.catch((err) => {
|
|
691
|
+
console.log(err);
|
|
692
|
+
})
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### VkCaptcha
|
|
696
|
+
|
|
697
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#vkcaptcha)</sup>
|
|
698
|
+
|
|
699
|
+
Use this method to solve VkCaptcha and obtain a token to bypass the protection.
|
|
700
|
+
|
|
701
|
+
> [!IMPORTANT]
|
|
702
|
+
> To solve the VkCaptcha, you must use a proxy. It is recommended to use [residential proxies][Buy residential proxies].
|
|
703
|
+
|
|
704
|
+
```js
|
|
705
|
+
solver.vkcaptcha({
|
|
706
|
+
redirect_uri: "https://id.vk.com/not_robot_captcha?domain=vk.com&session_token=eyJhbGciOiJBM...",
|
|
707
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit...",
|
|
708
|
+
proxy: "login:password@1.2.3.4:8888", // The (Username : Password @ Address : Port) of our chosen proxy
|
|
709
|
+
proxytype: "http" // The 'Type' of proxy, http, https, socks, ect.
|
|
710
|
+
})
|
|
711
|
+
.then((res) => {
|
|
712
|
+
console.log(res);
|
|
713
|
+
})
|
|
714
|
+
.catch((err) => {
|
|
715
|
+
console.log(err);
|
|
716
|
+
})
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
### Temu
|
|
720
|
+
|
|
721
|
+
<sup>[API method description.](https://2captcha.com/ru/2captcha-api#temucaptcha)</sup>
|
|
722
|
+
|
|
723
|
+
This method can be used to solve Temu captcha. Returns a coordinates.
|
|
724
|
+
|
|
725
|
+
```js
|
|
726
|
+
solver.temu({
|
|
727
|
+
body: "data:image/png;base64,iVBORw0KG...",
|
|
728
|
+
part1: "data:image/png;base64,iVBORw0KG...",
|
|
729
|
+
part2: "data:image/png;base64,iVBORw0KG...",
|
|
730
|
+
part3: "data:image/png;base64,iVBORw0KG...",
|
|
731
|
+
})
|
|
732
|
+
.then((res) => {
|
|
733
|
+
console.log(res);
|
|
734
|
+
})
|
|
735
|
+
.catch((err) => {
|
|
736
|
+
console.log(err);
|
|
737
|
+
})
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
### Audio Captcha
|
|
741
|
+
|
|
742
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#audio-recognition)</sup>
|
|
743
|
+
|
|
744
|
+
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".
|
|
745
|
+
|
|
746
|
+
```js
|
|
747
|
+
solver.audio({
|
|
748
|
+
body: "SUQzBAAAAAAAHFRTU0UAAAA...",
|
|
749
|
+
lang: "en"
|
|
750
|
+
})
|
|
751
|
+
.then((res) => {
|
|
752
|
+
console.log(res);
|
|
753
|
+
})
|
|
754
|
+
.catch((err) => {
|
|
755
|
+
console.log(err);
|
|
756
|
+
})
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
## Other methods
|
|
760
|
+
|
|
761
|
+
### goodReport
|
|
762
|
+
|
|
763
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#reporting-answers)</sup>
|
|
764
|
+
|
|
765
|
+
Use this method to report good captcha answer.
|
|
766
|
+
|
|
767
|
+
```js
|
|
768
|
+
solver.goodReport('7031846604')
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
### badReport
|
|
772
|
+
|
|
773
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#reporting-answers)</sup>
|
|
774
|
+
|
|
775
|
+
Use this method to report bad captcha answer.
|
|
776
|
+
|
|
777
|
+
```js
|
|
778
|
+
solver.badReport('7031854546')
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
### balance
|
|
782
|
+
|
|
783
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#additional-methods)</sup>
|
|
784
|
+
|
|
785
|
+
Use this method to get your account's balance.
|
|
786
|
+
|
|
787
|
+
```js
|
|
788
|
+
solver.balance()
|
|
789
|
+
.then((res) => {
|
|
790
|
+
console.log(res)
|
|
791
|
+
})
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
## Proxies
|
|
795
|
+
|
|
796
|
+
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, keycaptcha, capy puzzle, lemin, turnstile, amazon waf, DataDome, CyberSiARA, MTCaptcha, Friendly Captcha and etc. The proxy will be forwarded to the API to solve the captcha.
|
|
797
|
+
|
|
798
|
+
We have our own proxies that we can offer you. [Buy residential proxies] for avoid restrictions and blocks. [Quick start].
|
|
799
|
+
|
|
800
|
+
Solving reCAPTCHA V2 using proxy:
|
|
801
|
+
```js
|
|
802
|
+
solver.recaptcha({
|
|
803
|
+
pageurl: 'https://2captcha.com/demo/recaptcha-v2',
|
|
804
|
+
googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u',
|
|
805
|
+
proxy: 'HTTPS',
|
|
806
|
+
proxytype: 'login:password@123.123.123.123:3128'
|
|
807
|
+
})
|
|
808
|
+
```
|
|
809
|
+
## Examples
|
|
810
|
+
|
|
811
|
+
Examples of solving all supported captcha types are located in the [examples] directory.
|
|
812
|
+
|
|
813
|
+
## Examples using Puppeteer
|
|
814
|
+
Also we have a separate repositories you can find examples of solving captcha using Puppeteer.
|
|
815
|
+
At the moment we have implemented examples of bypassing Cloudflare Challenge page and reCAPTCHA.
|
|
816
|
+
Links:
|
|
817
|
+
- [Cloudflare Bypassing Demo using Puppeteer](https://github.com/2captcha/cloudflare-demo)
|
|
818
|
+
- [Solving reCAPTCHA V2 using Puppeteer and clicks](https://github.com/2captcha/puppeteer-recaptcha-solver-using-clicks)
|
|
819
|
+
- [Custom Slider Captcha Demo](https://github.com/2captcha/custom-slider-demo)
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
## Useful articles
|
|
823
|
+
* [How to bypass captcha using JavaScript](https://2captcha.com/blog/how-to-use-javascript-to-bypass-captcha#how-to-solve-and-bypass-a-captcha-with-javascript-using-npm-package-2captchacaptcha-solver)
|
|
824
|
+
* [Bypassing Cloudflare Challenge with Puppeteer and 2Captcha](https://2captcha.com/blog/bypassing-cloudflare-challenge-with-puppeteer-and-2captcha)
|
|
825
|
+
* [How to bypass Geetest v4 CAPTCHA](https://2captcha.com/blog/geetest-v4-support)
|
|
826
|
+
* [Automatic reCAPTCHA V3 resolution - a tutorial for developers and customers](https://2captcha.com/blog/recaptcha-v3-automatic-resolution)
|
|
827
|
+
|
|
828
|
+
## Get in touch
|
|
829
|
+
|
|
830
|
+
<a href="mailto:support@2captcha.com"><img src="https://github.com/user-attachments/assets/539df209-7c85-4fa5-84b4-fc22ab93fac7" width="80" height="30"></a>
|
|
831
|
+
<a href="https://2captcha.com/support/tickets/new"><img src="https://github.com/user-attachments/assets/be044db5-2e67-46c6-8c81-04b78bd99650" width="81" height="30"></a>
|
|
832
|
+
|
|
833
|
+
## Join the team 👪
|
|
834
|
+
|
|
835
|
+
There are many ways to contribute, of which development is only one! Find your next job. Open positions: AI experts, scrapers, developers, technical support, and much more! 😍
|
|
836
|
+
|
|
837
|
+
<a href="mailto:job@2captcha.com"><img src="https://github.com/user-attachments/assets/36d23ef5-7866-4841-8e17-261cc8a4e033" width="80" height="30"></a>
|
|
838
|
+
|
|
839
|
+
## License
|
|
840
|
+
|
|
841
|
+
The code in this repository is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.
|
|
842
|
+
|
|
843
|
+
### Graphics and Trademarks
|
|
844
|
+
|
|
845
|
+
The graphics and trademarks included in this repository are not covered by the MIT License. Please contact <a href="mailto:support@2captcha.com">support</a> for permissions regarding the use of these materials.
|
|
846
|
+
|
|
847
|
+
<!-- Shared links -->
|
|
848
|
+
[2Captcha]: https://2captcha.com/
|
|
849
|
+
[JavaScript captcha solver]: https://2captcha.com/lang/javascript
|
|
850
|
+
[post options]: https://2captcha.com/2captcha-api#normal_post
|
|
851
|
+
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
|
852
|
+
[Buy residential proxies]: https://2captcha.com/proxy/residential-proxies
|
|
853
|
+
[Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true
|
|
854
|
+
[examples]: ./examples
|