Browse Source

All examples except user notifications

pjc 4 years ago
parent
commit
22c29c3e35
5 changed files with 566 additions and 35 deletions
  1. 1
    1
      docs/forums.md
  2. 16
    11
      docs/index.md
  3. 2
    2
      docs/meta.md
  4. 255
    6
      docs/torrents.md
  5. 292
    15
      docs/users.md

+ 1
- 1
docs/forums.md View File

7
 
7
 
8
 **Request**
8
 **Request**
9
 
9
 
10
-`ajax.php?action=forum&type=main`
10
+`ajax.php?action=forum`
11
 
11
 
12
 
12
 
13
 **Response**
13
 **Response**

+ 16
- 11
docs/index.md View File

1
-The JSON API provides an easily parseable interface to BioTorrents.de.
2
-Below is the list of information available, then arguments that can be passed to it, and the format of the results.
1
+The JSON API provides an easily parseable interface to [BioTorrents.de](https://biotorrents.de).
2
+Please use the navigation menu to find lists of endpoints, their arguments, and example responses.
3
 
3
 
4
 You must be logged in to use the API.
4
 You must be logged in to use the API.
5
 This is done by sending a POST request to
5
 This is done by sending a POST request to
6
-`https://biotorrents.de/login.php` with `username` and `password`
6
+
7
+`https://biotorrents.de/login.php`
8
+
9
+with `username` and `password`
7
 and storing a cookie to be used to access the rest of the API.
10
 and storing a cookie to be used to access the rest of the API.
8
 
11
 
9
 
12
 
10
 # Introduction
13
 # Introduction
11
 
14
 
12
 All request URLs are in the form
15
 All request URLs are in the form
13
-`ajax.php?action=<action>`.
16
+
17
+`ajax.php?action=<action>`
14
 
18
 
15
 All the JSON returned is in the form
19
 All the JSON returned is in the form
20
+
16
 ```json
21
 ```json
17
 {
22
 {
18
   "status": "success",
23
   "status": "success",
54
 
59
 
55
 ## Rate limit
60
 ## Rate limit
56
 
61
 
57
-The JSON API is rate-limited to one request every ten seconds.
58
-This limit doesn't apply to the Donor class.
62
+The API is rate-limited to one request every ten seconds.
63
+This limit doesn't apply to users in the Donor class.
59
 
64
 
60
 
65
 
61
 ## Under construction
66
 ## Under construction
62
 
67
 
63
 Some endpoints aren't working correctly right now:
68
 Some endpoints aren't working correctly right now:
64
 
69
 
65
-- artist
66
-- preview
70
+- `artist`
71
+- `preview`
67
 
72
 
68
 [Oppaitime Gazelle](https://git.oppaiti.me/Oppaitime/Gazelle)
73
 [Oppaitime Gazelle](https://git.oppaiti.me/Oppaitime/Gazelle)
69
 also contains other undocumented endpoints:
74
 also contains other undocumented endpoints:
70
 
75
 
71
-- get_friends
72
-- news_ajax
73
-- send_recommendation
76
+- `get_friends`
77
+- `news_ajax`
78
+- `send_recommendation`
74
 
79
 
75
 
80
 
76
 # Not implemented
81
 # Not implemented

+ 2
- 2
docs/meta.md View File

1
 # Meta
1
 # Meta
2
 
2
 
3
-Endpoints related to BioTorrents.de itself.
3
+Endpoints related to [BioTorrents.de](https://biotorrents.de) itself.
4
 
4
 
5
 
5
 
6
 ## Index
6
 ## Index
162
 
162
 
163
 ## Wiki
163
 ## Wiki
164
 
164
 
165
-Note that either `id` or `name` is required.
165
+Either `id` or `name` is required.
166
 
166
 
167
 **Request**
167
 **Request**
168
 
168
 

+ 255
- 6
docs/torrents.md View File

163
 
163
 
164
 ## Browse (search)
164
 ## Browse (search)
165
 
165
 
166
-Note that BioTorrents.de still uses Oppaitime metadata under the hood.
167
-These docs are adapted from What.CD, an older and different distribution.
166
+Note that [BioTorrents.de](https://biotorrents.de) still uses Oppaitime metadata behind the scenes.
167
+These docs are also adapted from What.CD, an older and different distribution.
168
 The advanced search options are certain to change in the future.
168
 The advanced search options are certain to change in the future.
169
 
169
 
170
 
170
 
372
 
372
 
373
 Under construction as of 2020-11-24.
373
 Under construction as of 2020-11-24.
374
 Currently not returning the artist's torrent groups.
374
 Currently not returning the artist's torrent groups.
375
-Please see the below reponse for details.
375
+Please see the response below for details.
376
 
376
 
377
 
377
 
378
 **Request**
378
 **Request**
433
 **Response**
433
 **Response**
434
 
434
 
435
 ```json
435
 ```json
436
-
436
+{
437
+    "status": "success",
438
+    "response": [
439
+        {
440
+            "caption": "Most Active Torrents Uploaded in the Past Day",
441
+            "tag": "day",
442
+            "limit": 10,
443
+            "results": [
444
+                {
445
+                    "torrentId": 67,
446
+                    "groupId": 57,
447
+                    "author": "Production Sanborn LLC",
448
+                    "groupName": "Massachusetts 1:5,000 Color Ortho Imagery",
449
+                    "groupCategory": 9,
450
+                    "groupYear": 2005,
451
+                    "platform": "Other",
452
+                    "tags": [
453
+                        "data.science",
454
+                        "one.shot",
455
+                        "true.color",
456
+                        "massachusetts",
457
+                        "geography"
458
+                    ],
459
+                    "snatched": 0,
460
+                    "seeders": 2,
461
+                    "leechers": 0,
462
+                    "data": 0,
463
+                    "size": 24759011328,
464
+                    "picture": ""
465
+                },
466
+                {
467
+                    "torrentId": 18,
468
+                    "groupId": 18,
469
+                    # etc.
470
+                },
471
+                # etc.
472
+            ]
473
+        },
474
+        {
475
+            "caption": "Most Active Torrents Uploaded in the Past Week",
476
+            "tag": "week",
477
+            "limit": 10,
478
+            "results": [
479
+                {
480
+                    "torrentId": 30,
481
+                    "groupId": 15,
482
+                    # etc.
483
+                },
484
+                {
485
+                    "torrentId": 32,
486
+                    "groupId": 27,
487
+                    # etc.
488
+                },
489
+                # etc.
490
+            ]
491
+        },
492
+        {
493
+            "caption": "Most Active Torrents of All Time",
494
+            "tag": "overall",
495
+            "limit": 10,
496
+            "results": [
497
+                {
498
+                    "torrentId": 1,
499
+                    "groupId": 1,
500
+                    # etc.
501
+                },
502
+                {
503
+                    "torrentId": 25,
504
+                    "groupId": 25,
505
+                    # etc.
506
+                },
507
+                # etc.
508
+            ]
509
+        },
510
+        {
511
+            "caption": "Most Snatched Torrents",
512
+            "tag": "snatched",
513
+            "limit": 10,
514
+            "results": [
515
+                {
516
+                    "torrentId": 40,
517
+                    "groupId": 32,
518
+                    # etc.
519
+                },
520
+                {
521
+                    "torrentId": 43,
522
+                    "groupId": 34,
523
+                    # etc.
524
+                },
525
+                # etc.
526
+            ]
527
+        },
528
+        {
529
+            "caption": "Most Data Transferred Torrents",
530
+            "tag": "data",
531
+            "limit": 10,
532
+            "results": [
533
+                {
534
+                    "torrentId": 28,
535
+                    "groupId": 17,
536
+                    # etc.
537
+                },
538
+                {
539
+                    "torrentId": 10,
540
+                    "groupId": 10,
541
+                    # etc.
542
+                },
543
+                # etc.
544
+            ]
545
+        },
546
+        {
547
+            "caption": "Best Seeded Torrents",
548
+            "tag": "seeded",
549
+            "limit": 10,
550
+            "results": [
551
+                {
552
+                    "torrentId": 50,
553
+                    "groupId": 40,
554
+                    # etc.
555
+                },
556
+                {
557
+                    "torrentId": 48,
558
+                    "groupId": 38,
559
+                    # etc.
560
+                },
561
+                # etc.
562
+            ]
563
+        }
564
+    ]
565
+}
437
 ```
566
 ```
438
 
567
 
439
 
568
 
440
 ### Tags
569
 ### Tags
441
 
570
 
442
 ```json
571
 ```json
443
-
572
+{
573
+    "status": "success",
574
+    "response": [
575
+        {
576
+            "caption": "Most Used Torrent Tags",
577
+            "tag": "ut",
578
+            "limit": 10,
579
+            "results": [
580
+                {
581
+                    "name": "one.shot",
582
+                    "uses": 24
583
+                },
584
+                {
585
+                    "name": "humans",
586
+                    "uses": 22
587
+                },
588
+                {
589
+                    "name": "data.science",
590
+                    "uses": 20
591
+                },
592
+                # etc.
593
+            ]
594
+        },
595
+        {
596
+            "caption": "Most Used Request Tags",
597
+            "tag": "ur",
598
+            "limit": 10,
599
+            "results": [
600
+                {
601
+                    "name": "coding",
602
+                    "uses": 2
603
+                },
604
+                {
605
+                    "name": "biochemistry",
606
+                    "uses": 2
607
+                },
608
+                {
609
+                    "name": "plants",
610
+                    "uses": 1
611
+                },
612
+                # etc.
613
+            ]
614
+        }
615
+    ]
616
+}
444
 ```
617
 ```
445
 
618
 
446
 
619
 
447
 ### Users
620
 ### Users
448
 
621
 
449
-```json
622
+Usernames are masked to `null` in the output unless you have moderator permissions.
450
 
623
 
624
+```json
625
+{
626
+    "status": "success",
627
+    "response": [
628
+        {
629
+            "caption": "Uploaders",
630
+            "tag": "ul",
631
+            "limit": 10,
632
+            "results": [
633
+                {
634
+                    "id": 28,
635
+                    "username": "seedbox",
636
+                    "uploaded": 100918879562,
637
+                    "upSpeed": 4893.906,
638
+                    "downloaded": 12327881516,
639
+                    "downSpeed": 600.9437,
640
+                    "numUploads": 0,
641
+                    "joinDate": "2020-04-01 15:50:04"
642
+                },
643
+                # etc.
644
+            ]
645
+        },
646
+        {
647
+            "caption": "Downloaders",
648
+            "tag": "dl",
649
+            "limit": 10,
650
+            "results": [
651
+                {
652
+                    "id": 28,
653
+                    "username": "seedbox",
654
+                    # etc.
655
+                },
656
+                # etc.
657
+            ]
658
+        },
659
+        {
660
+            "caption": "Torrents Uploaded",
661
+            "tag": "numul",
662
+            "limit": 10,
663
+            "results": [
664
+                {
665
+                    "id": 28,
666
+                    "username": "seedbox",
667
+                    # etc.
668
+                },
669
+                # etc.
670
+            ]
671
+        },
672
+        {
673
+            "caption": "Fastest Uploaders",
674
+            "tag": "uls",
675
+            "limit": 10,
676
+            "results": [
677
+                {
678
+                    "id": 28,
679
+                    "username": "seedbox",
680
+                    # etc.
681
+                },
682
+                # etc.
683
+            ]
684
+        },
685
+        {
686
+            "caption": "Fastest Downloaders",
687
+            "tag": "dls",
688
+            "limit": 10,
689
+            "results": [
690
+                {
691
+                    "id": 28,
692
+                    "username": "seedbox",
693
+                    # etc.
694
+                },
695
+                # etc.
696
+            ]
697
+        }
698
+    ]
699
+}
451
 ```
700
 ```

+ 292
- 15
docs/users.md View File

18
 **Response**
18
 **Response**
19
 
19
 
20
 ```json
20
 ```json
21
-
21
+{
22
+    "status": "success",
23
+    "response": {
24
+        "username": "eva",
25
+        "avatar": "https://ptpimg.me/1x1h48.png",
26
+        "isFriend": false,
27
+        "profileText": "",
28
+        "stats": {
29
+            "joinedDate": "2020-03-08 14:27:59",
30
+            "lastAccess": "2020-11-24 15:25:17",
31
+            "uploaded": 2192870833,
32
+            "downloaded": 1244283888,
33
+            "ratio": 1.76235,
34
+            "requiredRatio": 0
35
+        },
36
+        "ranks": {
37
+            "uploaded": 0,
38
+            "downloaded": 2,
39
+            "uploads": 0,
40
+            "requests": 0,
41
+            "bounty": 0,
42
+            "posts": 2,
43
+            "artists": 0,
44
+            "overall": 0
45
+        },
46
+        "personal": {
47
+            "class": "Donor",
48
+            "paranoia": 0,
49
+            "paranoiaText": "Off",
50
+            "donor": false,
51
+            "warned": false,
52
+            "enabled": true,
53
+            "passkey": ""
54
+        },
55
+        "community": {
56
+            "posts": 4,
57
+            "torrentComments": 0,
58
+            "artistComments": 0,
59
+            "collageComments": 0,
60
+            "requestComments": 0,
61
+            "collagesStarted": 1,
62
+            "collagesContrib": 1,
63
+            "requestsFilled": 0,
64
+            "bountyEarned": 0,
65
+            "requestsVoted": 0,
66
+            "bountySpent": 0,
67
+            "uploaded": 0,
68
+            "groups": 0,
69
+            "seeding": 0,
70
+            "leeching": 0,
71
+            "snatched": 7,
72
+            "invited": 0,
73
+            "artistsAdded": 0
74
+        }
75
+    }
76
+}
22
 ```
77
 ```
23
 
78
 
24
 
79
 
36
 **Response**
91
 **Response**
37
 
92
 
38
 ```json
93
 ```json
39
-
94
+{
95
+    "status": "success",
96
+    "response": {
97
+        "currentPage": 1,
98
+        "pages": 1,
99
+        "results": [
100
+            {
101
+                "userId": 42,
102
+                "username": "hedomedo",
103
+                "donor": false,
104
+                "warned": false,
105
+                "enabled": true,
106
+                "class": "User",
107
+                "avatar": ""
108
+            },
109
+            {
110
+                "userId": 2,
111
+                "username": "me",
112
+                # etc.
113
+            },
114
+            {
115
+                "userId": 16,
116
+                "username": "Medicus",
117
+                # etc.
118
+            },
119
+            # etc.
120
+        ]
121
+    }
122
+}
40
 ```
123
 ```
41
 
124
 
42
 
125
 
52
 **Response**
135
 **Response**
53
 
136
 
54
 ```json
137
 ```json
55
-
138
+{
139
+    "status": "success",
140
+    "response": {
141
+        "leeching": 0,
142
+        "seeding": "60",
143
+        "snatched": "3",
144
+        "usnatched": false,
145
+        "downloaded": false,
146
+        "udownloaded": false,
147
+        "seedingperc": 100
148
+    }
149
+}
56
 ```
150
 ```
57
 
151
 
58
 
152
 
59
 ## Recents (torrents)
153
 ## Recents (torrents)
60
 
154
 
61
 This endpoint circumvents the "upload anonymously" feature.
155
 This endpoint circumvents the "upload anonymously" feature.
156
+Various features of the response will likely change in the future.
62
 
157
 
63
 
158
 
64
 **Request**
159
 **Request**
65
 
160
 
66
 `ajax.php?action=user_recents`
161
 `ajax.php?action=user_recents`
67
 
162
 
68
-`&userid=` id of user (required)
163
+`&userid=` — id of user (required)
69
 
164
 
70
-`&limit=` how many recent torrents to fetch
165
+`&limit=` — how many recent torrents to fetch
71
 
166
 
72
 
167
 
73
 **Response**
168
 **Response**
74
 
169
 
75
 ```json
170
 ```json
76
-
171
+{
172
+    "status": "success",
173
+    "response": {
174
+        "snatches": [
175
+            {
176
+                "ID": 41,
177
+                "Name": "Enzymatic synthesis of psilocybin",
178
+                "WikiImage": "https://mycocosm.jgi.doe.gov/public/Psiser1/P+serbica+2.png",
179
+                "artists": [
180
+                    [
181
+                        {
182
+                            "id": 58,
183
+                            "name": "Dirk Hoffmeister"
184
+                        },
185
+                        {
186
+                            "id": 57,
187
+                            "name": "Felix Blei"
188
+                        },
189
+                        {
190
+                            "id": 56,
191
+                            "name": "Janis Fricke"
192
+                        }
193
+                    ]
194
+                ]
195
+            },
196
+            {
197
+                "ID": 23,
198
+                "Name": "uBiome kombucha data",
199
+                "WikiImage": "https://kombucha-genomics.github.io/photos/pexels-photo-130947.jpeg",
200
+                # etc.
201
+            },
202
+            # etc.
203
+        ],
204
+        "uploads": [
205
+            {
206
+                "ID": 40,
207
+                "Name": "COVID-19 Genomics UK Consortium: 2020-04-24",
208
+                "WikiImage": "https://www.cogconsortium.uk/wp-content/uploads/2020/04/Screenshot-2020-04-27-at-15.40.51-1536x756.png",
209
+                # etc.
210
+            },
211
+            {
212
+                "ID": 16,
213
+                "Name": "Infinite Discovery Machine v3",
214
+                "WikiImage": "https://binomicalabs.org/wp-content/uploads/2017/04/The-Infinite-Discovery-Machine-Binomica-Labs.jpg",
215
+                # etc.
216
+            },
217
+            # etc.
218
+        ]
219
+    }
220
+}
77
 ```
221
 ```
78
 
222
 
79
 
223
 
83
 
227
 
84
 `ajax.php?action=userhistory&type=posts`
228
 `ajax.php?action=userhistory&type=posts`
85
 
229
 
86
-`&userid=` id of user (required)
230
+`&userid=` — id of user (required)
87
 
231
 
88
 
232
 
89
 **Response**
233
 **Response**
90
 
234
 
91
 ```json
235
 ```json
92
-
236
+{
237
+    "status": "success",
238
+    "response": {
239
+        "currentPage": 1,
240
+        "pages": 2,
241
+        "threads": [
242
+            {
243
+                "postId": 52,
244
+                "topicId": 2,
245
+                "threadTitle": "Report broken site features",
246
+                "lastPostId": 52,
247
+                "lastRead": 0,
248
+                "locked": true,
249
+                "sticky": false,
250
+                "addedTime": "2020-11-19 03:17:36",
251
+                "body": "HTML",
252
+                "bbbody": "BBcode",
253
+                "editedUserId": 1,
254
+                "editedTime": "2020-11-19 16:22:48",
255
+                "editedUsername": "ohm"
256
+            },
257
+            {
258
+                "postId": 49,
259
+                "topicId": 36,
260
+                # etc.
261
+            },
262
+            {
263
+                "postId": 48,
264
+                "topicId": 35,
265
+                # etc.
266
+            },
267
+            # etc.
268
+        ]
269
+    }
270
+}
93
 ```
271
 ```
94
 
272
 
95
 
273
 
97
 
275
 
98
 Endpoints that only fetch info about your own account.
276
 Endpoints that only fetch info about your own account.
99
 
277
 
278
+
100
 ## Inbox
279
 ## Inbox
101
 
280
 
281
+The current example isn't from the [BioTorrents.de](https://biotorrents.de) database.
282
+
283
+
102
 **Request**
284
 **Request**
103
 
285
 
104
 `ajax.php?action=inbox`
286
 `ajax.php?action=inbox`
116
 
298
 
117
 **Response**
299
 **Response**
118
 
300
 
119
-```
120
-
301
+```json
302
+{
303
+    "status": "success",
304
+    "response": {
305
+        "currentPage": 1,
306
+        "pages": 3,
307
+        "messages": [
308
+            {
309
+                "convId": 3421929,
310
+                "subject": "1 of your torrents has been deleted for inactivity",
311
+                "unread": false,
312
+                "sticky": false,
313
+                "forwardedId": 0,
314
+                "forwardedName": "",
315
+                "senderId": 0,
316
+                "username": "",
317
+                "donor": false,
318
+                "warned": false,
319
+                "enabled": true,
320
+                "date": "2012-06-12 00:54:01"
321
+            },
322
+            # etc.
323
+        ]
324
+    }
325
+}
121
 ```
326
 ```
122
 
327
 
123
 
328
 
124
 ## Conversation 
329
 ## Conversation 
125
 
330
 
331
+The current example isn't from the [BioTorrents.de](https://biotorrents.de) database.
332
+
333
+
126
 **Request**
334
 **Request**
127
 
335
 
128
 `ajax.php?action=inbox&type=viewconv`
336
 `ajax.php?action=inbox&type=viewconv`
133
 **Response**
341
 **Response**
134
 
342
 
135
 ```json
343
 ```json
136
-
344
+{
345
+    "status": "success",
346
+    "response": {
347
+        "convId": 3421929,
348
+        "subject": "1 of your torrents has been deleted for inactivity",
349
+        "sticky": false,
350
+        "messages": [
351
+            {
352
+                "messageId": 4507261,
353
+                "senderId": 0,
354
+                "senderName": "System",
355
+                "sentDate": "2012-06-12 00:54:01",
356
+                "bbBody": "BBcode",
357
+                "body": "HTML"
358
+            },
359
+            # etc.
360
+        ]
361
+    }
362
+}
137
 ```
363
 ```
138
 
364
 
139
 ## Bookmarks
365
 ## Bookmarks
153
 **Response**
379
 **Response**
154
 
380
 
155
 ```json
381
 ```json
156
-
382
+{
383
+    "status": "success",
384
+    "response": {
385
+        "bookmarks": [
386
+            {
387
+                "id": 33,
388
+                "name": "CoronaWhy: Collaborative sharing of datasets by members of the CoronaWhy group",
389
+                "year": 2020,
390
+                "accession": "",
391
+                "tagList": "machine_learning data_science epidemiology germany natural_language",
392
+                "vanityHouse": false,
393
+                "picture": "https://i.imgur.com/kt0MsEg.jpg",
394
+                "torrents": [
395
+                    {
396
+                        "id": 41,
397
+                        "groupId": 33,
398
+                        "platform": "Literature",
399
+                        "fileCount": 1,
400
+                        "freeTorrent": false,
401
+                        "size": 13703876874,
402
+                        "leechers": 0,
403
+                        "seeders": 4,
404
+                        "snatched": 2,
405
+                        "time": "2020-04-18 22:54:03",
406
+                        "hasFile": 41
407
+                    }
408
+                ]
409
+            },
410
+            {
411
+                "id": 48,
412
+                "name": "Applied Proteogenomics OrganizationaL Learning and Outcomes (APOLLO) Image Data",
413
+                # etc.
414
+            },
415
+            # etc.
416
+        ]
417
+    }
418
+}
157
 ```
419
 ```
158
 
420
 
159
 ### Artists
421
 ### Artists
160
 
422
 
161
 ```json
423
 ```json
162
-
424
+{
425
+    "status": "success",
426
+    "response": {
427
+        "artists": [
428
+            {
429
+                "artistId": 136,
430
+                "artistName": "Marco Cantoni"
431
+            },
432
+            {
433
+                "artistId": 124,
434
+                "artistName": "Bruce Vendt"
435
+            },
436
+            # etc.
437
+        ]
438
+    }
439
+}
163
 ```
440
 ```
164
 
441
 
165
 
442
 
175
 **Response**
452
 **Response**
176
 
453
 
177
 ```json
454
 ```json
178
-todo
455
+
179
 ```
456
 ```
180
 
457
 
181
 
458
 
189
 **Response**
466
 **Response**
190
 
467
 
191
 ```json
468
 ```json
192
-todo
469
+
193
 ```
470
 ```
194
 
471
 
195
 
472
 

Loading…
Cancel
Save