Skip to content

API Reference

IK edited this page Mar 4, 2026 · 6 revisions

API Reference

Base URL: http://127.0.0.1:13370/api

The UI uses this API directly. If you build integrations, treat backend handler code as the source of truth.

Response Format

Most endpoints return JSON. Scan-style endpoints return NDJSON (application/x-ndjson) with progress events.

Example NDJSON stream:

{"type":"progress","message":"Fetching orders..."}
{"type":"progress","message":"Analyzing..."}
{"type":"result","data":[...],"count":123,"scan_id":456}

Message types:

  • progress
  • result
  • error

Status & Config

GET /api/status

Returns backend readiness and ESI health.

{
  "sde_loaded": true,
  "sde_systems": 8035,
  "sde_types": 47000,
  "esi_ok": true,
  "esi_last_ok": 1739942400
}

esi_last_ok is optional.

GET /api/config

Returns user-scoped config.

POST /api/config

Partial update. Common fields:

  • system_name
  • cargo_capacity
  • buy_radius
  • sell_radius
  • min_margin
  • sales_tax_percent
  • broker_fee_percent
  • split_trade_fees
  • buy_broker_fee_percent
  • sell_broker_fee_percent
  • buy_sales_tax_percent
  • sell_sales_tax_percent
  • alert_telegram
  • alert_discord
  • alert_desktop
  • alert_telegram_token
  • alert_telegram_chat_id
  • alert_discord_webhook
  • opacity

POST /api/alerts/test

Send test alert through configured external channels.

{"message":"optional custom text"}

Response:

{
  "sent": ["telegram", "discord"],
  "failed": {"telegram":"..."}
}

Search & Location Helpers

GET /api/systems/autocomplete?q=...

GET /api/regions/autocomplete?q=...

GET /api/stations?system=Jita

Returns StationsResponse:

{
  "stations": [
    {
      "id": 60003760,
      "name": "Jita IV - Moon 4 - Caldari Navy Assembly Plant",
      "system_id": 30000142,
      "region_id": 10000002
    }
  ],
  "region_id": 10000002,
  "system_id": 30000142
}

Scanning

POST /api/scan

Radius scan (flip opportunities).

Common request fields:

  • system_name, cargo_capacity, buy_radius, sell_radius
  • min_margin
  • sales_tax_percent, broker_fee_percent
  • Optional split-fees:
    • split_trade_fees
    • buy_broker_fee_percent, sell_broker_fee_percent
    • buy_sales_tax_percent, sell_sales_tax_percent
  • Advanced filters:
    • min_daily_volume
    • max_investment
    • min_s2b_per_day, min_bfs_per_day
    • min_s2b_bfs_ratio, max_s2b_bfs_ratio
    • min_route_security
  • Structures toggle:
    • include_structures

Response: NDJSON with FlipResult[].

POST /api/scan/multi-region

Raw cross-region scan (backend primitive). Same base request as /api/scan plus optional:

  • target_region (region name string, not ID)
  • source_regions (array of region names)
  • target_market_system / target_market_location_id (optional narrowing)

Response: NDJSON with FlipResult[].

POST /api/scan/regional-day

Regional Trade endpoint (current "regional day trader" flow used by Region tab).

This endpoint:

  • runs raw cross-region scan,
  • applies Regional Day Trader math/modeling,
  • returns flattened rows with Day* fields for Region table profile.

Required fields:

  • system_name
  • target_market_system

Commonly used fields:

  • source_regions
  • target_market_location_id
  • buy_radius (used when source_regions is empty)
  • cargo_capacity
  • min_margin
  • sales_tax_percent, broker_fee_percent
  • split_trade_fees and side-specific fee fields
  • min_item_profit
  • min_period_roi
  • max_dos
  • min_demand_per_day
  • purchase_demand_days
  • avg_price_period
  • max_investment
  • shipping_cost_per_m3_jump
  • min_daily_volume
  • min_s2b_per_day, min_bfs_per_day
  • min_s2b_bfs_ratio, max_s2b_bfs_ratio
  • category_ids
  • sell_order_mode
  • include_structures

Response: NDJSON with result payload:

{
  "type": "result",
  "data": [...],
  "count": 1234,
  "scan_id": 9876,
  "cache_meta": {...},
  "target_region_name": "The Forge",
  "period_days": 14
}

data rows are FlipResult-compatible and include Regional Trade metrics (DayNowProfit, DayPeriodProfit, DayROIPeriod, DayTargetDOS, DayTradeScore, etc.).

POST /api/scan/contracts

Contract scanner. Uses base scan fields plus:

  • min_contract_price
  • max_contract_margin
  • min_priced_ratio
  • require_history
  • contract_instant_liquidation
  • contract_hold_days
  • contract_target_confidence
  • exclude_rigs_with_ship

Response: NDJSON with ContractResult[].

POST /api/scan/station

Station trading scanner.

Request (representative):

{
  "station_id": 60003760,
  "region_id": 10000002,
  "system_name": "Jita",
  "radius": 0,
  "min_margin": 5,
  "sales_tax_percent": 8,
  "broker_fee": 3,
  "cts_profile": "balanced",
  "split_trade_fees": false,
  "min_daily_volume": 5,
  "min_item_profit": 100000,
  "min_demand_per_day": 1,
  "min_s2b_per_day": 1,
  "min_bfs_per_day": 0,
  "avg_price_period": 90,
  "min_period_roi": 0,
  "bvs_ratio_min": 0,
  "bvs_ratio_max": 0,
  "max_pvi": 0,
  "max_sds": 50,
  "limit_buy_to_price_low": false,
  "flag_extreme_prices": true,
  "include_structures": true,
  "structure_ids": [1028858195912]
}

Modes:

  • Single station: station_id + region_id
  • All stations in region: region_id only
  • Radius: system_name + radius

Response: NDJSON with StationTrade[].

POST /api/route/find

Route builder request:

  • system_name, cargo_capacity
  • min_margin
  • sales_tax_percent, broker_fee_percent
  • Optional split-fees fields (same as scans)
  • min_hops, max_hops
  • min_route_security
  • include_structures

Response: NDJSON with RouteResult[].


Watchlist & Alerts

GET /api/watchlist

Returns watchlist items (market-disabled items are filtered out server-side).

POST /api/watchlist

Add item:

{
  "type_id": 34,
  "type_name": "Tritanium",
  "alert_min_margin": 0,
  "alert_enabled": false,
  "alert_metric": "margin_percent",
  "alert_threshold": 0
}

alert_metric allowed values:

  • margin_percent
  • total_profit
  • profit_per_unit
  • daily_volume

Response:

{
  "items": [...],
  "inserted": true
}

PUT /api/watchlist/{typeID}

Update alert settings for existing item.

DELETE /api/watchlist/{typeID}

Remove item.

GET /api/alerts/history

Query params:

  • type_id (optional)
  • limit (optional, default 100)
  • offset (optional)

Scan History

GET /api/scan/history?limit=50

GET /api/scan/history/{id}

GET /api/scan/history/{id}/results

DELETE /api/scan/history/{id}

POST /api/scan/history/clear

Clear body:

{"older_than_days": 7}

/results returns:

{
  "scan": {...},
  "results": [...]
}

For all result types, market-disabled items are filtered before response.


Execution Plan

POST /api/execution/plan

{
  "type_id": 34,
  "region_id": 10000002,
  "location_id": 60003760,
  "quantity": 100000,
  "is_buy": true,
  "impact_days": 30
}

Notes:

  • location_id = 0 means region scope.
  • impact_days is optional, clamped to 1..365 when provided.

EVE SSO & Character Endpoints

Auth/session lifecycle

  • GET /api/auth/login
  • GET /api/auth/callback
  • GET /api/auth/status
  • POST /api/auth/logout
  • POST /api/auth/character/select
  • DELETE /api/auth/characters/{characterID}

Character data

  • GET /api/auth/character
  • GET /api/auth/location
  • GET /api/auth/undercuts
  • GET /api/auth/orders/desk
  • GET /api/auth/portfolio
  • GET /api/auth/portfolio/optimize
  • GET /api/auth/structures
  • GET /api/auth/roles

Scope query params (supported by most character endpoints):

  • character_id=<id> for explicit character
  • scope=all (or character_id=all) for multi-character aggregation where supported

GET /api/auth/structures query params:

  • system_id
  • region_id

In-Game UI Operations

These require active SSO session.

POST /api/ui/open-market

{"type_id": 34}

POST /api/ui/set-waypoint

{
  "solar_system_id": 30000142,
  "clear_other_waypoints": true,
  "add_to_beginning": false
}

POST /api/ui/open-contract

{"contract_id": 215283695}

Contracts

GET /api/contracts/{contract_id}/items

Returns parsed contract details:

{
  "contract_id": 215283695,
  "items": [
    {
      "type_id": 34,
      "type_name": "Tritanium",
      "quantity": 1000,
      "is_included": true,
      "is_blueprint_copy": false
    }
  ]
}

Industry

  • POST /api/industry/analyze (NDJSON)
  • GET /api/industry/search
  • GET /api/industry/systems
  • GET /api/industry/status

/analyze supports station_id (optional) in addition to system_name, fees, blueprint params, and depth options.


Demand / War Tracker

  • GET /api/demand/regions
  • GET /api/demand/hotzones
  • GET /api/demand/region/{regionID}
  • GET /api/demand/opportunities/{regionID}
  • GET /api/demand/fittings/{regionID}
  • POST /api/demand/refresh (NDJSON)

PLEX Dashboard

GET /api/plex/dashboard

Query params:

  • sales_tax (default 3.6)
  • broker_fee (default 1.0)
  • nes_extractor (optional override)
  • nes_omega (optional override)
  • omega_usd (optional)

Note: nes_mptc is not accepted by the current API handler.


Corporation

  • GET /api/corp/dashboard
  • GET /api/corp/members
  • GET /api/corp/wallets
  • GET /api/corp/journal
  • GET /api/corp/orders
  • GET /api/corp/industry
  • GET /api/corp/mining

Most corp endpoints use ?mode=demo|live (demo default).


Data Types (High-Level)

Main payload models:

  • FlipResult (internal/engine/models.go)
  • StationTrade (internal/engine/station_trading.go)
  • ContractResult (internal/engine/models.go)
  • RouteResult / RouteHop (internal/engine/models.go)

For UI-oriented TypeScript shapes, see:

  • frontend/src/lib/types.ts

Errors

Errors are JSON:

{"error":"message"}

Common status codes:

  • 400 invalid input
  • 401 auth required/expired
  • 404 not found
  • 500 internal error
  • 502 upstream ESI failure
  • 503 SDE not ready

🚀 Start Here

📈 Trading Modules

🏭 Industry

🧭 Guides

👤 Character & Corp

🧠 Advanced

🛠️ Development

🔗 Links

Clone this wiki locally