@browsercash/chase 1.0.0

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.
@@ -0,0 +1,831 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "version": "1.0.0",
5
+ "title": "Browser.cash Developer API",
6
+ "description": "API for interacting with the Browser.cash distributed browser network.",
7
+ "contact": {
8
+ "name": "Contact Us",
9
+ "email": "hello@browser.cash",
10
+ "url": "https://browser.cash"
11
+ }
12
+ },
13
+ "externalDocs": {
14
+ "url": "http://dash.browser.cash/docs",
15
+ "description": "Learn more"
16
+ },
17
+ "components": {
18
+ "securitySchemes": {
19
+ "Bearer": {
20
+ "type": "http",
21
+ "scheme": "bearer",
22
+ "description": "Your Browser.cash API token (browser or agent, they work interchangeably). Get one at https://dash.browser.cash"
23
+ }
24
+ },
25
+ "schemas": {},
26
+ "parameters": {}
27
+ },
28
+ "paths": {
29
+ "/v1/browser/session": {
30
+ "post": {
31
+ "description": "Create a new browser session on our distributed network.",
32
+ "security": [
33
+ {
34
+ "Bearer": []
35
+ }
36
+ ],
37
+ "requestBody": {
38
+ "content": {
39
+ "application/json": {
40
+ "schema": {
41
+ "type": "object",
42
+ "properties": {
43
+ "nodeId": {
44
+ "type": "string",
45
+ "description": "The ID of the node to create a session on. Optional. If not provided, a random node will be selected. If provided, it takes precedence over country and type.",
46
+ "example": "this-node-id"
47
+ },
48
+ "country": {
49
+ "type": "string",
50
+ "minLength": 2,
51
+ "maxLength": 2,
52
+ "description": "Start a session in a specific country using its 2-letter ISO code. Optional. Ignored if nodeId is provided.",
53
+ "example": "US"
54
+ },
55
+ "type": {
56
+ "type": "string",
57
+ "enum": [
58
+ "consumer_distributed",
59
+ "hosted",
60
+ "testing"
61
+ ],
62
+ "description": "The type of node to target session creation. Optional. Ignored if nodeId is provided.",
63
+ "example": "consumer_distributed"
64
+ },
65
+ "proxyUrl": {
66
+ "type": "string",
67
+ "description": "The URL of the proxy to use for the session. Optional. If not provided, the node's default IP will be used. Specifying a proxy forces the `type` to `hosted`. Not supported with nodeId flag. Only SOCKS5 proxies are supported.",
68
+ "example": "socks5://user:pass@proxy.com:1081"
69
+ },
70
+ "windowSize": {
71
+ "type": "string",
72
+ "description": "The window size for the browser session in the format WIDTHxHEIGHT (e.g., 1920x1080). Optional.",
73
+ "example": "1920x1080"
74
+ },
75
+ "profile": {
76
+ "type": "object",
77
+ "properties": {
78
+ "name": {
79
+ "type": "string",
80
+ "example": "example-session-1",
81
+ "description": "The name of the browser profile."
82
+ },
83
+ "persist": {
84
+ "type": "boolean",
85
+ "example": true,
86
+ "description": "Whether to save the browser profile from this session after its completed."
87
+ }
88
+ },
89
+ "required": [
90
+ "name"
91
+ ],
92
+ "description": "The browser profile to use for the session. Optional. Only supported on hosted nodes."
93
+ },
94
+ "adblock": {
95
+ "type": "boolean",
96
+ "description": "Whether to enable ad-blocking in the browser session. Optional. Default is false.",
97
+ "example": true
98
+ },
99
+ "captchaSolver": {
100
+ "type": "boolean",
101
+ "description": "Whether to enable the built-in CAPTCHA solver for the session. Optional. Default is false.",
102
+ "example": true
103
+ }
104
+ },
105
+ "examples": [
106
+ {},
107
+ {
108
+ "nodeId": "this-node-id"
109
+ },
110
+ {
111
+ "country": "US",
112
+ "type": "hosted"
113
+ }
114
+ ]
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "responses": {
120
+ "200": {
121
+ "description": "Successfully created a browser session.",
122
+ "content": {
123
+ "application/json": {
124
+ "schema": {
125
+ "type": "object",
126
+ "properties": {
127
+ "sessionId": {
128
+ "type": "string",
129
+ "description": "The ID of the created browser session."
130
+ },
131
+ "status": {
132
+ "type": "string",
133
+ "enum": [
134
+ "starting",
135
+ "active",
136
+ "completed",
137
+ "error"
138
+ ],
139
+ "description": "The status of the session."
140
+ },
141
+ "servedBy": {
142
+ "type": "string",
143
+ "description": "The node ID that is serving this session."
144
+ },
145
+ "createdAt": {
146
+ "type": "string",
147
+ "description": "The ISO 8601 timestamp when the session was created."
148
+ },
149
+ "stoppedAt": {
150
+ "type": "string",
151
+ "nullable": true,
152
+ "description": "The ISO 8601 timestamp when the session was stopped, or null if it is still active."
153
+ },
154
+ "cdpUrl": {
155
+ "type": "string",
156
+ "nullable": true,
157
+ "format": "uri",
158
+ "description": "The URL to access the Chrome DevTools Protocol for this session, or null if not available."
159
+ }
160
+ },
161
+ "required": [
162
+ "sessionId",
163
+ "status",
164
+ "servedBy",
165
+ "createdAt",
166
+ "stoppedAt",
167
+ "cdpUrl"
168
+ ],
169
+ "examples": [
170
+ {
171
+ "sessionId": "example-session-id",
172
+ "status": "active",
173
+ "servedBy": "this-node-id",
174
+ "createdAt": "2025-11-20T01:51:25.000Z",
175
+ "stoppedAt": null,
176
+ "cdpUrl": "wss://gcp-usc1-1.milan-taurine.tera.space/v1/consumer/example-session-id/devtools/browser/uuid"
177
+ }
178
+ ]
179
+ }
180
+ }
181
+ }
182
+ },
183
+ "401": {
184
+ "description": "Missing or invalid token.",
185
+ "content": {
186
+ "application/json": {
187
+ "schema": {
188
+ "type": "object",
189
+ "properties": {
190
+ "error": {
191
+ "type": "string",
192
+ "description": "Error message"
193
+ }
194
+ },
195
+ "required": [
196
+ "error"
197
+ ]
198
+ }
199
+ }
200
+ }
201
+ },
202
+ "500": {
203
+ "description": "Failed to create a browser session.",
204
+ "content": {
205
+ "application/json": {
206
+ "schema": {
207
+ "type": "object",
208
+ "properties": {
209
+ "error": {
210
+ "type": "string",
211
+ "description": "Error message"
212
+ }
213
+ },
214
+ "required": [
215
+ "error"
216
+ ]
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+ },
223
+ "get": {
224
+ "description": "Retrieve an existing browser session.",
225
+ "security": [
226
+ {
227
+ "Bearer": []
228
+ }
229
+ ],
230
+ "parameters": [
231
+ {
232
+ "schema": {
233
+ "type": "string",
234
+ "example": "example-session-id",
235
+ "description": "The ID of the browser session to retrieve."
236
+ },
237
+ "required": true,
238
+ "description": "The ID of the browser session to retrieve.",
239
+ "name": "sessionId",
240
+ "in": "query"
241
+ }
242
+ ],
243
+ "responses": {
244
+ "200": {
245
+ "description": "Successfully retrieved browser session.",
246
+ "content": {
247
+ "application/json": {
248
+ "schema": {
249
+ "type": "object",
250
+ "properties": {
251
+ "sessionId": {
252
+ "type": "string",
253
+ "description": "The ID of the created browser session."
254
+ },
255
+ "status": {
256
+ "type": "string",
257
+ "enum": [
258
+ "starting",
259
+ "active",
260
+ "completed",
261
+ "error"
262
+ ],
263
+ "description": "The status of the session."
264
+ },
265
+ "servedBy": {
266
+ "type": "string",
267
+ "description": "The node ID that is serving this session."
268
+ },
269
+ "createdAt": {
270
+ "type": "string",
271
+ "description": "The ISO 8601 timestamp when the session was created."
272
+ },
273
+ "stoppedAt": {
274
+ "type": "string",
275
+ "nullable": true,
276
+ "description": "The ISO 8601 timestamp when the session was stopped, or null if it is still active."
277
+ },
278
+ "cdpUrl": {
279
+ "type": "string",
280
+ "nullable": true,
281
+ "format": "uri",
282
+ "description": "The URL to access the Chrome DevTools Protocol for this session, or null if not available."
283
+ }
284
+ },
285
+ "required": [
286
+ "sessionId",
287
+ "status",
288
+ "servedBy",
289
+ "createdAt",
290
+ "stoppedAt",
291
+ "cdpUrl"
292
+ ],
293
+ "examples": [
294
+ {
295
+ "sessionId": "example-session-id",
296
+ "status": "active",
297
+ "servedBy": "this-node-id",
298
+ "createdAt": "2025-11-20T01:51:25.000Z",
299
+ "stoppedAt": null,
300
+ "cdpUrl": "wss://gcp-usc1-1.milan-taurine.tera.space/v1/consumer/example-session-id/devtools/browser/uuid"
301
+ }
302
+ ]
303
+ }
304
+ }
305
+ }
306
+ },
307
+ "401": {
308
+ "description": "Missing or invalid token.",
309
+ "content": {
310
+ "application/json": {
311
+ "schema": {
312
+ "type": "object",
313
+ "properties": {
314
+ "error": {
315
+ "type": "string",
316
+ "description": "Error message"
317
+ }
318
+ },
319
+ "required": [
320
+ "error"
321
+ ]
322
+ }
323
+ }
324
+ }
325
+ },
326
+ "404": {
327
+ "description": "Browser session not found.",
328
+ "content": {
329
+ "application/json": {
330
+ "schema": {
331
+ "type": "object",
332
+ "properties": {
333
+ "error": {
334
+ "type": "string",
335
+ "description": "Session not found",
336
+ "example": "Session not found"
337
+ }
338
+ },
339
+ "required": [
340
+ "error"
341
+ ]
342
+ }
343
+ }
344
+ }
345
+ },
346
+ "500": {
347
+ "description": "Failed to retrieve browser session.",
348
+ "content": {
349
+ "application/json": {
350
+ "schema": {
351
+ "type": "object",
352
+ "properties": {
353
+ "error": {
354
+ "type": "string",
355
+ "description": "Error message"
356
+ }
357
+ },
358
+ "required": [
359
+ "error"
360
+ ]
361
+ }
362
+ }
363
+ }
364
+ }
365
+ }
366
+ },
367
+ "delete": {
368
+ "description": "Stop an existing browser session.",
369
+ "security": [
370
+ {
371
+ "Bearer": []
372
+ }
373
+ ],
374
+ "parameters": [
375
+ {
376
+ "schema": {
377
+ "type": "string",
378
+ "example": "example-session-id",
379
+ "description": "The ID of the browser session to stop."
380
+ },
381
+ "required": true,
382
+ "description": "The ID of the browser session to stop.",
383
+ "name": "sessionId",
384
+ "in": "query"
385
+ }
386
+ ],
387
+ "responses": {
388
+ "200": {
389
+ "description": "Successfully stopped browser session.",
390
+ "content": {
391
+ "application/json": {
392
+ "schema": {
393
+ "type": "object",
394
+ "properties": {
395
+ "success": {
396
+ "type": "boolean",
397
+ "description": "Indicates whether the session was successfully stopped."
398
+ }
399
+ },
400
+ "required": [
401
+ "success"
402
+ ],
403
+ "examples": [
404
+ {
405
+ "success": true
406
+ }
407
+ ]
408
+ }
409
+ }
410
+ }
411
+ },
412
+ "401": {
413
+ "description": "Missing or invalid token.",
414
+ "content": {
415
+ "application/json": {
416
+ "schema": {
417
+ "type": "object",
418
+ "properties": {
419
+ "error": {
420
+ "type": "string",
421
+ "description": "Error message"
422
+ }
423
+ },
424
+ "required": [
425
+ "error"
426
+ ]
427
+ }
428
+ }
429
+ }
430
+ },
431
+ "404": {
432
+ "description": "Browser session not found.",
433
+ "content": {
434
+ "application/json": {
435
+ "schema": {
436
+ "type": "object",
437
+ "properties": {
438
+ "error": {
439
+ "type": "string",
440
+ "description": "Session not found",
441
+ "example": "Session not found"
442
+ }
443
+ },
444
+ "required": [
445
+ "error"
446
+ ]
447
+ }
448
+ }
449
+ }
450
+ },
451
+ "500": {
452
+ "description": "Failed to stop browser session.",
453
+ "content": {
454
+ "application/json": {
455
+ "schema": {
456
+ "type": "object",
457
+ "properties": {
458
+ "error": {
459
+ "type": "string",
460
+ "description": "Error message"
461
+ }
462
+ },
463
+ "required": [
464
+ "error"
465
+ ]
466
+ }
467
+ }
468
+ }
469
+ }
470
+ }
471
+ }
472
+ },
473
+ "/v1/browser/sessions": {
474
+ "get": {
475
+ "description": "List browser sessions with pagination.",
476
+ "security": [
477
+ {
478
+ "Bearer": []
479
+ }
480
+ ],
481
+ "parameters": [
482
+ {
483
+ "schema": {
484
+ "type": "integer",
485
+ "minimum": 0,
486
+ "exclusiveMinimum": true,
487
+ "example": 1,
488
+ "description": "The page number for pagination."
489
+ },
490
+ "required": false,
491
+ "description": "The page number for pagination.",
492
+ "name": "page",
493
+ "in": "query"
494
+ },
495
+ {
496
+ "schema": {
497
+ "type": "integer",
498
+ "minimum": 0,
499
+ "exclusiveMinimum": true,
500
+ "example": 20,
501
+ "description": "The number of sessions per page."
502
+ },
503
+ "required": false,
504
+ "description": "The number of sessions per page.",
505
+ "name": "pageSize",
506
+ "in": "query"
507
+ }
508
+ ],
509
+ "responses": {
510
+ "200": {
511
+ "description": "Successfully retrieved list of browser sessions.",
512
+ "content": {
513
+ "application/json": {
514
+ "schema": {
515
+ "type": "object",
516
+ "properties": {
517
+ "page": {
518
+ "type": "integer",
519
+ "description": "The current page number."
520
+ },
521
+ "pageSize": {
522
+ "type": "integer",
523
+ "description": "The number of sessions per page."
524
+ },
525
+ "total": {
526
+ "type": "integer",
527
+ "description": "The total number of sessions."
528
+ },
529
+ "totalPages": {
530
+ "type": "integer",
531
+ "description": "The total number of pages."
532
+ },
533
+ "sessions": {
534
+ "type": "array",
535
+ "items": {
536
+ "type": "object",
537
+ "properties": {
538
+ "sessionId": {
539
+ "type": "string",
540
+ "description": "The unique session ID."
541
+ },
542
+ "status": {
543
+ "type": "string",
544
+ "enum": [
545
+ "starting",
546
+ "active",
547
+ "completed",
548
+ "error"
549
+ ],
550
+ "description": "The status of the session."
551
+ },
552
+ "servedBy": {
553
+ "type": "string",
554
+ "description": "The node ID that is serving this session."
555
+ },
556
+ "createdAt": {
557
+ "type": "string",
558
+ "description": "The ISO 8601 timestamp when the session was created."
559
+ },
560
+ "stoppedAt": {
561
+ "type": "string",
562
+ "nullable": true,
563
+ "description": "The ISO 8601 timestamp when the session was stopped, or null if it is still active."
564
+ }
565
+ },
566
+ "required": [
567
+ "sessionId",
568
+ "status",
569
+ "servedBy",
570
+ "createdAt",
571
+ "stoppedAt"
572
+ ]
573
+ },
574
+ "description": "Array of browser sessions."
575
+ }
576
+ },
577
+ "required": [
578
+ "page",
579
+ "pageSize",
580
+ "total",
581
+ "totalPages",
582
+ "sessions"
583
+ ],
584
+ "examples": [
585
+ {
586
+ "page": 1,
587
+ "pageSize": 20,
588
+ "total": 7,
589
+ "totalPages": 1,
590
+ "sessions": [
591
+ {
592
+ "sessionId": "jx6qz3w68l6j1v3h1c42teogpake4t7zjtccbksrcwbilsqka8ugaw09qm0ldrx6u84igpobcrgctnjqcy1ejiphnjbwmkxh3p3dvsbmzbz70a9949aij3utp7mfjd6e",
593
+ "status": "completed",
594
+ "servedBy": "job-camera-sausage",
595
+ "createdAt": "2025-11-20T06:16:10.000Z",
596
+ "stoppedAt": "2025-11-20T07:16:11.199Z"
597
+ }
598
+ ]
599
+ }
600
+ ]
601
+ }
602
+ }
603
+ }
604
+ },
605
+ "401": {
606
+ "description": "Missing or invalid token.",
607
+ "content": {
608
+ "application/json": {
609
+ "schema": {
610
+ "type": "object",
611
+ "properties": {
612
+ "error": {
613
+ "type": "string",
614
+ "description": "Error message"
615
+ }
616
+ },
617
+ "required": [
618
+ "error"
619
+ ]
620
+ }
621
+ }
622
+ }
623
+ },
624
+ "500": {
625
+ "description": "Failed to retrieve browser sessions.",
626
+ "content": {
627
+ "application/json": {
628
+ "schema": {
629
+ "type": "object",
630
+ "properties": {
631
+ "error": {
632
+ "type": "string",
633
+ "description": "Error message"
634
+ }
635
+ },
636
+ "required": [
637
+ "error"
638
+ ]
639
+ }
640
+ }
641
+ }
642
+ }
643
+ }
644
+ }
645
+ },
646
+ "/v1/browser/profile": {
647
+ "delete": {
648
+ "description": "Delete a browser profile by name.",
649
+ "security": [
650
+ {
651
+ "Bearer": []
652
+ }
653
+ ],
654
+ "parameters": [
655
+ {
656
+ "schema": {
657
+ "type": "string",
658
+ "example": "test",
659
+ "description": "The name of the browser profile to delete."
660
+ },
661
+ "required": true,
662
+ "description": "The name of the browser profile to delete.",
663
+ "name": "profileName",
664
+ "in": "query"
665
+ }
666
+ ],
667
+ "responses": {
668
+ "200": {
669
+ "description": "Successfully deleted browser profile.",
670
+ "content": {
671
+ "application/json": {
672
+ "schema": {
673
+ "type": "object",
674
+ "properties": {
675
+ "success": {
676
+ "type": "boolean",
677
+ "description": "Indicates whether the profile was successfully deleted."
678
+ }
679
+ },
680
+ "required": [
681
+ "success"
682
+ ]
683
+ }
684
+ }
685
+ }
686
+ },
687
+ "401": {
688
+ "description": "Missing or invalid token.",
689
+ "content": {
690
+ "application/json": {
691
+ "schema": {
692
+ "type": "object",
693
+ "properties": {
694
+ "error": {
695
+ "type": "string",
696
+ "description": "Error message"
697
+ }
698
+ },
699
+ "required": [
700
+ "error"
701
+ ]
702
+ }
703
+ }
704
+ }
705
+ },
706
+ "500": {
707
+ "description": "Failed to delete browser profile.",
708
+ "content": {
709
+ "application/json": {
710
+ "schema": {
711
+ "type": "object",
712
+ "properties": {
713
+ "error": {
714
+ "type": "string",
715
+ "description": "Error message"
716
+ }
717
+ },
718
+ "required": [
719
+ "error"
720
+ ]
721
+ }
722
+ }
723
+ }
724
+ }
725
+ }
726
+ }
727
+ },
728
+ "/v1/browser/profiles": {
729
+ "get": {
730
+ "description": "List all browser profiles.",
731
+ "security": [
732
+ {
733
+ "Bearer": []
734
+ }
735
+ ],
736
+ "responses": {
737
+ "200": {
738
+ "description": "Successfully retrieved list of browser profiles.",
739
+ "content": {
740
+ "application/json": {
741
+ "schema": {
742
+ "type": "object",
743
+ "properties": {
744
+ "profiles": {
745
+ "type": "array",
746
+ "items": {
747
+ "type": "object",
748
+ "properties": {
749
+ "profileId": {
750
+ "type": "string",
751
+ "description": "The unique identifier of the browser profile."
752
+ },
753
+ "name": {
754
+ "type": "string",
755
+ "description": "The name of the browser profile."
756
+ },
757
+ "createdAt": {
758
+ "type": "string",
759
+ "description": "The ISO 8601 timestamp when the profile was created."
760
+ }
761
+ },
762
+ "required": [
763
+ "profileId",
764
+ "name",
765
+ "createdAt"
766
+ ]
767
+ },
768
+ "description": "Array of browser profiles."
769
+ }
770
+ },
771
+ "required": [
772
+ "profiles"
773
+ ],
774
+ "examples": [
775
+ {
776
+ "profiles": [
777
+ {
778
+ "profileId": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
779
+ "name": "test",
780
+ "createdAt": "2025-12-19T18:58:03.000Z"
781
+ }
782
+ ]
783
+ }
784
+ ]
785
+ }
786
+ }
787
+ }
788
+ },
789
+ "401": {
790
+ "description": "Missing or invalid token.",
791
+ "content": {
792
+ "application/json": {
793
+ "schema": {
794
+ "type": "object",
795
+ "properties": {
796
+ "error": {
797
+ "type": "string",
798
+ "description": "Error message"
799
+ }
800
+ },
801
+ "required": [
802
+ "error"
803
+ ]
804
+ }
805
+ }
806
+ }
807
+ },
808
+ "500": {
809
+ "description": "Failed to retrieve browser profiles.",
810
+ "content": {
811
+ "application/json": {
812
+ "schema": {
813
+ "type": "object",
814
+ "properties": {
815
+ "error": {
816
+ "type": "string",
817
+ "description": "Error message"
818
+ }
819
+ },
820
+ "required": [
821
+ "error"
822
+ ]
823
+ }
824
+ }
825
+ }
826
+ }
827
+ }
828
+ }
829
+ }
830
+ }
831
+ }