API Documentation
Overview
The CS2 Guard API provides access to player data, watchlist information, and statistics. All API endpoints require authentication unless otherwise specified.
Authentication
API requests require a valid authentication token. Include the token in the Authorization header:
Authorization: Bearer YOUR_TOKEN
Endpoints
GET /api/players/search
Search for players by Steam ID or username
Parameters:
q
- Search query (Steam ID or username)limit
- Number of results (default: 10, max: 50)
Response:
{ "players": [ { "id": "player_id", "steam_id": "76561198000000000", "username": "PlayerName", "avatar_url": "https://...", "last_updated": "2024-01-01T00:00:00Z" } ], "total": 1 }
GET /api/watchlist/global
Get global watchlist entries
Parameters:
page
- Page number (default: 1)limit
- Items per page (default: 20)status
- Filter by status (PENDING, APPROVED, DENIED)search
- Search query
POST /api/watchlist/global
Add a player to the global watchlist
Body:
{ "playerId": "player_id", "reason": "Reason for adding to watchlist", "status": "PENDING" }
GET /api/watchlist/stats
Get watchlist statistics
Response:
{ "totalPlayers": 100, "approved": 80, "pending": 15, "denied": 5, "lastUpdate": "2024-01-01T00:00:00Z" }
Rate Limiting
API requests are rate limited to 100 requests per minute per IP address.
Error Responses
All error responses follow a consistent format:
{ "error": "Error message", "code": "ERROR_CODE", "details": "Additional error details" }