API & Webhook Documentation

Database Intelligence Integration Guide

Integrate The Land of Wolves Database Intelligence with your Discord server, logging systems, or custom applications. Send parsed results, anomaly alerts, and player statistics to any endpoint.

Discord Webhooks
REST API
Custom Headers
Real-time Alerts

Quick Start

1

Configure Webhook

Click the webhook icon in the dashboard and enter your Discord webhook URL or custom API endpoint.

2

Select Data

Choose what to include: statistics, top players, flagged players, or all data.

3

Send Results

After parsing your SQL file, click "Send Webhook" to deliver results to your endpoint.

Discord Webhook Integration

Setting Up Discord Webhook

  1. 1.Open your Discord server and go to Server SettingsIntegrations Webhooks
  2. 2.Click New Webhook and select the channel for notifications
  3. 3.Copy the webhook URL (format: https://discord.com/api/webhooks/...)
  4. 4.Paste the URL in the webhook configuration panel and select "Discord" as the type

Discord Embed Payload Example

{
  "username": "Database Intelligence",
  "avatar_url": "https://wolves.land/images/thelandofwolves.png",
  "embeds": [
    {
      "title": "Database Analysis Complete",
      "color": 4359924,
      "timestamp": "2026-01-12T10:30:00.000Z",
      "footer": {
        "text": "The Land of Wolves | Database Intelligence"
      },
      "fields": [
        { "name": "Total Players", "value": "156", "inline": true },
        { "name": "Total Wealth", "value": "$2.45M", "inline": true },
        { "name": "Total Items", "value": "12,456", "inline": true },
        { "name": "Total Assets", "value": "342", "inline": true },
        { "name": "Ledger Money", "value": "$125,000", "inline": true },
        { "name": "Boss Funds", "value": "$45,000", "inline": true }
      ]
    },
    {
      "title": "Top 10 Wealthiest Players",
      "description": "1. **John Doe** (ABC12345)\n   $125,000 | 234 items | Boss",
      "color": 16440068
    },
    {
      "title": "Flagged Players (5 total)",
      "description": "1. **Suspicious Player** (XYZ98765)\n   Score: 85/100 | $500,000\n   Round amounts, Excessive rare items",
      "color": 15352885
    }
  ]
}

Custom API Integration

API Endpoint Requirements

  • Accepts POST requests with Content-Type: application/json
  • Returns HTTP 2xx status code on success
  • Supports custom headers for authentication (Bearer tokens, API keys)
  • CORS enabled if calling from browser (or use a server-side proxy)

JSON Payload Structure

{
  "event": "parse_complete",
  "timestamp": "2026-01-12T10:30:00.000Z",
  "serverName": "The Land of Wolves",
  "source": "wolves-database-intelligence",
  "version": "1.0.0",
  "statistics": {
    "totalPlayers": 156,
    "totalWealth": 2450000,
    "totalItems": 12456,
    "totalAssets": 342,
    "totalLedger": 125000,
    "totalBossFunds": 45000,
    "flaggedCount": 5
  },
  "topPlayers": [
    {
      "citizenId": "ABC12345",
      "name": "John Doe",
      "totalWealth": 125000,
      "cash": 5000,
      "bank": 120000,
      "itemCount": 234,
      "isBoss": true
    }
  ],
  "flaggedPlayers": [
    {
      "citizenId": "XYZ98765",
      "name": "Suspicious Player",
      "suspicionScore": 85,
      "reasons": [
        "Suspiciously round amounts detected",
        "Excessive rare items"
      ],
      "totalWealth": 500000
    }
  ]
}

cURL Examples

Discord Webhook

curl -X POST "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "Database Intelligence",
    "embeds": [{
      "title": "Database Analysis Complete",
      "color": 4359924,
      "fields": [
        {"name": "Total Players", "value": "156", "inline": true},
        {"name": "Total Wealth", "value": "$2.45M", "inline": true}
      ]
    }]
  }'

Custom API

curl -X POST "https://your-api.example.com/webhook" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "event": "parse_complete",
    "timestamp": "2026-01-12T10:30:00.000Z",
    "statistics": {
      "totalPlayers": 156,
      "totalWealth": 2450000
    }
  }'

Integration Examples

JSJavaScript / Node.js

// JavaScript/Node.js Integration Example
const WEBHOOK_URL = 'https://your-api.example.com/webhook';

async function sendToWebhook(parsedData) {
  const payload = {
    event: 'parse_complete',
    timestamp: new Date().toISOString(),
    serverName: 'My RP Server',
    statistics: {
      totalPlayers: parsedData.players.length,
      totalWealth: parsedData.statistics.totalWealth,
      totalItems: parsedData.statistics.totalItems,
      flaggedCount: parsedData.flaggedPlayers.length
    },
    topPlayers: parsedData.players
      .sort((a, b) => b.totalWealth - a.totalWealth)
      .slice(0, 10)
      .map(p => ({
        citizenId: p.citizenId,
        name: p.fullName,
        totalWealth: p.totalWealth,
        isBoss: p.job?.isBoss || false
      })),
    flaggedPlayers: parsedData.flaggedPlayers.map(p => ({
      citizenId: p.citizenId,
      name: p.fullName,
      suspicionScore: p.suspicionScore,
      reasons: p.flags
    }))
  };

  const response = await fetch(WEBHOOK_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify(payload)
  });

  if (!response.ok) {
    throw new Error(`Webhook failed: ${response.status}`);
  }

  return response.json();
}

LUAFiveM / RedM (Lua)

-- FiveM/RedM Lua Integration Example
local WEBHOOK_URL = 'https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN'

function SendDatabaseReport(data)
    local embed = {
        {
            ["title"] = "Database Analysis Report",
            ["color"] = 4359924,
            ["timestamp"] = os.date("!%Y-%m-%dT%H:%M:%SZ"),
            ["footer"] = {
                ["text"] = "The Land of Wolves | Database Intelligence"
            },
            ["fields"] = {
                { ["name"] = "Total Players", ["value"] = tostring(data.totalPlayers), ["inline"] = true },
                { ["name"] = "Total Wealth", ["value"] = "$" .. FormatNumber(data.totalWealth), ["inline"] = true },
                { ["name"] = "Flagged Players", ["value"] = tostring(data.flaggedCount), ["inline"] = true }
            }
        }
    }

    PerformHttpRequest(WEBHOOK_URL, function(err, text, headers) end, 'POST', json.encode({
        username = "Database Intelligence",
        avatar_url = "https://wolves.land/images/thelandofwolves.png",
        embeds = embed
    }), { ['Content-Type'] = 'application/json' })
end

function FormatNumber(num)
    if num >= 1000000 then
        return string.format("%.2fM", num / 1000000)
    elseif num >= 1000 then
        return string.format("%.1fK", num / 1000)
    end
    return tostring(num)
end

PYPython

# Python Integration Example
import requests
import json
from datetime import datetime

WEBHOOK_URL = 'https://your-api.example.com/webhook'
API_KEY = 'YOUR_API_KEY'

def send_database_report(parsed_data: dict) -> dict:
    """Send parsed database results to webhook endpoint."""
    
    payload = {
        "event": "parse_complete",
        "timestamp": datetime.utcnow().isoformat() + "Z",
        "serverName": "My RP Server",
        "source": "wolves-database-intelligence",
        "version": "1.0.0",
        "statistics": {
            "totalPlayers": len(parsed_data.get("players", [])),
            "totalWealth": parsed_data.get("statistics", {}).get("totalWealth", 0),
            "totalItems": parsed_data.get("statistics", {}).get("totalItems", 0),
            "totalAssets": sum(len(p.get("assets", [])) for p in parsed_data.get("players", [])),
            "flaggedCount": len(parsed_data.get("flaggedPlayers", []))
        },
        "topPlayers": [
            {
                "citizenId": p["citizenId"],
                "name": p.get("fullName", "Unknown"),
                "totalWealth": p.get("totalWealth", 0),
                "isBoss": p.get("job", {}).get("isBoss", False)
            }
            for p in sorted(
                parsed_data.get("players", []),
                key=lambda x: x.get("totalWealth", 0),
                reverse=True
            )[:10]
        ],
        "flaggedPlayers": [
            {
                "citizenId": p["citizenId"],
                "name": p.get("fullName", "Unknown"),
                "suspicionScore": p.get("suspicionScore", 0),
                "reasons": p.get("flags", [])
            }
            for p in parsed_data.get("flaggedPlayers", [])
        ]
    }
    
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    response = requests.post(WEBHOOK_URL, headers=headers, json=payload)
    response.raise_for_status()
    
    return response.json()

Event Types

EventDescriptionTrigger
parse_completeFull database analysis completedAfter SQL file is fully parsed
anomaly_detectedHigh-risk player flaggedWhen suspicion score exceeds threshold
exportData exported to CSV/JSONManual export action

Data Fields Reference

Statistics Object

  • totalPlayers - Number of cataloged players
  • totalWealth - Combined wealth (all money sources)
  • totalItems - Total inventory items across all players
  • totalAssets - Houses, horses, wagons, stores
  • totalLedger - House ledger money
  • totalBossFunds - Job/gang boss funds
  • flaggedCount - Players with anomalies

Player Object

  • citizenId - Unique player identifier
  • name - Full character name
  • totalWealth - All money combined
  • cash - Pocket money + dollar items
  • bank - Main bank account
  • itemCount - Inventory items
  • isBoss - Job or gang boss status

Flagged Player Object

  • citizenId - Player identifier
  • name - Character name
  • suspicionScore - 0-100 risk rating
  • reasons - Array of flag descriptions
  • totalWealth - Player total wealth

Detection Flags

  • WEALTH_ANOMALY - Statistical outlier
  • ROUND_AMOUNTS - Suspiciously round numbers
  • RARE_ITEMS - Excessive rare items
  • ADMIN_ITEMS - Impossible/admin items
  • MULTI_ACCOUNT - Linked accounts
  • ASSET_HOARDING - Excessive assets
The Land of Wolves

The Land of Wolves

Database Intelligence by LXRCore

Developer

iBoss

github.com/iboss21

Organization

LIKE A KING INC

likeakinginc.com

Server

The Land of Wolves

wolves.land

Supported Frameworks

LXR-CoreRSG-CoreQBCoreVORPOxCoreESX

Database Intelligence is part of the LXRCore ecosystem. Built for FiveM and RedM roleplay servers to help administrators monitor player data, detect anomalies, and maintain server integrity.