Skip to content

Public API

Public API is the local WebSocket for external integrations: software on your machine sends JSON with a method field to open instrument sets, change linking, send notifications, and so on. Everything runs on loopback only (127.0.0.1); ProfitForge does not expose the port to the internet.

Enable: Application → IntegrationsEnable integrations. User-facing tab overview: Integrations.

The MCP server (HTTP, AI assistants, read-only) is documented separatelyMCP server.


WebSocket API

Connection point

  • URL: ws://127.0.0.1:49152
  • Port: 49152 (loopback only). If the port is busy at startup (another process, etc.), the app may try once to free it; if that fails, the server will not start — check the log.

How to enable

  1. ApplicationIntegrations.
  2. Turn on Enable integrations (under Integration server).

Enable integrations (English UI)

Request and response format

  • Request: JSON with a method field and other fields as needed (see Reference and method pages).
  • Success: {"status":"ok"}
  • Error: {"status":"error","error_code":<number>,"message":"..."} — human-readable text stays in message; stable programmatic handling uses numeric error_code (current codes 10001008; see Reference — Error responses).

Methods

MethodDescription
assignUpdate the linked pair for a color. Does not open a new chart/set.
openOpen an instrument set (one exchange, symbol). Optional linking_type like the watchlist.
open_aggregatedAggregated set for one display symbol across exchanges; optional title / extra.title.
notifyNotification (title, body).
pingConnectivity check.

assign and open: different jobs — not a required “first one, then the other” chain.

Full field list and enums — in Reference.


See also

  • MCP server — separate protocol and port for MCP clients.