Repository navigation
Expand file tree
/
Copy pathopenapi.json
More file actions
15315 lines (15315 loc) · 453 KB
/
Copy pathopenapi.json
File metadata and controls
15315 lines (15315 loc) · 453 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
515
516
517
518
519
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
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.1.0",
"info": {
"title": "Krunker API",
"version": "0.1.4",
"summary": "The Krunker.io developer API, the game's public endpoints and the token bound ones, as krapio wraps them",
"description": "Generated from the krapio source and docs. The developer API is the official one from FRVR and needs an API key; the game and token tiers are the endpoints the game itself reads, documented from observation. Full docs: https://github.com/NullDev/krapio",
"license": {
"name": "MIT",
"identifier": "MIT"
}
},
"servers": [
{
"url": "https://gapi.svc.krunker.io",
"description": "developer API and most game endpoints"
},
{
"url": "https://api.krunker.io",
"description": "the old rest api and the ranked api"
},
{
"url": "https://matchmaker.krunker.io",
"description": "the lobby list"
}
],
"tags": [
{
"name": "developer/player",
"x-displayName": "Player Endpoints",
"description": "GET /api/player/*: profile, inventory, listings, ranked matches and posts of a player"
},
{
"name": "developer/match",
"x-displayName": "Match Endpoints",
"description": "GET /api/match/*: one ranked match with its participants"
},
{
"name": "developer/clan",
"x-displayName": "Clan Endpoints",
"description": "GET /api/clan/*: a clan's profile and members"
},
{
"name": "developer/leaderboard",
"x-displayName": "Leaderboard Endpoints",
"description": "GET /api/leaderboard/*: the ranked leaderboard per region"
},
{
"name": "developer/map",
"x-displayName": "Map Endpoints",
"description": "GET /api/map/* and /api/maps/*: map details, featured maps and map leaderboards"
},
{
"name": "developer/mods",
"x-displayName": "Mod Endpoints",
"description": "GET /api/mods/*: the mod list and single mods"
},
{
"name": "developer/market",
"x-displayName": "Market Endpoints",
"description": "GET /api/market/*: listings, owners and price history per skin"
},
{
"name": "developer/skins",
"x-displayName": "Skin Definitions",
"description": "GET /api/skins/*: the skin definitions"
},
{
"name": "developer/kpd",
"x-displayName": "KPD Endpoints",
"description": "player hacker reports; needs the `kpd` scope on the key"
},
{
"name": "developer/events",
"x-displayName": "Events",
"description": "Events tell you when something happens on Krunker, such as a map being featured. You can poll for them, or have them pushed to a webhook (below). Both use the same events.\n\nEach event type belongs to one **events scope**. A key only sees the types whose scope it holds; ask for a scope from the partner portal.\n\n| Type | Scope | Sent when |\n| --- | --- | --- |\n| `map.featured` | `events.maps` | A map was featured |\n| `map.unfeatured` | `events.maps` | A map is no longer featured |\n\nEvery key with the scope gets the event. Events are kept for 30 days."
},
{
"name": "game/players",
"x-displayName": "Players",
"description": "The social profile popup and its tabs."
},
{
"name": "game/clans",
"x-displayName": "Clans",
"description": "The in-game clan window and the recruitment board."
},
{
"name": "game/turf",
"x-displayName": "Turf Wars",
"description": "`https://gapi.svc.krunker.io/territorial-wars/*`. Days are whole UTC days since the season epoch `2026-03-17` (`TURF_EPOCH_UTC`, `turfDay(date)` in krapio). `map_id` is the Turf map: 0 Burg, 2 Sandstorm, 3 Subzero (`TURF_MAPS`). Leaderboards return 100 rows, `kd` is a float."
},
{
"name": "game/leaderboards",
"x-displayName": "Leaderboards",
"description": "GET /leaderboards/*: player, clan, raid and KrunkCup boards"
},
{
"name": "game/game",
"x-displayName": "Game",
"description": "Static data the page loads at start, and the community map and mod records."
},
{
"name": "game/market",
"x-displayName": "Market",
"description": "The reads of the market tab that answer without a token. Listings, the player's inventory and history need one, see the [token API](token-api.md)."
},
{
"name": "game/items",
"x-displayName": "Items",
"description": "The item page of the social market, by skin index."
},
{
"name": "game/social",
"x-displayName": "Social",
"description": "the social feed; a player's own posts are players.feed"
},
{
"name": "game/shop",
"x-displayName": "Shop",
"description": "The shop's catalogue. The wild offer and every purchase need the player's token."
},
{
"name": "game/matchmaker",
"x-displayName": "Matchmaker",
"description": "`https://matchmaker.krunker.io`, plain JSON without an envelope. The game polls the list every 60 seconds. krapio adds `hostname=krunker.io` to every call."
},
{
"name": "game/legacy",
"x-displayName": "Legacy",
"description": "`https://api.krunker.io`, the old REST API. Only the paths the page calls without a token."
},
{
"name": "token/player",
"x-displayName": "Player",
"description": "The token's own account."
},
{
"name": "token/market",
"x-displayName": "Market",
"description": "The market behind a login. Market stats and item pages answer without a token, see the [game API](game-api.md#market)."
},
{
"name": "token/trades",
"x-displayName": "Trades",
"description": "Player to player trades. Creating, accepting and cancelling are writes and are not in krapio."
},
{
"name": "token/shop",
"x-displayName": "Shop",
"description": "Per player shop state and the player's own custom skins."
},
{
"name": "token/creator",
"x-displayName": "Creator",
"description": "What a creator sees of their own maps and studios, plus the player's clan applications. The studio replies are untyped in krapio (`unknown`), only their existence was verified."
},
{
"name": "token/staff",
"x-displayName": "Staff",
"description": "Role gated reads for moderators and KPD reviewers. A normal account gets a 403 `insufficient permissions` (or `not authorized` for reports). The replies are untyped in krapio, no account with the role was available to verify them.\n\n`me.staff.chatBan(playerName)`, `.reports(playerName)`, `.kpdDemos({ off, q })`, `.kpdDemo(demoId, ct?)`, `.kpdReviewers()`\n\n`chatBan` is a player's chat ban, `kpdDemos` the demo review queue (`off` is the offset, `q` a search), `kpdDemo` one demo where `ct` is the review ticket the game passes along."
},
{
"name": "token/ranked",
"x-displayName": "Ranked",
"description": "`https://api.krunker.io`, the ranked system's own API. Every call answers 401 `Access token required` without a token, including the public leaderboard."
}
],
"x-tagGroups": [
{
"name": "Developer API",
"tags": [
"developer/player",
"developer/match",
"developer/clan",
"developer/leaderboard",
"developer/map",
"developer/mods",
"developer/market",
"developer/skins",
"developer/kpd",
"developer/events"
]
},
{
"name": "Game API",
"tags": [
"game/players",
"game/clans",
"game/turf",
"game/leaderboards",
"game/game",
"game/market",
"game/items",
"game/social",
"game/shop",
"game/matchmaker",
"game/legacy"
]
},
{
"name": "Token API",
"tags": [
"token/player",
"token/market",
"token/trades",
"token/shop",
"token/creator",
"token/staff",
"token/ranked"
]
}
],
"paths": {
"/api/clan/{clanName}": {
"get": {
"operationId": "clan.profile",
"summary": "Get Clan Profile",
"description": "Retrieve a clan's public information.\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| clanname | string | path | yes | The clan's name |\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| name | string | Clan name |\n| owner_name | string | Name of the clan owner |\n| score | int64 | Clan's total score |\n| rank | int | Clan's leaderboard rank |\n| member_count | int | Number of members in the clan |\n| created_at | string | Clan creation date |\n| discord | string | Discord invite code (empty string if not set) |",
"tags": [
"developer/clan"
],
"x-krapio": "krunker.clan.profile()",
"x-routes": [
"clan.profile"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst profile = await krunker.clan.profile(clanName);\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "clanName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1
},
"description": "The clan's name"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClanProfile"
},
"example": {
"name": "Elite Squad",
"owner_name": "ClanLeader",
"score": 5000000,
"rank": 15,
"member_count": 25,
"created_at": "2023-06-01T00:00:00Z",
"discord": "abc123xyz"
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/clan/{clanName}/members": {
"get": {
"operationId": "clan.members",
"summary": "Get Clan Members",
"description": "Retrieve a clan's member list (paginated).\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| clanname | string | path | yes | The clan's name |\n| page | int | query | no | Page number (default: 1) |\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| player_name | string | Member's username |\n| role | int | Member's role in the clan |\n| verified | bool | Whether the player is verified |\n| score | int | *undocumented* - the member's total score |\n\n**Notes:**\n\n- Page size is fixed at 10 records\n- Members are sorted by role (descending), then by score (descending)",
"tags": [
"developer/clan"
],
"x-krapio": "krunker.clan.members()",
"x-routes": [
"clan.members"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst members = await krunker.clan.members(clanName, { page });\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "clanName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1
},
"description": "The clan's name"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"default": 1
},
"description": "Page number (default: 1)"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClanMembers"
},
"example": {
"page": 1,
"per_page": 10,
"members": [
{
"player_name": "ClanLeader",
"role": 3,
"verified": true
},
{
"player_name": "Member1",
"role": 1,
"verified": false
}
]
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/events": {
"get": {
"operationId": "events.list",
"summary": "List Events",
"description": "Returns events newer than `after`, oldest first. Store `next` and pass it as `after` on your next call. Start with `after=0`. Keep the same filters between calls; `next` also moves past events your filters skipped, so changing filters later does not bring those back.\n\n**Rate limit:** 6 requests per minute per key, on top of the general limit. The `X-RateLimit-*` headers on this endpoint describe this 6-per-minute limit. Poll every 20 to 60 seconds; if `has_more` is `true`, fetch the next page right away.\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| after | int | query | no | Event id cursor (default 0) |\n| types | string | query | no | Comma-separated event types to return (default: all your scopes allow) |\n| target_type | string | query | no | Only events about this kind of target, e.g. `map` |\n| target_id | string | query | no | Comma-separated target ids, up to 100 (needs `target_type`), e.g. `target_type=map&target_id=8497,8500` |\n| limit | int | query | no | 1 to 100 (default 100) |\n\nEvents appear a few seconds after they happen. Ids only increase; gaps are normal.\n\n**Event data:**\n\n| Type | `data` fields |\n| --- | --- |\n| `map.featured`, `map.unfeatured` | `map_id`, `map_name`, `creator` |",
"tags": [
"developer/events"
],
"x-krapio": "krunker.events.list()",
"x-routes": [
"events.list"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst list = await krunker.events.list({ after, types, target_type, target_id, limit });\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "after",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0
},
"description": "event id cursor, the `next` of the previous page; 0 when omitted"
},
{
"name": "types",
"in": "query",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"description": "only these types; everything the key's scopes allow when omitted",
"style": "form",
"explode": false
},
{
"name": "target_type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"minLength": 1
},
"description": "only events about this kind of target, e.g. \"map\""
},
{
"name": "target_id",
"in": "query",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100
},
"description": "only these targets, 100 at most, needs target_type",
"style": "form",
"explode": false
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"description": "1 to 100, 100 when omitted"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EventsPage"
},
"example": {
"events": [
{
"id": 1042,
"type": "map.featured",
"created_at": "2026-10-10T19:30:12Z",
"target": {
"type": "map",
"id": 8497
},
"data": {
"map_id": 8497,
"map_name": "Bhop_Ravine",
"creator": "someone"
}
}
],
"next": 1042,
"has_more": false
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/kpd/latest-calls": {
"get": {
"operationId": "kpd.latestCalls",
"summary": "Get Latest KPD Calls",
"description": "List the 50 most recent KPD (player hacker-report) calls, newest first, across all statuses so officer verdicts are visible. Requires the `kpd` scope.\n\n**Parameters:**\n\nNone.\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| id | int | Report id |\n| date | string | Call time (RFC 3339, UTC) |\n| caller_id | int | Reporter player id |\n| caller_name | string | Reporter name |\n| caller_score | int | Reporter score |\n| caller_job_rating | int | Reporter's total KPD job rating |\n| caller_job_rating_positive | int | Reporter's correct (positive) call count |\n| called_id | int | Reported player id |\n| called_name | string | Reported player name (`guest` if unregistered) |\n| called_score | int | Reported player score |\n| kdf_type | int | Call context: 0=public, 1=ranked, 2=comp, 3=custom |\n| kdf_type_label | string | Readable kdf_type |\n| status | int | 1=not responded, 2=responded, 3=reviewed |\n| status_label | string | Readable status |\n| rating | int | Officer verdict: 0=pending, 1=banned, 2=rejected |\n| rating_label | string | Readable rating |\n| officer_id | int | Officer who handled the call (0 if none) |\n| officer_name | string | Officer name |\n| status_date | string | Last status change (RFC 3339, UTC) |\n| game_code | string | Game instance code |\n| host | string | Game server host |\n| port | string | Game server port |\n| token | string | Internal call token |\n\n**Notes:**\n\n- Player IP addresses are not exposed.\n- A fixed window of the 50 most recent calls; there is no pagination.",
"tags": [
"developer/kpd"
],
"x-krapio": "krunker.kpd.latestCalls()",
"x-routes": [
"kpd.latestCalls"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst latestCalls = await krunker.kpd.latestCalls();\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/KpdCall"
}
},
"example": [
{
"id": 3314982,
"date": "2026-06-30T09:41:12Z",
"caller_id": 2,
"caller_name": "player",
"caller_score": 184320,
"caller_job_rating": 12,
"caller_job_rating_positive": 9,
"called_id": 81234,
"called_name": "suspect",
"called_score": 4521,
"kdf_type": 0,
"kdf_type_label": "public",
"status": 3,
"status_label": "reviewed",
"rating": 1,
"rating_label": "banned",
"officer_id": 47707163,
"officer_name": "Officer",
"status_date": "2026-06-30T09:45:03Z",
"game_code": "ab12cd",
"host": "ny.krunker.io",
"port": "5000",
"token": "a1b2c3d4e5f6g7h"
}
]
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/leaderboard/{region}": {
"get": {
"operationId": "leaderboard.ranked",
"summary": "Get Ranked Leaderboard",
"description": "Retrieve the ranked leaderboard for a specific region.\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| region | int | path | yes | The region ID (2 = Asia, 3 = Europe, 4 = North America) |\n| page | int | query | no | Page number (default: 1) |\n| season | int | query | no | Season number (default: current season) |\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| page | int | Current page number |\n| per_page | int | Number of entries per page (10) |\n| season | int | Current ranked season |\n| region | int | Region ID |\n| entries | object\\[\\] | Array of leaderboard entries |\n| entries\\[\\].position | int | Leaderboard position |\n| entries\\[\\].player_name | string | Player's username |\n| entries\\[\\].mmr | int | Matchmaking rating |\n| entries\\[\\].wins | int | Total ranked wins |\n| entries\\[\\].losses | int | Total ranked losses |\n| entries\\[\\].kills | int | Total kills in ranked matches |\n| entries\\[\\].deaths | int | Total deaths in ranked matches |\n| entries\\[\\].assists | int | Total assists in ranked matches |\n| entries\\[\\].score | int | Total score in ranked matches |\n| entries\\[\\].damage_done | int | Total damage dealt in ranked matches |\n\n**Notes:**\n\n- Only players with 6+ completed placement matches appear on the leaderboard\n- Page size is fixed at 10 records\n- Entries are sorted by MMR descending\n- Use the `season` parameter to query historical seasons (omit or set to 0 for current season)",
"tags": [
"developer/leaderboard"
],
"x-krapio": "krunker.leaderboard.ranked()",
"x-routes": [
"leaderboard.ranked"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst ranked = await krunker.leaderboard.ranked(region, { page, season });\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "region",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 0
},
"description": "The region ID (2 = Asia, 3 = Europe, 4 = North America)"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"default": 1
},
"description": "Page number (default: 1)"
},
{
"name": "season",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0
},
"description": "season number, current season when omitted or 0"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RankedLeaderboard"
},
"example": {
"page": 1,
"per_page": 10,
"season": 5,
"region": 0,
"entries": [
{
"position": 1,
"player_name": "TopPlayer",
"mmr": 2500,
"wins": 150,
"losses": 50,
"kills": 3000,
"deaths": 1500,
"assists": 800,
"score": 50000,
"damage_done": 450000
}
]
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/map/{mapName}": {
"get": {
"operationId": "map.get",
"summary": "Get Map by Name",
"description": "Retrieve map information by its name.\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| mapname | string | path | yes | The map's name (URL encoded) |\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| map_id | int | Unique map identifier |\n| name | string | Map name |\n| description | string | Map description |\n| creator_name | string | Username of the map creator |\n| votes | int | Total upvotes |\n| gameplays | int | Number of times the map has been played |\n| playtime | int64 | Total playtime in milliseconds |\n| category | int | Map category ID |\n| created_at | string | When the map was created |\n| updated_at | string | When the map was last updated |\n| leaderboard_type | string | Type of leaderboard (e.g., \"time\", \"score\", empty if none) |\n| leaderboard_order | int | Sort order for leaderboard (0 = ascending/lower is better, 1 = descending/higher is better) |\n| featured | bool | *undocumented* - whether the map is currently featured |\n\n**Notes:**\n\n- Returns 404 if map not found or is restricted/deleted\n- Map name is case-sensitive (*observed*: it is not, `burg` finds `Burg`)\n- *observed*: `created_at` and `updated_at` come as `YYYY-MM-DD HH:MM:SS`, not RFC3339",
"tags": [
"developer/map"
],
"x-krapio": "krunker.map.get()",
"x-routes": [
"map.get"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst get = await krunker.map.get(mapName);\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "mapName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1
},
"description": "The map's name (URL encoded)"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MapInfo"
},
"example": {
"map_id": 12345,
"name": "MyAwesomeMap",
"description": "A fun parkour map",
"creator_name": "MapMaker",
"votes": 500,
"gameplays": 10000,
"playtime": 3600000,
"category": 5,
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-06-20T14:00:00Z",
"leaderboard_type": "time",
"leaderboard_order": 0
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/maps/featured": {
"get": {
"operationId": "map.featured",
"summary": "Get Featured Maps",
"description": "List every map that is currently featured, newest first. Use [Get Map by Name](#get-map-by-name) for a map's details. To be told when a map is featured or unfeatured, use [Events](#events).\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| maps\\[\\].map_id | int | Unique map identifier |\n| maps\\[\\].name | string | Map name |\n| maps\\[\\].creator_id | int | Player id of the map creator |\n| maps\\[\\].creator_name | string | Username of the map creator |\n| count | int | Number of maps returned |",
"tags": [
"developer/map"
],
"x-krapio": "krunker.map.featured()",
"x-routes": [
"map.featured"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst featured = await krunker.map.featured();\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeaturedMaps"
},
"example": {
"maps": [
{
"map_id": 12345,
"name": "MyAwesomeMap",
"creator_id": 11443974,
"creator_name": "MapMaker"
}
],
"count": 1
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/map/{mapName}/leaderboard": {
"get": {
"operationId": "map.leaderboard",
"summary": "Get Map Leaderboard",
"description": "Retrieve the leaderboard for a specific map (paginated).\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| mapname | string | path | yes | The map's name (URL encoded) |\n| page | int | query | no | Page number (default: 1) |\n| type | string | query | no | Built-in leaderboard to rank on: `score` or `time`. Defaults to the map's configured leaderboard |\n| order | int | query | no | 0 = ascending, 1 = descending. Defaults to the map's order for its configured leaderboard; otherwise ascending for `time`, descending for `score` |\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| page | int | Current page number |\n| per_page | int | Number of entries per page (25) |\n| map_name | string | The map name queried |\n| leaderboard_type | string | Type of leaderboard (e.g., \"time\", \"score\") |\n| leaderboard_order | int | Sort order (0 = ascending, 1 = descending) |\n| entries | object\\[\\] | Array of leaderboard entries |\n| entries\\[\\].position | int | Leaderboard position |\n| entries\\[\\].player_name | string | Player's username |\n| entries\\[\\].value | int | Score or time value |\n| entries\\[\\].date | string | When the entry was recorded |\n\n**Notes:**\n\n- Returns empty entries array if the map has no leaderboard configured\n- Maps can show both a score and a time leaderboard in-game; use `type` (and `order`) to fetch either. Invalid values return 400\n- Page size is fixed at 25 records\n- Entries are sorted by value according to leaderboard_order",
"tags": [
"developer/map"
],
"x-krapio": "krunker.map.leaderboard()",
"x-routes": [
"map.leaderboard"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst leaderboard = await krunker.map.leaderboard(mapName, { page, type, order });\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "mapName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1
},
"description": "The map's name (URL encoded)"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"default": 1
},
"description": "Page number (default: 1)"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"score",
"time"
]
},
"description": "which built-in board, the map's configured one when omitted"
},
{
"name": "order",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"enum": [
0,
1
]
},
"description": "the map's order when omitted, else ascending for time and descending for score"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MapLeaderboard"
},
"example": {
"page": 1,
"per_page": 25,
"map_name": "MyAwesomeMap",
"leaderboard_type": "time",
"leaderboard_order": 0,
"entries": [
{
"position": 1,
"player_name": "SpeedRunner",
"value": 12345,
"date": "2024-01-15T10:30:00Z"
}
]
}
}
}
},
"default": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiErrorBody"
}
}
}
}
}
}
},
"/api/map/{mapName}/leaderboard/player/{playerName}": {
"get": {
"operationId": "map.leaderboardPlayer",
"summary": "Get Map Leaderboard Player",
"description": "Look up a specific player's position on a map leaderboard.\n\n**Parameters:**\n\n| Name | Type | Location | Required | Description |\n| --- | --- | --- | --- | --- |\n| mapname | string | path | yes | The map's name (URL encoded) |\n| playername | string | path | yes | The player's username (URL encoded) |\n| type | string | query | no | Built-in leaderboard to rank on: `score` or `time`. Defaults to the map's configured leaderboard |\n| order | int | query | no | 0 = ascending, 1 = descending. Defaults to the map's order for its configured leaderboard; otherwise ascending for `time`, descending for `score` |\n\n**Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| map_name | string | The map name queried |\n| leaderboard_type | string | Type of leaderboard (e.g., \"time\", \"score\") |\n| leaderboard_order | int | Sort order (0 = ascending, 1 = descending) |\n| player_name | string | Player's username |\n| position | int | Player's position on the leaderboard |\n| value | int | Player's score or time value |\n| date | string | When the entry was recorded |\n\n**Notes:**\n\n- Returns 404 if the map has no leaderboard (and no `type` is given) or the player has no entry\n- Position is calculated dynamically based on current leaderboard standings",
"tags": [
"developer/map"
],
"x-krapio": "krunker.map.leaderboardPlayer()",
"x-routes": [
"map.leaderboardPlayer"
],
"x-codeSamples": [
{
"lang": "ts",
"label": "krapio",
"source": "import { Krunker } from \"krapio\";\n\nconst krunker = new Krunker({ apiKey: process.env.KRUNKER_API_KEY });\nconst leaderboardPlayer = await krunker.map.leaderboardPlayer(mapName, playerName, { type, order });\n"
}
],
"security": [
{
"developerApiKey": []
}
],
"parameters": [
{
"name": "mapName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1
},
"description": "The map's name (URL encoded)"
},
{
"name": "playerName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1,
"example": "NulPing"
},
"description": "The player's username (URL encoded)"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"score",
"time"
]
},
"description": "which built-in board, the map's configured one when omitted"
},
{
"name": "order",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"enum": [
0,
1
]
},
"description": "the map's order when omitted, else ascending for time and descending for score"
}
],
"responses": {