LANEye API Documentation

REST API for LANEye Network Scanner

Base URL

http://localhost:8000

Endpoints

GET /api/hosts

Get all discovered hosts

Response Example:

{
  "hosts": [
    {
      "id": 1,
      "ip": "192.168.1.100",
      "mac": "00:1A:2B:3C:4D:5E",
      "hostname": "laptop-01",
      "vendor": "Apple",
      "status": "online",
      "first_seen": "2025-10-18T10:00:00",
      "last_seen": "2025-10-18T15:00:00"
    }
  ],
  "count": 1
}

GET /api/hosts/{host_id}

Get specific host details

Parameters:

POST /api/scan

Trigger manual network scan

Request Body:

{
  "interface": "eth0",
  "subnet": "192.168.1.0/24",
  "interval": 60
}

GET /api/stats

Get network statistics

Response Example:

{
  "total_hosts": 45,
  "online_hosts": 38,
  "offline_hosts": 7
}

POST /api/export/elk

Export data to ELK stack

Response:

{
  "status": "success",
  "exported": 45
}

GET /metrics

Prometheus metrics endpoint for Grafana

Response Format:

# HELP laneye_hosts_total Total number of discovered hosts
# TYPE laneye_hosts_total gauge
laneye_hosts_total 45

# HELP laneye_hosts_online Number of online hosts
# TYPE laneye_hosts_online gauge
laneye_hosts_online 38

WebSocket

WS /ws

WebSocket connection for real-time updates

Connection:

ws://localhost:8000/ws

Message Format:

{
  "type": "host_discovered",
  "data": {
    "ip": "192.168.1.105",
    "mac": "AA:BB:CC:DD:EE:FF",
    "status": "online"
  },
  "timestamp": "2025-10-18T15:30:00"
}