API Trading
WebSocket
Trading API
Build event-driven equity and options trading applications with
Lightspeed Connect.
Send JSON messages over a persistent WebSocket connection and receive real-time order, execution, position, and account updates without repeatedly polling for changes.
Event-Driven Trading API
A Persistent Connection for
Trading Workflows
Lightspeed Connect uses JSON messages over a long-lived WebSocket connection, providing two-way communication between your trading application and the API.
Your application can submit requests while Lightspeed Connect pushes execution reports, order status changes, position changes, and account updates through the connection as activity occurs.
Websocket Architecture
Your Application.
One Persistent Connection.
Maintain a two-way WebSocket session for sending trading requests and receiving event-driven updates.
Trading logic, automation & workflows
Trading API
Build With Websockets
Designed for Event-Driven
Trading Applications
Two-Way Communication
Send requests and receive trading updates through the same persistent WebSocket session.
JSON Messages
Build against a message-based API using JSON over the WebSocket connection.
Receive execution reports, status changes, positions, and account information as updates occur.
Equity Trading
Build custom U.S. equity trading workflows through Lightspeed Connect.
Options Trading
Develop single-leg and multi-leg equity options workflows with strategies of up to four legs.
Incorporate eligible hard-to-borrow locate quote and borrow requests into your application.
Plain Websocket + JSON
Build with Your Preferred Development Stack
Lightspeed Connect is a WebSocket API carrying JSON messages, allowing developers to build with WebSocket libraries across programming languages.
A Python adapter is also available for developers who want help handling common connection tasks including logon, heartbeats, required session fields, and reconnection.
Trading Workflows
Use Lightspeed Connect messages across the trading and account lifecycle.
Submit Orders
Send supported equity and options orders through the WebSocket session.
Manage Orders
Cancel and replace supported orders as your application workflow requires.
Monitor Executions
Process execution reports and order status updates pushed through the connection.
Track Positions
Receive changing position information through Lightspeed Connect.
Monitor Accounts
Receive account information including buying power, equity, margin, and P&L.
Request Locates
Incorporate eligible hard-to-borrow locate requests into custom trading workflows.
Development Workflow
Build, Test, and Prepare for Production
Review API messages, examples, and AI-ready documentation.
Connect using your preferred WebSocket development stack.
Validate messages with the API Console and Paper Trading.
Complete testing and transition your integration to Production.
Lightspeed Connect Resources
Paper Trading
Develop and validate your Lightspeed Connect integration in a simulated trading environment.
AI-Ready API Documentation
Use machine-readable documentation and AI-assisted development resources.
Options Trading API
Build single-leg and multi-leg equity options workflows.
Integrate Locates into Your Trading Workflow
Explore the Lightspeed Connect API documentation for
locate requests, quotes, and orders.
Get the latest news and promos.