{"openapi":"3.0.0","info":{"title":"24HG Hub Public API","version":"1.0.0","description":"Public REST API for 24HG Gaming Hub. Authenticate with an API key via x-api-key header."},"servers":[{"url":"/api-platform/v1","description":"API v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/users/{id}":{"get":{"summary":"Get public user profile","description":"Returns public profile information for a user by ID.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"User ID"}],"responses":{"200":{"description":"User profile","content":{"application/json":{"example":{"user":{"id":1,"username":"gamer42","avatar":"/uploads/avatar.png","level":15,"achievements_count":8,"joined":"2025-01-01T00:00:00Z"}}}}}}}},"/users/{id}/stats":{"get":{"summary":"Get user stats","description":"Returns XP, level, achievement count, forum post count, and tournament participation for a user.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"User ID"}],"responses":{"200":{"description":"User stats","content":{"application/json":{"example":{"stats":{"xp":4500,"level":15,"total_xp":12000,"achievements":8,"forum_posts":42,"tournaments_played":3}}}}}}}},"/leaderboards":{"get":{"summary":"Get XP leaderboard","description":"Returns the top 100 users ranked by total XP.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100},"description":"Max results (1-100)"}],"responses":{"200":{"description":"Leaderboard entries","content":{"application/json":{"example":{"leaderboard":[{"rank":1,"user_id":1,"username":"gamer42","level":50,"total_xp":99000}]}}}}}}},"/tournaments":{"get":{"summary":"List tournaments","description":"Returns upcoming and active tournaments.","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["upcoming","active","completed"]},"description":"Filter by status"}],"responses":{"200":{"description":"Tournament list","content":{"application/json":{"example":{"tournaments":[{"id":1,"name":"CS2 Weekly Cup","game":"cs2","status":"upcoming","max_teams":16,"starts_at":"2026-04-01T18:00:00Z"}]}}}}}}},"/servers":{"get":{"summary":"List game servers","description":"Returns all active game servers with player counts and map info.","parameters":[{"name":"game","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by game (e.g. cs2, rust, minecraft)"}],"responses":{"200":{"description":"Server list","content":{"application/json":{"example":{"servers":[{"id":1,"name":"24HG CS2 Main","game":"cs2","ip":"49.12.36.159","port":27015,"status":"online","players":12,"max_players":20,"map":"de_dust2"}]}}}}}}},"/forum/threads":{"get":{"summary":"List forum threads","description":"Returns recent forum threads with author info.","parameters":[{"name":"category_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by category ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25},"description":"Max results (1-50)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Pagination offset"}],"responses":{"200":{"description":"Thread list","content":{"application/json":{"example":{"threads":[{"id":1,"title":"Welcome!","author":"admin","views":150,"created_at":"2025-06-01T00:00:00Z"}]}}}}}}},"/forum/threads/{id}/posts":{"get":{"summary":"List posts in a thread","description":"Returns posts for a given forum thread.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"Thread ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25},"description":"Max results (1-50)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0},"description":"Pagination offset"}],"responses":{"200":{"description":"Post list","content":{"application/json":{"example":{"posts":[{"id":1,"author":"admin","content":"Hello world","created_at":"2025-06-01T00:00:00Z"}]}}}}}}},"/achievements":{"get":{"summary":"List all achievements","description":"Returns all available achievements with descriptions and categories.","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by category"}],"responses":{"200":{"description":"Achievement list","content":{"application/json":{"example":{"achievements":[{"id":1,"name":"First Blood","description":"Win your first match","icon":"🏆","category":"general","xp_reward":100}]}}}}}}},"/killboard/feed":{"get":{"summary":"Cross-game killboard feed","description":"Returns recent kills across every game (CS2, CS1.6, Rust) from the unified killboard. Read-only.","parameters":[{"name":"game","in":"query","required":false,"schema":{"type":"string","enum":["cs2","cs16","rust"]},"description":"Filter by game"},{"name":"player","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to a player — Steam ID or u<userId> (e.g. u42)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50},"description":"Max results (1-100)"}],"responses":{"200":{"description":"Kill feed","content":{"application/json":{"example":{"kills":[{"id":12,"game":"cs2","server_id":3,"killer":{"steam_id":"7656...","user_id":4,"name":"gamer42"},"victim":{"steam_id":"7656...","user_id":6,"name":"rival"},"weapon":"ak47","headshot":true,"distance":18,"round_number":5,"occurred_at":"2026-06-15T12:00:00Z"}]}}}}}}},"/killboard/top-frag":{"get":{"summary":"Top fraggers leaderboard","description":"Returns the top fraggers across every game over a period, with headshot percentage.","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["week","month","all"],"default":"all"},"description":"Time window"},{"name":"game","in":"query","required":false,"schema":{"type":"string","enum":["cs2","cs16","rust"]},"description":"Filter by game"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25},"description":"Max results (1-100)"}],"responses":{"200":{"description":"Top fraggers","content":{"application/json":{"example":{"period":"all","leaders":[{"rank":1,"user_id":4,"steam_id":"7656...","name":"gamer42","game":"cs2","kills":120,"headshots":48,"hs_pct":40}]}}}}}}},"/stats/elo":{"get":{"summary":"Competitive ELO ladder","description":"Returns the Counter-Strike competitive ELO ladder (ranked rating, games, wins, win %). Distinct from the XP /leaderboards.","parameters":[{"name":"game","in":"query","required":false,"schema":{"type":"string","enum":["cs2","cs16"],"default":"cs2"},"description":"CS game"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100},"description":"Max results (1-200)"}],"responses":{"200":{"description":"ELO ladder","content":{"application/json":{"example":{"game":"cs2","leaderboard":[{"rank":1,"user_id":4,"steam_id":"7656...","name":"gamer42","rating":1240,"games":30,"wins":18,"win_pct":60}]}}}}}}}}}