PageSourceSearch

https://tomato.gg/assets/api-JMwP7lit.js

js tomato.gg collected 2026-10-04 05:20:58 UTC 34,486 bytes, 116 lines download raw bytes

1import{r as a,au as W,av as O,aw as G,M as k,j as e,ag as A,c as U,d as n,t as r}from"./index-D6h6POgK.js";import{p as w}from"./IconBase.es-WW36fNXK.js";import{o as Y}from"./Check.es-BCE9SDg6.js";const J=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),a.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),K=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,76H180V56A52,52,0,0,0,76,56V76H48A20,20,0,0,0,28,96V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V96A20,20,0,0,0,208,76ZM100,56a28,28,0,0,1,56,0V76H100ZM204,204H52V100H204Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,96V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V96a8,8,0,0,1,8-8H208A8,8,0,0,1,216,96Z",opacity:"0.2"}),a.createElement("path",{d:"M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,82H174V56a46,46,0,0,0-92,0V82H48A14,14,0,0,0,34,96V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V96A14,14,0,0,0,208,82ZM94,56a34,34,0,0,1,68,0V82H94ZM210,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V96a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,84H172V56a44,44,0,0,0-88,0V84H48A12,12,0,0,0,36,96V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V96A12,12,0,0,0,208,84ZM92,56a36,36,0,0,1,72,0V84H92ZM212,208a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V96a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z"}))]]),R=a.forwardRef((t,o)=>a.createElement(w,{ref:o,...t,weights:W}));R.displayName="ArrowUpIcon";const M=a.forwardRef((t,o)=>a.createElement(w,{ref:o,...t,weights:O}));M.displayName="CaretDownIcon";const Z=a.forwardRef((t,o)=>a.createElement(w,{ref:o,...t,weights:J}));Z.displayName="CopyIcon";const T=a.forwardRef((t,o)=>a.createElement(w,{ref:o,...t,weights:K}));T.displayName="LockSimpleIcon";const q=a.forwardRef((t,o)=>a.createElement(w,{ref:o,...t,weights:G}));q.displayName="MagnifyingGlassIcon";const H=k+1,N=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,B=t=>t.replace(/^\/api\//,"").split("/").filter(o=>o&&!o.startsWith(":")).join("-"),X=n.div.withConfig({displayName:"ApiDocumentationPage__Page",componentId:"sc-1luhpe6-0"})(["width:100%;max-width:1180px;margin:0 auto;padding:40px 16px 80px;
1display:flex;flex-direction:column;gap:28px;@media (min-width:","px){flex-direction:row;align-items:flex-start;gap:32px;}@media (max-width:","px){padding:8px 12px 64px;gap:16px;}"],H,k),Q=n.aside.withConfig({displayName:"ApiDocumentationPage__Sidebar",componentId:"sc-1luhpe6-1"})(["width:100%;flex-shrink:0;@media (min-width:","px){position:sticky;top:90px;width:248px;max-height:calc(100vh - 110px);overflow-y:auto;overscroll-behavior:contain;padding-right:4px;}"],H),ee=n.main.withConfig({displayName:"ApiDocumentationPage__Content",componentId:"sc-1luhpe6-2"})(["flex:1;min-width:0;display:flex;flex-direction:column;gap:20px;@media (max-width:","px){gap:12px;}"],k),ae=n.section.withConfig({displayName:"ApiDocumentationPage__Section",componentId:"sc-1luhpe6-3"})(["scroll-margin-top:96px;"]),te=n.div.withConfig({displayName:"ApiDocumentationPage__FilterRow",componentId:"sc-1luhpe6-4"})(["display:flex;align-items:center;gap:8px;background:",";border-radius:8px;padding:0 10px;color:",";transition:0.2s;&:focus-within{background:",";box-shadow:0px 0px 10px rgb(10,10,10);color:",";}input{flex:1;min-width:0;border:none;outline:none;background:transparent;color:",";font-family:var(--font-inter);font-size:14px;padding:9px 0;}input::placeholder{color:",";}"],r.darkgray1,r.gray4,r.darkgray0,r.gray3,r.gray2,r.gray4),re=n.button.withConfig({displayName:"ApiDocumentationPage__MobileToggle",componentId:"sc-1luhpe6-5"})(["display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:8px;padding:10px 12px;border:1px solid ",";border-radius:8px;background:",";color:",';font-family:var(--font-inter);font-size:14px;font-weight:500;cursor:pointer;svg{transition:transform 0.2s;}&[aria-expanded="true"] svg{transform:rotate(180deg);}@media (min-width:',"px){display:none;}"],r.darkgray1,r.darkgray2,r.gray2,H),se=n.nav.withConfig({displayName:"ApiDocumentationPage__Nav",componentId:"sc-1luhpe6-6"})(['margin-top:10px;display:flex;flex-direction:column;gap:18px;&[data-open="false"]{display:none;}@media (min-width:','px){margin-top:16px;&,&[data-open="false"]{display:flex;}}@media (prefers-reduced-motion:no-preference){scroll-behavior:smooth;}'],H),ne=n.div.withConfig({displayName:"ApiDocumentationPage__NavGroup",componentId:"sc-1luhpe6-7"})(["display:flex;flex-direction:column;gap:2px;"]),oe=n.div.withConfig({displayName:"ApiDocumentationPage__NavGroupLabel",componentId:"sc-1luhpe6-8"})(["font-size:11px;font-weight:600;letter-spacing:0.5px;color:",";padding:0 10px 6px;"],r.gray5),ie=n.a.withConfig({displayName:"ApiDocumentationPage__NavLink",componentId:"sc-1luhpe6-9"})(["display:block;padding:6px 10px;border-radius:6px;font-size:13px;line-height:1.35;color:",";background:",";font-weight:",";cursor:pointer;transition:background 0.15s,color 0.15s;&:hover{color:",";background:",";}"],({$active:t})=>t?r.red:r.gray3,({$active:t})=>t?r.redTransparent:"transparent",({$active:t})=>t?500:400,({$active:t})=>t?r.red:r.gray1,({$active:t})=>t?r.redTransparent:r.darkgray2),le=n.div.withConfig({displayName:"ApiDocumentationPage__NavEmpty",componentId:"sc-1luhpe6-10"})(["padding:8px 10px;font-size:13px;color:",";"],r.gray5),E=n.div.withConfig({displayName:"ApiDocumentationPage__CardInner",componentId:"sc-1luhpe6-11"})(["color:",";padding:10px;display:flex;flex-direction:column;gap:18px;code{font-family:var(--font-roboto-mono),monospace;font-size:13px;background:",";padding:2px 6px;border-radius:4px;color:",";}"],r.gray3,r.darkgray3,r.gray2),pe=n.div.withConfig({displayName:"ApiDocumentationPage__EndpointHeader",componentId:"sc-1luhpe6-12"})(["display:flex;align-items:center;gap:10px;flex-wrap:wrap;"]),de=n.span.withConfig({displayName:"ApiDocumentationPage__Method",componentId:"sc-1luhpe6-13"})(["font-family:var(--font-roboto-mono),monospace;font-size:12px;font-weight:700;letter-spacing:1px;color:",";background:",";padding:3px 8px;border-radius:4px;"],r.gray2,r.darkgray3),ce=n.span.withConfig({displayName:"ApiDocumentationPage__Path",componentId:"sc-1luhpe6-14"})(["font-family:var(--font-roboto-mono),monospace;font-size:14px;color:",";word-break:break-all;"],r.gray1),me=n.span.withConfig({displayName:"ApiDocumentationPage__AuthBadge",componentId:"sc-1luhpe6-15"})(["display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;letter-spacing:0.3px;color:",";background:",";padding:3px 8px;border-radius:999px;"],r.red,r.redTransparent),b=n.p.withConfig({displayName:"ApiDocumentationPage__Description",componentId:"sc-1luhpe6-16"})(["margin:0;font-size:14px;line-height:1.5;color:",";"],r.gray3),g=n.div.withConfig({displayName:"ApiDocumentationPage__SectionTitle",componentId:"sc-1luhpe6-17"})(["font-size:13px;font-weight:600;color:",";"],r.gray3),ue=n.div.withConfig({displayName:"ApiDocumentationPage__AuthNote",componentId:"sc-1luhpe6-18"})(["display:flex;gap:10px;font-size:13px;line-height:1.5;color:",";background:",";border:1px solid ",";border-radius:8px;padding:10px 12px;svg{flex-shrink:0;margin-top:1px;color:",";}b{color:",";}"],r.gray2,r.redTransparent,r.primary6,r.red,r.gray1),ge=n.table.withConfig({displayName:"ApiDocumentationPage__ParamTableEl",componentId:"sc-1luhpe6-19"})(["width:100%;border-collapse:collapse;font-size:13px;th{text-align:left;font-weight:600;color:",";font-size:11px;letter-spacing:0.5px;padding:0 16px 8px 0;border-bottom:1px solid ",";white-space:nowrap;}td{padding:9px 16px 9px 0;vertical-align:top;border-bottom:1px solid ",";}tbody tr:last-child td{border-bottom:none;}.name{font-family:var(--font-roboto-mono),monospace;color:",";white-space:nowrap;}.type{font-family:var(--font-roboto-mono),monospace;color:",";white-space:nowrap;}.desc{color:",";line-height:1.5;width:100%;}@media (max-width:","px){thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}tbody tr{display:flex;flex-direction:column;gap:2px;padding:10px 0;border-bottom:1px solid ",";}td{border:none;padding:0;white-space:normal;}td.type{white-space:normal;}td::before{content:attr(data-label);display:block;font-size:10px;font-weight:600;letter-spacing:0.5px;color:",";margin-bottom:1px;}td.name::before,td.type::before{display:inline;margin-right:6px;}}
1"],r.gray4,r.darkgray1,r.darkgray2,r.gray1,r.gray4,r.gray3,k,r.darkgray2,r.gray5),he=n.div.withConfig({displayName:"ApiDocumentationPage__CodeWrap",componentId:"sc-1luhpe6-20"})(["position:relative;"]),ye=n.button.withConfig({displayName:"ApiDocumentationPage__CopyBtn",componentId:"sc-1luhpe6-21"})(["position:absolute;top:8px;right:8px;z-index:1;display:inline-flex;align-items:center;gap:5px;font-family:var(--font-inter);font-size:12px;font-weight:500;color:",";background:",";border:1px solid ",";border-radius:6px;padding:4px 8px;cursor:pointer;transition:background 0.15s,color 0.15s;&:hover{background:",";color:",';}&[data-copied="true"]{color:',";}"],r.gray3,r.darkgray1,r.darkgray0,r.darkgray0,r.gray1,r.green),xe=n.pre.withConfig({displayName:"ApiDocumentationPage__CodeBlock",componentId:"sc-1luhpe6-22"})(["font-family:var(--font-roboto-mono),monospace;font-size:12.5px;line-height:1.6;background:",";color:",";padding:14px 16px;border-radius:8px;overflow-x:auto;margin:0;white-space:pre;"],r.darkgray3,r.gray2),fe=n.button.withConfig({displayName:"ApiDocumentationPage__BackToTop",componentId:"sc-1luhpe6-23"})(["position:fixed;bottom:24px;right:24px;z-index:50;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:999px;border:1px solid ",";background:",";color:",";cursor:pointer;opacity:",";transform:translateY(",");pointer-events:",";transition:opacity 0.2s,transform 0.2s,background 0.15s;&:hover{background:",";}@media (prefers-reduced-motion:reduce){transition:opacity 0.2s;transform:none;}"],r.darkgray0,r.darkgray2,r.gray1,({$visible:t})=>t?1:0,({$visible:t})=>t?"0":"8px",({$visible:t})=>t?"auto":"none",r.darkgray0),be=["Player Stats","Tank Stats","Battles & Loadouts","Bulk"],i="https://api.tomato.gg",c={name:"server",type:"string",desc:e.jsxs(e.Fragment,{children:["One of ",e.jsx("code",{children:"com"}),", ",e.jsx("code",{children:"eu"}),", ",e.jsx("code",{children:"asia"}),"."]})},l={name:"id",type:"number",desc:"The player's Wargaming account ID."},V={name:"cache",type:"string",desc:e.jsxs(e.Fragment,{children:["When ",e.jsx("code",{children:"true"}),", only returns a cached result and responds with ",e.jsx("code",{children:"404"})," if none is available."]})},C=[{name:"page",type:"number",desc:"Zero-based page index. Defaults to 0."},{name:"pageSize",type:"number",desc:"Rows per page. Defaults to 10."},{name:"days",type:"number",desc:"Only include battles from the last N days. Defaults to 365."},{name:"battleType",type:"string",desc:"Game mode filter (e.g. random battles, frontline, onslaught)."},{name:"tankId",type:"number",desc:"Restrict to a single tank."},{name:"mapId",type:"number",desc:"Restrict to a single map."},{name:"arenaId",type:"number",desc:"Restrict to a single battle arena."},{name:"sortBy",type:"string",desc:"Column to sort by. Defaults to battle_time."},{name:"sortDirection",type:'"asc" | "desc"',desc:"Sort direction. Defaults to desc."},{name:"platoon",type:"string",desc:'One of "in-platoon", "outside-platoon", "in-and-outside-platoon" (default).'},{name:"spawn",type:'"first" | "second" | "all"',desc:"Filter by spawn side."},{name:"won",type:'"won" | "lost" | "draw" | "all"',desc:"Filter by battle outcome."},{name:"tankType",type:'"tech-tree" | "premium" | "all"',desc:"Filter by tank type."}],I=e.jsxs(e.Fragment,{children:["Subject to the player's visibility settings. Private profiles require an authenticated request from the owner and otherwise respond with ",e.jsx("code",{children:"403"}),"."]}),S=[{title:"Recent Player Stats",group:"Player Stats",path:"/api/player/recents/:server/:id",description:"Returns a player's recent statistics, computed over the requested day periods and/or battle counts. Stats are derived by diffing the player's current totals against stored snapshots.",pathParams:[c,l],queryParams:[{name:"days",type:"string",desc:e.jsxs(e.Fragment,{children:["Comma-separated list of day periods to compute stats over, e.g. ",e.jsx("code",{children:"30,60,90"}),"."]})},{name:"battles",type:"string",desc:e.jsxs(e.Fragment,{children:["Comma-separated list of recent battle counts to compute stats over, e.g."," ",e.jsx("code",{children:"100,500,1000"}),"."]})},V],example:`curl "${i}/api/player/recents/com/1001234567?days=30,60&battles=100" \\
2  -H "x-api-key: tmgg_your_key_here"`,response:`{
3  "meta": { "id": 1001234567, "cached": false, "status": "good" },
4  "data": {
5    "days": {
6      "30": { /* recent stats for the last 30 days */ },
7      "60": { /* recent stats for the last 60 days */ }
8    },
9    "battles": {
10      "100": { /* recent stats for the last 100 battles */ }
11    }
12  }
13}`},{title:"Overall Player Stats",group:"Player Stats",path:"/api/player/overall/:server/:id",description:"Returns a player's lifetime (overall) statistics, including per-tank stats, achievements and DPG rankings.",pathParams:[c,l],queryParams:[V],example:`curl "${i}/api/player/overall/com/1001234567" \\
14  -H "x-api-key: tmgg_your_key_here"`,response:`{
15  "meta": { "status": "good", "id": 1001234567, "cached": false },
16  "data": { /* overall summary, per-tank stats, achievements, rankings */ }
17}`},{title:"Player Sessions",group:"Player Stats",path:"/api/player/sessions/:server/:id",description:"Returns the player'
17s recorded stat sessions, grouped by day, week and month. Each grouping summarises performance across that period.",pathParams:[c,l],queryParams:[{name:"days",type:"number",desc:"Limit sessions to the last N days."},{name:"showTanks",type:'"true" | "false"',desc:'Include per-tank breakdowns within each session. Defaults to "false".'},V],example:`curl "${i}/api/player/sessions/com/1001234567?days=30&showTanks=true" \\
18  -H "x-api-key: tmgg_your_key_here"`,response:`{
19  "meta": { "status": "good", "id": 1001234567, "cached": false },
20  "data": {
21    "sesday": [ /* daily sessions */ ],
22    "sesweek": [ /* weekly sessions */ ],
23    "sesmonth": [ /* monthly sessions */ ]
24  }
25}`},{title:"Overall Stats Tracker",group:"Player Stats",path:"/api/player/overall-tracker/:server/:id",description:"Returns the player's overall stats over time, ordered by total battles. Useful for plotting how lifetime WN8, win rate and other averages have evolved.",pathParams:[c,l],example:`curl "${i}/api/player/overall-tracker/com/1001234567" \\
26  -H "x-api-key: tmgg_your_key_here"`,response:`{
27  "meta": { "status": "good", "id": 1001234567 },
28  "data": [
29    { "battles": 1000, "wn8": 1850, "wnx": 1790, "winrate": 52.1, "dpg": 1900, "frags": 1.1, "survived": 41.2, "spots": 1.3, "damageReceived": 1600, "xp": 620 }
30  ]
31}`},{title:"Player Rankings",group:"Player Stats",path:"/api/player/rankings/:server/:id/:type",description:"Returns a player's leaderboard rankings, both overall and per-tank. Choose between lifetime (overall) and recent rankings.",pathParams:[c,l,{name:"type",type:'"overall" | "recent"',desc:"Which ranking set to return."}],example:`curl "${i}/api/player/rankings/com/1001234567/overall" \\
32  -H "x-api-key: tmgg_your_key_here"`,response:`{
33  "meta": { "status": "good" },
34  "data": {
35    "overall": { /* overall ranking */ },
36    "tanks": [ /* per-tank rankings */ ]
37  }
38}`},{title:"Player Map Stats",group:"Player Stats",path:"/api/player/map-stats/:id",description:"Returns a player's per-map performance for standard random battles, including WN8, win rate and a wide set of per-battle averages. Set detailed=true to break results down by battle type.",pathParams:[l],queryParams:[{name:"days",type:"number",desc:"Only include battles from the last N days."},{name:"detailed",type:'"true" | "false"',desc:"When true, splits each map by battle type (standard / encounter / assault)."},{name:"tiers",type:"string",desc:"Comma-separated tier filter (booleans for tiers 1–11)."},{name:"classes",type:"string",desc:"Comma-separated class filter (HT, MT, LT, TD, SPG)."},{name:"nations",type:"string",desc:"Comma-separated nation filter."},{name:"tankId",type:"number",desc:"Restrict to a single tank."}],example:`curl "${i}/api/player/map-stats/1001234567?days=90&detailed=true" \\
39  -H "x-api-key: tmgg_your_key_here"`,response:`{
40  "meta": { "status": "good", "player_id": 1001234567 },
41  "data": [
42    { "display_name": "Prokhorovka", "battles": 42, "winrate": 54.8, "WN8": 2100, "avg_damage": 2300, /* ... */ }
43  ]
44}`},{title:"Onslaught Progression",group:"Player Stats",path:"/api/player/onslaught/:id",description:"Returns a player's Onslaught rating progression over the last 60 days. Calibration battles (rating 0) are excluded.",pathParams:[l],example:`curl "${i}/api/player/onslaught/1001234567" \\
45  -H "x-api-key: tmgg_your_key_here"`,response:`{
46  "meta": { "status": "good" },
47  "data": [
48    { "arena_id": 123456789, "battle_time": 1748736000000, "rating": 2450, "delta": 25, "tank_id": 5137 }
49  ]
50}`},{title:"Individual Tank Sessions",group:"Tank Stats",path:"/api/player/tank-sessions/:server/:id/:tankid",description:"Returns a single tank's session history for a player, bucketed by day, week and month. Each record includes WN8 and the core per-battle averages for that period.",pathParams:[c,l,{name:"tankid",type:"number",desc:"The tank ID to fetch sessions for."}],example:`curl "${i}/api/player/tank-sessions/com/1001234567/5137" \\
51  -H "x-api-key: tmgg_your_key_here"`,response:`{
52  "day":   [ { "timestamp": "2026-06-01T00:00:00.000Z", "battles": 12, "winrate": 58.3, "dpg": 2450, "WN8": 2310, /* ... */ } ],
53  "week":  [ /* weekly buckets */ ],
54  "month": [ /* monthly buckets */ ]
55}`},{title:"Tank Recent Stats",group:"Tank Stats",path:"/api/player/tank-recents/:server/:id/:tankId",description:"Returns recent performance for a single tank across fixed look-back windows (1, 3, 7, 14, 30, 60 and 120 days). Perio
55ds with no battles return null fields.",pathParams:[c,l,{name:"tankId",type:"number",desc:"The tank ID to fetch recent stats for."}],example:`curl "${i}/api/player/tank-recents/com/1001234567/5137" \\
56  -H "x-api-key: tmgg_your_key_here"`,response:`[
57  { "period": "1 Day",  "battles": 8, "winrate": 62.5, "dpg": 2600, "wn8": 2450, "wnx": 2380, /* ... */ },
58  { "period": "7 Days", "battles": null, "winrate": null, "wn8": null, /* ... */ }
59]`},{title:"MoE Progression",group:"Tank Stats",path:"/api/player/moe-progression/:id/:tankId",description:"Returns a player's Mark of Excellence progression for a single tank in random battles, ordered chronologically.",pathParams:[l,{name:"tankId",type:"number",desc:"The tank ID to fetch MoE progression for."}],example:`curl "${i}/api/player/moe-progression/1001234567/5137" \\
60  -H "x-api-key: tmgg_your_key_here"`,response:`{
61  "meta": { "status": "good" },
62  "data": [
63    { "moe": 91.2, "moe_diff": 0.4, "battle_time": 1748736000000, "damage": 2400, "tracking_assist": 120, "spotting_assist": 300 }
64  ]
65}`},{title:"Player Battles (Advanced)",group:"Battles & Loadouts",path:"/api/player/battles/:id",description:"Returns a paginated list of a player's battles from the advanced battle log, including loadouts (equipment, shells, consumables, field mods), per-battle WN8/WNX and full combat details.",auth:I,pathParams:[l],queryParams:[...C,{name:"classes",type:"string",desc:"Comma-separated class filter (HT, MT, LT, TD, SPG)."},{name:"nations",type:"string",desc:"Comma-separated nation filter."},{name:"tiers",type:"string",desc:"Comma-separated tier filter."}],example:`curl "${i}/api/player/battles/1001234567?page=0&pageSize=10&won=won" \\
66  -H "x-api-key: tmgg_your_key_here"`,response:`{
67  "meta": { "status": "good", "player_id": 1001234567, "page": 0 },
68  "data": [ { "tank_id": 5137, "damage": 3200, "frags": 3, "won": true, "wn8": 2900, "equipment": [ /* ... */ ], /* ... */ } ]
69}`},{title:"Player Battles (Common)",group:"Battles & Loadouts",path:"/api/player/common-battles/:id",description:"Returns a paginated list of a player's battles from the common battle log. Lighter than the advanced log (no loadout data) but available for more battles.",auth:I,pathParams:[l],queryParams:[...C,{name:"classes",type:"string",desc:"Comma-separated booleans for HT, MT, LT, TD, SPG (in that order)."},{name:"nations",type:"string",desc:"Comma-separated booleans for each nation (Germany, USSR, USA, France, UK, China, Japan, Czech, Poland, Sweden, Italy)."},{name:"tiers",type:"string",desc:"Comma-separated booleans for tiers 1–11."}],example:`curl "${i}/api/player/common-battles/1001234567?page=0&pageSize=10" \\
70  -H "x-api-key: tmgg_your_key_here"`,response:`{
71  "meta": { "status": "good", "player_id": 1001234567, "page": 0 },
72  "data": [ { "tank_id": 5137, "damage": 3200, "frags": 3, "won": true, "wn8": 2900, "wnx": 2840, /* ... */ } ]
73}`},{title:"Player Battles (Combined)",group:"Battles & Loadouts",path:"/api/player/combined-battles/:id",description:"Returns a paginated list of battles from the common log, enriched with advanced-log details and loadouts where available. Each row carries an isAdvanced flag. Page size is capped at 10.",auth:I,pathParams:[l],queryParams:[...C,{name:"classes",type:"string",desc:"Comma-separated class values (e.g. HT,MT)."},{name:"nations",type:"string",desc:"Comma-separated nation values."},{name:"roles",type:"string",desc:"Comma-separated role values."},{name:"tiers",type:"string",desc:"Comma-separated tier numbers (e.g. 8,9,10)."}],example:`curl "${i}/api/player/combined-battles/1001234567?page=0&pageSize=10" \\
74  -H "x-api-key: tmgg_your_key_here"`,response:`{
75  "meta": { "status": "good", "player_id": 1001234567, "page": 0 },
76  "data": [ { "tank_id": 5137, "damage": 3200, "won": true, "isAdvanced": true, "equipment": [ /* ... */ ], /* ... */ } ]
77}`},{title:"Mod Sessions",group:"Battles & Loadouts",path:"/api/player/mod-sessions/:id",description:"Returns a player's battles grouped into play sessions (a gap of more than six hours starts a new session), built from the advanced battle log with full loadouts.",pathParams:[l],queryParams:[{name:"battleType",type:"string",desc:"Game mode filter."},{name:"tankId",type:"number",desc:"Restrict to a single tank."},{name:"map",type:"string",desc:"Restrict to a single map (display name)."},{name:"limit",type:"number",desc:"Maximum number of sessions to return. Defaults to 14."}],example:`curl "${i}/api/player/mod-sessions/1001234567?limit=14" \\
78  -H "x-api-key: tmgg_your_key_here"`,response:`{
79  "meta": { "status": "good", "player_id": 1001234567 },
80  "data": [ { /* session summary + grouped battles */ } ]
81}`},{title:"Battle Detail",group:"Battles & Loadouts",path:"/api/player/battle-detail/:id",description:"Returns the full scoreboard for a single battle (all players), keyed by the battle's arena ID, along with general battle metadata (map, mode, duration).",pathParams:[{name:"id",type:"number",desc:"The arena (battle) ID."}],example:`curl "${i}/api/player/battle-detail/123456789" \\
82  -H "x-api-key: tmgg_your_key_here"`,response:`{
83  "meta": { "status": "good" },
84  "general": { "map": "Prokhorovka", "battle_type": "standard", "duration": 412, "battle_time": "2026-06-01T12:00:00.000Z", /* ... */ },
85  "players": [ { "username": "PlayerName", "tank_id": 5137, "damage": 3200, "frags": 3, "won": true, /* ... */ } ]
86}`},{title:"Battle Replay",group:"Battles & Loadouts",path:"/api/player/battle-replay/:playerId/:arenaId",description:"Returns parsed replay data for a single player in a single battle, if a replay is available.",pathParams:[{name:"playerId",type:"number",desc:"The player'
86s Wargaming account ID."},{name:"arenaId",type:"number",desc:"The arena (battle) ID."}],example:`curl "${i}/api/player/battle-replay/1001234567/123456789" \\
87  -H "x-api-key: tmgg_your_key_here"`,response:`{
88  "meta": { "status": "good" },
89  "data": { /* parsed replay data */ }
90}`},{title:"Garage Equipment",group:"Battles & Loadouts",path:"/api/player/equipment/:id",description:"Returns the player's garage loadout setup per tank (equipment, consumables, shells, field mods, directives and crew) as captured by the Tomato.gg mod.",auth:e.jsxs(e.Fragment,{children:["Subject to the player's loadout visibility settings. Private profiles require an authenticated request from the owner and otherwise respond with ",e.jsx("code",{children:"403"}),"."]}),pathParams:[l],example:`curl "${i}/api/player/equipment/1001234567" \\
91  -H "x-api-key: tmgg_your_key_here"`,response:`{
92  "meta": { "status": "good", "player_id": 1001234567 },
93  "created": "2026-05-01T00:00:00.000Z",
94  "updated": "2026-06-01T00:00:00.000Z",
95  "data": [ { "tankId": 5137, "name": "Object 140", "selectedSlot": [ /* equipment */ ], "crew": [ /* ... */ ], /* ... */ } ]
96}`},{title:"Bulk Player Stats",group:"Bulk",path:"/api/player/bulk-stats/:server",description:"Returns recent and overall summary stats (battles, WN8, win rate, average tier) for many players at once, keyed by account ID.",pathParams:[c],queryParams:[{name:"ids",type:"string",desc:"Comma-separated list of player account IDs."}],example:`curl "${i}/api/player/bulk-stats/com?ids=1001234567,1007654321" \\
97  -H "x-api-key: tmgg_your_key_here"`,response:`{
98  "meta": { "status": "good" },
99  "data": {
100    "1001234567": {
101      "recent":  { "battles": 120, "wn8": 2400, "winrate": 56.2, "avgTier": 9.1 },
102      "overall": { "battles": 25000, "wn8": 1850, "winrate": 52.0, "avgTier": 7.8 }
103    }
104  }
105}`},{title:"Bulk Tank Stats",group:"Bulk",path:"/api/player/bulk-tank-stats/:server",description:"Returns overall per-tank stats (battles, damage, wins, WN8) for many players at once, keyed by account ID and then tank ID.",pathParams:[c],queryParams:[{name:"ids",type:"string",desc:"Comma-separated list of player account IDs."}],example:`curl "${i}/api/player/bulk-tank-stats/com?ids=1001234567,1007654321" \\
106  -H "x-api-key: tmgg_your_key_here"`,response:`{
107  "meta": { "status": "good" },
108  "data": {
109    "1001234567": {
110      "5137": { "battles": 540, "damage": 1080000, "wins": 300, "wn8": 2600 }
111    }
112  }
113}`}],_=({code:t,label:o})=>{const[h,y]=a.useState(!1),m=a.useRef(null),v=a.useCallback(async()=>{try{await navigator.clipboard.writeText(t),y(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>y(!1),1600)}catch{}},[t]);return a.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),e.jsxs(he,{children:[e.jsxs(ye,{type:"button",onClick:v,"data-copied":h,"aria-label":h?"Copied":`Copy ${o}`,children:[h?e.jsx(Y,{size:14,weight:"bold"}):e.jsx(Z,{size:14}),h?"Copied":"Copy"]}),e.jsx(xe,{children:t})]})},D=({params:t})=>e.jsxs(ge,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Name"}),e.jsx("th",{scope:"col",children:"Type"}),e.jsx("th",{scope:"col",children:"Description"})]})}),e.jsx("tbody",{children:t.map(o=>e.jsxs("tr",{children:[e.jsx("td",{className:"name","data-label":"Name",children:o.name}),e.jsx("td",{className:"type","data-label":"Type",children:o.type}),e.jsx("td",{className:"desc","data-label":"Description",children:o.desc})]},o.name))})]}),ke=({endpoint:t})=>e.jsx(ae,{id:B(t.path),"data-endpoint-section":!0,children:e.jsx(A,{outerStyle:{maxWidth:800,width:"100%"},title:t.title,children:e.jsxs(E,{children:[e.jsxs(pe,{children:[e.jsx(de,{children:"GET"}),e.jsx(ce,{children:t.path}),t.auth&&e.jsxs(me,{children:[e.jsx(T,{size:12,weight:"fill"}),"Auth required"]})]}),e.jsx(b,{children:t.description}),t.auth&&e.jsxs(ue,{children:[e.jsx(T,{size:16,weight:"fill"}),e.jsxs("span",{children:[e.jsx("b",{children:"Authentication."})," ",t.auth]})]}),t.pathParams&&e.jsxs(e.Fragment,{children:[e.jsx(g,{children:"Path parameters"}),e.jsx(D,{params:t.pathParams})]}),t.queryParams&&e.jsxs(e.Fragment,{children:[e.jsx(g,{children:"Query parameters"}),e.jsx(D,{params:t.queryParams})]}),e.jsx(g,{children:"Example request"}),e.jsx(_,{code:t.example,label:`${t.title} request`}),t.response&&e.jsxs(e.Fragment,{children:[e.jsx(g,{children:"Example response"}),e.jsx(_,{code:t.response,label:`${t.title} response`})]})]})})});
113function we(){const[t,o]=a.useState(""),[h,y]=a.useState(""),[m,v]=a.useState(!1),[F,$]=a.useState(!1),P=t.trim().toLowerCase(),f=S.filter(s=>!P||s.title.toLowerCase().includes(P)||s.path.toLowerCase().includes(P));a.useEffect(()=>{const s=Array.from(document.querySelectorAll("[data-endpoint-section]"));if(!s.length)return;const p=new IntersectionObserver(d=>{const u=d.filter(x=>x.isIntersecting).sort((x,j)=>x.boundingClientRect.top-j.boundingClientRect.top);u[0]?.target.id&&y(u[0].target.id)},{rootMargin:"-92px 0px -65% 0px",threshold:0});return s.forEach(d=>p.observe(d)),()=>p.disconnect()},[f.length]),a.useEffect(()=>{const s=window.location.hash.slice(1);if(!s)return;const p=document.getElementById(s);p&&(y(s),p.scrollIntoView({behavior:"auto",block:"start"}))},[]),a.useEffect(()=>{const s=()=>$(window.scrollY>600);return s(),window.addEventListener("scroll",s,{passive:!0}),()=>window.removeEventListener("scroll",s)},[]);const z=a.useCallback((s,p)=>{s.preventDefault();const d=document.getElementById(p);d&&(d.scrollIntoView({behavior:N()?"auto":"smooth",block:"start"}),window.history.replaceState(null,"",`#${p}`),y(p),window.matchMedia(`(max-width: ${k}px)`).matches&&v(!1))},[]),L=a.useCallback(()=>{window.scrollTo({top:0,behavior:N()?"auto":"smooth"})},[]);return e.jsxs(X,{children:[e.jsxs(Q,{children:[e.jsxs(te,{children:[e.jsx(q,{size:16}),e.jsx("input",{type:"text",value:t,onChange:s=>o(s.target.value),placeholder:"Filter endpoints","aria-label":"Filter endpoints"})]}),e.jsxs(re,{type:"button","aria-expanded":m,"aria-controls":"api-endpoint-nav",onClick:()=>v(s=>!s),children:["Browse endpoints",e.jsx(M,{size:16})]}),e.jsx(se,{id:"api-endpoint-nav","data-open":m,"aria-label":"API endpoints",children:f.length===0?e.jsxs(le,{children:["No endpoints match “",t.trim(),"”."]}):be.map(s=>{const p=f.filter(d=>d.group===s);return p.length?e.jsxs(ne,{children:[e.jsx(oe,{children:s}),p.map(d=>{const u=B(d.path),x=h===u;return e.jsx(ie,{href:`#${u}`,$active:x,"aria-current":x?"true":void 0,onClick:j=>z(j,u),children:d.title},u)})]},s):null})})]}),e.jsxs(ee,{children:[e.jsx(A,{outerStyle:{maxWidth:800,width:"100%"},title:"API Documentation",children:e.jsxs(E,{children:[e.jsxs(b,{children:["The Tomato.gg API lets you access player and tank data programmatically. Generate an API key from your ",e.jsx(U,{to:"/account",children:"Account page"})," and pass it on every request via the"," ",e.jsx("code",{children:"x-api-key"})," header. Requests are rate limited to"," ",e.jsx("strong",{children:"60 requests / minute"})," per key."]}),e.jsx(g,{children:"Base URL"}),e.jsx(_,{code:i,label:"base URL"}),e.jsx(g,{children:"Authentication"}),e.jsx(D,{params:[{name:"x-api-key",type:"string",desc:e.jsxs(e.Fragment,{children:["Your API key, prefixed with ",e.jsx("code",{children:"tmgg_"}),". Sent as a request header on every call."]})}]}),e.jsxs(b,{children:["Path parameters shown as ",e.jsx("code",{children:":server"})," accept the Wargaming region codes"," ",e.jsx("code",{children:"com"}),", ",e.jsx("code",{children:"eu"})," and ",e.jsx("code",{children:"asia"}),". Player IDs are Wargaming account IDs."]}),e.jsx(g,{children:"Errors"}),e.jsxs(b,{children:["Failed requests return a JSON body with the HTTP status: ",e.jsx("code",{children:"401"})," for a missing or invalid key, ",e.jsx("code",{children:"403"})," for a private profile you aren't authorised to read, and"," ",e.jsx("code",{children:"429"})," when you exceed 60 requests / minute."]}),e.jsx(_,{code:`{
114  "meta": { "status": "error", "code": 429 },
115  "error": "Rate limit exceeded. Try again in 60 seconds."
116}`,label:"error response"})]})}),f.length===0?e.jsx(A,{outerStyle:{maxWidth:800,width:"100%"},children:e.jsx(E,{children:e.jsxs(b,{children:["No endpoints match “",t.trim(),"”. Clear the filter to see all ",S.length," ","endpoints."]})})}):f.map(s=>e.jsx(ke,{endpoint:s},s.path))]}),e.jsx(fe,{type:"button",$visible:F,onClick:L,"aria-label":"Back to top",children:e.jsx(R,{size:18,weight:"bold"})})]})}const Pe=we;export{Pe as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.