For developers & quants
Market Data & Execution APIs
Build on the infrastructure of a SECP-licensed broker: the complete PSX dataset behind this site, live level-2 market data (with your own PSX licence), and order execution through our own in-house OMS. One integration, from research to fills.

Market Data API
Every dataset in our platform, as clean REST and WebSocket endpoints: prices and adjusted history, fundamentals, indices, investor flows, and live level-2 depth for every listed company, for clients with their own PSX market-data licence.
- REST + WebSocket
- EOD history + intraday
- Level-2 order book
Execution API
Place, track, amend and cancel PSX orders programmatically through BSL's own OMS, with institutional-grade pre-trade risk controls built in. Open a BSL account to start in a full sandbox, then go live.
- Full order lifecycle
- Live status WebSocket
- Sandbox first
An OMS we built, not bought
Nearly every brokerage in Pakistan runs its trading on a vendor's platform. BSL does not. Our order management system is engineered in-house, end to end, and tuned for sub-30-millisecond order handling. The same system our own desk trades on is the one your algorithms connect to.
<30ms
Order-handling latency target
100%
Built in-house
FIX
Execution-report semantics

Everything your algo needs, programmatically
Full order lifecycle
LIMIT and MARKET orders with the complete time-in-force set (DAY, GTC, IOC, FOK, GTD) across PSX boards, including Regular, Futures, NDM and Square-up.
Cancel & replace
Amend price or quantity, or cancel outright, with full FIX semantics. Every request is tracked to a confirmed terminal state.
Live status stream
A WebSocket pushes every order-state transition as it happens, backed by a complete FIX execution-report timeline you can reconcile against.
Positions, fills & capital
Query positions, fills, buying power and a full capital ledger in real time. Capital is reserved at submit and settled on fills, automatically.
Scheduled orders
Park an order for a future release time and let the OMS submit it for you, inside the same risk checks as any other order.
Entity-based access
Each strategy trades under its own entity, carrying its own capital allocation, risk limits and kill switch, isolated from every other strategy.
Risk controls, built in
Every order passes a pre-trade risk chain before it reaches the exchange, and every decision is audited. Your algorithm runs fast, inside guardrails.
Pre-trade risk chain · runs on every order
- Capital reservation and buying-power checks on every buyENFORCED
- Price collars against the last traded priceENFORCED
- Order-rate and duplicate-order limits per entityENFORCED
- Position, exposure and open-order capsENFORCED
- A daily-loss stop that halts trading for the dayARMED
- Wash-trade prevention and an entity-level kill switchARMED
The whole market, one API
BSL data catalogue
550+ securities · REST + WebSocket
Level 2, liveLive
Full order-book depth, best bid and ask with spread, tick-by-tick trades, intraday OHLC and VWAP quotes, session phase and halt status. REST plus per-symbol WebSocket subscriptions with snapshot and incremental updates. Requires your own PSX market-data licence.
Prices & history
Full EOD OHLC history and intraday snapshots for 550+ listed securities, with 52-week statistics and returns.
Fundamentals
Annual and quarterly statements, EPS, and computed ratios including P/E, P/B, ROE and dividend yield, built from company filings.
Corporate actions
Split- and bonus-adjusted price history, backed by a nightly detection guard so derived metrics stay honest.
Indices
KSE-100, KSE-30, KMI-30 and KMI All Shares levels, historical series, constituents and weights.
Microstructure & rates
MTS and MFS leverage, T+1 settlement metrics, FIPI and LIPI investor flows, and KIBOR rates.
Reference & events
Company profiles, announcements, board meetings, ex-dates and dividend records for the whole market.
Integration at a glance
- 1AuthenticateToken-based authentication secures every session and call.
- 2Load the universePull the complete list of instruments open to trading.
- 3Open the status streamOne WebSocket pushes every order-state change live.
- 4Place ordersSubmit an order and get back an ID you can track to the fill.
- 5Track to terminalFollow the stream, or poll and reconcile execution reports.
- 6Cancel or replaceAmend price and quantity, or cancel, with FIX semantics.
- 7Monitor the accountPositions, fills, buying power and the capital ledger.
Full integration guide and OpenAPI specification provided at onboarding.
> submit order BUY 500 OGDC @ 95.50 (DAY)
risk chain 6/6 checks passed
accepted order #184
> status stream
PENDING_NEW -> NEW
FILL 500 @ 95.50
position updated · capital settled
Start in the sandbox
Every integration begins in a full sandbox, available to BSL account holders: the complete API surface, real market data, simulated fills, and no live orders. Build, test and tune your strategy end to end. When you are ready to trade live, we provision your production entity, capital and risk limits.
Complete API surface, identical to production
Real market data, simulated executions
Available to BSL account holders
From first call to first fill
Open your account
Open a BSL account and tell us what you are building and the coverage you need.
Sandbox credentials
We provision sandbox access with the integration guide and OpenAPI spec.
Build & test
Develop your strategy against the full API surface with simulated fills.
Go live
When you are ready, we provision your production entity, capital and risk limits.
Questions, answered
What does the Market Data API include?
Everything this platform runs on: EOD and intraday prices for 550+ listed securities, corporate-action-adjusted history, fundamentals and ratios, index series and constituents, leverage and settlement metrics, investor flows, KIBOR rates, and live level-2 order-book data over REST and WebSocket. Level 2 data requires your own PSX market-data licence.
What order types does the Execution API support?
LIMIT and MARKET orders with DAY, GTC, IOC, FOK and GTD time-in-force, across PSX boards including Regular, Futures, NDM and Square-up, plus scheduled orders, cancel and replace.
Is there a sandbox?
Yes. Every integration starts in a full sandbox with the complete API surface, real market data and simulated fills. Sandbox access is available to BSL account holders.
Do I need a BSL account?
Yes. You need a BSL account to use the APIs, including the sandbox. You can open one online in about 10 minutes, with standard KYC.
How fast is the execution path?
The OMS is engineered in-house and tuned for sub-30-millisecond order handling, with a pre-trade risk chain that runs on every order before it reaches the exchange.
How do I get the documentation?
The full integration guide and OpenAPI specification are provided when we set up your sandbox access. Contact us with a short note on what you are building.
Do you offer an API to trade on PSX?
Yes. Our Execution API lets you place, amend and cancel PSX orders programmatically through BSL's in-house OMS, with pre-trade risk checks on every order. You'll need a BSL account to use it, including to build and test in the sandbox.
Can I run an automated trading bot or algorithm through BSL?
Yes. Your algorithm connects to the same OMS our own desk trades on, with market and limit orders, a live order-status stream, and its own capital, risk limits and kill switch.
Do you provide real-time data, including Level 2, via API or WebSocket?
Yes. Live quotes stream over REST and WebSocket. Level 2 order-book depth needs your own market-data licence from PSX; once you have it, we can serve it.
Do you provide trading signals?
No. The API provides market data and order execution. It doesn't generate buy or sell signals or recommendations.
How much does API access or market data cost?
It depends on what you need: data only or data plus live execution, and the coverage involved. Tell us what you're building and we'll share terms when we set up your sandbox access.
Can I buy historical data, such as daily OHLCV or circuit-breaker history? In what format?
The Market Data API includes full end-of-day OHLCV history for 550+ listed securities, adjusted for splits and bonuses, over REST under a licence agreement. Bulk file downloads and circuit-breaker history aren't available.
Can my fintech app let its users trade on PSX through BSL?
It's possible, through the proper SECP channels, with BSL as your infrastructure partner. Talk to us about what you're building.
Can students or researchers get access to test strategies?
Yes. Once you've opened a BSL account, the sandbox gives you the full API with real market data and simulated fills, on the same terms as any other user.
Can I use the API for a personal app?
Yes. You can connect your own app or strategy through your BSL account.
What are the rate limits and usage terms?
They're set out in the integration guide and your licence agreement, both shared when we set up your sandbox access.
How do I request access, and what do you need from me?
Open a BSL account, then use Request API Access on the Trading APIs page or email info@bsl.com.pk. Tell us what you're building, the data you need and whether you plan to trade live, and we'll set up your sandbox and send the integration guide and OpenAPI specification.
Bring your strategy to the PSX
Open a BSL account and tell us what you are building. We will set up sandbox access, share the documentation, and map the path to live trading.