lyx.ac
Ban Checking API

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:
  1. Purchase an API-only subscription
  2. Go to your dashboard after purchase
  3. View your subscription details
  4. Copy your unique API key

Step 2: Single Player Check (GET)

Check if a single player is banned using their identifier

API Endpoint:
GET /api/bans/{identifier}

Replace {identifier} with any player identifier (steam, discord, etc.)

Authentication Methods:
URL Parameter
https://lyx.ac/api/bans/steam:110000142ca3c2e?api-key=YOUR_KEY
Header Authentication
URL:
https://lyx.ac/api/bans/steam:110000142ca3c2e
Header:
api-key: YOUR_API_KEY
Supported Identifiers:
steam: Steam ID
license: Rockstar License
discord: Discord ID
xbl: Xbox Live
live: Microsoft Live
fivem: FiveM ID

Step 3: Batch Check (POST)

Check multiple players at once for better performance

API Endpoint:
POST /api/bans
Content-Type: application/json
Authentication: api-key: YOUR_API_KEY
Request 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 playerConnecting events
  • • 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,
"error": "Player is not banned"
}
When success: false, the player is clean and allowed to connect.
Player IS Banned
{
"success": true,
"banId": "12345",
"index": {
"name": "PlayerName",
"reason": "Cheating",
"extra": "Additional details",
"image": "https://...",
"issuedby": "Admin",
"date": "2024-01-15T10:30:00.000Z"
}
}
When success: true, the player is banned with full ban details.
Response Fields Reference:
success: Boolean indicating if player is banned
banId: Unique identifier for the ban record
name: Player's name when they were banned
reason: Reason for the ban
extra: Additional ban details (can be null)
image: Evidence screenshot URL (can be null)
issuedby: Staff member who issued the ban
date: ISO timestamp when ban was issued

Step 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:

# Test single player check
curl -H "api-key: YOUR_KEY" \
https://lyx.ac/api/bans/steam:110000142ca3c2e
# Test batch check
curl -X POST -H "api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d "["steam:123", "discord:456"]" \
https://lyx.ac/api/bans
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