Simple API for checking player bans across the Lyx.ac network
Step 1: Get Your API Key
You need an API-only subscription to access the ban checking API
How to get API access:
- Purchase an API-only subscription
- Go to your dashboard after purchase
- View your subscription details
- Copy your unique API key
Step 2: Single Player Check (GET)
Check if a single player is banned using their identifier
API Endpoint:
/api/bans/{identifier}Replace {identifier} with any player identifier (steam, discord, etc.)
Authentication Methods:
Supported Identifiers:
steam: Steam IDlicense: Rockstar Licensediscord: Discord IDxbl: Xbox Livelive: Microsoft Livefivem: FiveM IDStep 3: Batch Check (POST)
Check multiple players at once for better performance
API Endpoint:
/api/bansapplication/jsonapi-key: YOUR_API_KEYRequest Body Formats:
You can send multiple identifiers in two different formats:
Array Format
Simple array of identifiers
"steam:110000142ca3c2e",
"discord:641530596719329280"
]
Object Format
Organized by identifier type
"steam": "110000142ca3c2e",
"discord": "641530596719329280"
}
Why Use Batch Check?
- • Ideal for FiveM
playerConnectingevents - • Reduces API calls and improves performance
- • Check all player identifiers at once
Step 4: Understanding API Responses
Learn how to handle different response scenarios
Response Structure:
The API returns different JSON responses based on whether a player is banned or not:
Player NOT Banned
success: false, the player is clean and allowed to connect.Player IS Banned
success: true, the player is banned with full ban details.Response Fields Reference:
success: Boolean indicating if player is bannedbanId: Unique identifier for the ban recordname: Player's name when they were bannedreason: Reason for the banextra: Additional ban details (can be null)image: Evidence screenshot URL (can be null)issuedby: Staff member who issued the bandate: ISO timestamp when ban was issuedStep 5: Implementation Examples
Learn how to integrate the API into your applications
Testing the API:
Before implementing in your application, test the API to ensure it works correctly:
Test with cURL
Use command line to quickly test API endpoints:
FiveM Integration
Production-ready FiveM server-side ban checker:
-- Ban Checker for Lyx.ac API (FiveM Server)
local API_URL = "https://lyx.ac/api/bans"
local API_KEY = "your_api_key_here"
-- Function to check if player is banned
function CheckPlayerBan(identifiers, playerName, callback)
-- Prepare the request
local url = API_URL
local headers = {
["Content-Type"] = "application/json",
["api-key"] = API_KEY
}
local body = json.encode(identifiers)
-- Make the request
PerformHttpRequest(url, function(statusCode, response, headers)
if statusCode == 200 then
local data = json.decode(response)
callback(data.success, data)
else
print("^3[Ban Checker] API Error: " .. statusCode)
callback(false, nil)
end
end, "POST", body, headers)
end
-- Check player when they connect
AddEventHandler("playerConnecting", function(playerName, setKickReason, deferrals)
local playerId = source
local identifiers = GetPlayerIdentifiers(playerId)
print("^2[Ban Checker] Checking player: " .. playerName)
-- Check all identifiers at once
CheckPlayerBan(identifiers, playerName, function(isBanned, banData)
if isBanned then
local kickMessage = string.format(
"🚫 You are banned from this server\n\n" ..
"Reason: %s\n" ..
"Ban ID: %s\n" ..
"Issued by: %s",
banData.index.reason or "No reason provided",
banData.banId or "Unknown",
banData.index.issuedby or "System"
)
setKickReason(kickMessage)
CancelEvent()
print("^1[Ban Checker] " .. playerName .. " was kicked (Ban ID: " .. banData.banId .. ")")
else
print("^2[Ban Checker] " .. playerName .. " is not banned - allowing connection")
end
end)
end)
print("^2[Ban Checker] Loaded successfully!")Ready to Start?
Get API access and start checking bans instantly