Live BIST stock market data

You can refer to this page to see how to get live data of stocks in BIST. Connection is done via SSE (Server Sent Events).


BIST Live Price

Streams real-time price updates for Borsa Istanbul (TR) stocks.

The filter parameter is optional. If provided, only the specified comma-separated stock symbols will be streamed. If omitted, real-time updates for all supported stocks will be returned.

curl --request GET \
  --url 'https://api.getlaplace.com/api/v2/stock/price/live?filter=AKBNK,ASELS&region=tr&stream=c1cab622-c6db-4fa2-b6f7-102ce000e41f' \
  --header 'Authorization: Bearer your-api-key'

Parameters

NameDescriptionExampleParameter TypeData Type
filter
Comma-separated list of stock symbols. if not provided, all stocks will be returned (Optional)
AKBNK,ASELSquerystring
region
Region code
trquerystring
stream
This is the unique identifier for your connection
c1cab622-c6db-4fa2-b6f7-102ce000e41fquerystring

Response

(Note: Actual response can be different length and other fields may be present)

▼"root" : { 2 items … }
▼"d" : { 4 items … }
"d" : int1770805675599
"p" : float83.5
"s" : string"AKBNK"
"ch" : float-0.06
}
"t" : string"pr"
}

BIST Delayed Price

Returns 15-minute delayed price data for Borsa Istanbul (TR) stocks.

If the filter parameter is provided, only the specified comma-separated symbols are returned. If omitted, delayed prices for all supported stocks are returned.

curl --request GET \
  --url 'https://api.getlaplace.com/api/v1/stock/price/delayed?filter=AKBNK,ASELS&region=tr&stream=c1cab622-c6db-4fa2-b6f7-102ce000e41f' \
  --header 'Authorization: Bearer your-api-key'

Parameters

NameDescriptionExampleParameter TypeData Type
filter
Comma-separated list of stock symbols. if not provided, all stocks will be returned. (Optional)
AKBNK,ASELSquerystring
region
Region code
trquerystring
stream
This is the unique identifier for your connection
c1cab622-c6db-4fa2-b6f7-102ce000e41fquerystring

Response

(Note: Actual response can be different length and other fields may be present)

▼"root" : { 2 items … }
▼"d" : { 4 items … }
"d" : int1753957328856
"p" : float185.2
"s" : string"ASELS"
"ch" : float2.72
}
"t" : string"pr"
}

Live Orderbook

This API provides real-time order book data for given symbols. The API sends different message types to maintain an up-to-date view of the order book state.

Message Types

1. Initial Snapshot

When a user first connects to the order book stream, they receive a complete snapshot of the current order book state.

Structure:

{
    "updated": [
        {
            "level": <number>,
            "vol": <number>,
            "orders": <number>,
            "p": <number>,
            "side": "ask|bid"
        }
    ],
    "symbol": "<string>"
}

Example:

{
    "updated": [
        {
            "level": 1,
            "vol": 11934,
            "orders": 21,
            "p": 145.9,
            "side": "ask"
        },
        {
            "level": 1,
            "vol": 12451,
            "orders": 12,
            "p": 145.8,
            "side": "bid"
        }
    ],
    "symbol": "ASELS"
}

2. Incremental Updates

After the initial snapshot, the API sends incremental updates to reflect changes in the order book.

Updated Levels

When order book levels are modified (price, volume, or order count changes):

{
    "updated": [
        {
            "level": 21,
            "vol": 14603,
            "orders": 30,
            "p": 143.8,
            "side": "bid"
        },
        {
            "level": 24,
            "vol": 55546,
            "orders": 45,
            "p": 143.5,
            "side": "bid"
        }
    ],
    "symbol": "ASELS"
}

Deleted Levels

When order book levels are removed entirely:

{
    "deleted": [
        {
            "level": 21,
            "side": "bid"
        }
    ],
    "symbol": "ASELS"
}

Combined Updates

A single message can contain both updates and deletions:

{
    "updated": [
        {
            "level": 5,
            "vol": 25000,
            "orders": 15,
            "p": 146.0,
            "side": "ask"
        }
    ],
    "deleted": [
        {
            "level": 12,
            "side": "bid"
        }
    ],
    "symbol": "ASELS"
}

Field Definitions

FieldTypeDescription
symbolstringTrading symbol identifier (e.g., "ASELS")
levelnumberOrder book depth level (1 = best price, higher numbers = further from best price)
volnumberTotal volume at this price level
ordersnumberNumber of individual orders at this price level
pnumberPrice at this level
sidestringEither "bid" (buy orders) or "ask" (sell orders)

Order Book Sides

  • Bid Side: Buy orders, sorted by price in descending order (highest bid first)
  • Ask Side: Sell orders, sorted by price in ascending order (lowest ask first)

Level Numbering

Levels are numbered consecutively starting from 1, where:

  • Level 1 = Best bid/ask (closest to the spread)
  • Higher level numbers = Further from the best price
  • Bid levels: Level 1 has the highest price, increasing levels have lower prices
  • Ask levels: Level 1 has the lowest price, increasing levels have higher prices

Implementation Notes

  1. Initial State: Always process the initial snapshot to build the complete order book state
  2. Incremental Updates: Apply updates by replacing data at the specified level
  3. Deletions: Remove the specified level entirely from your order book representation
  4. Order Processing: Process messages in the order received to maintain consistency

Example Usage Flow

  1. Connect to the stream
  2. Receive initial snapshot with all current order book levels
  3. Build internal order book representation
  4. Process incremental updates:
    • For updated entries: Replace or add the level data
    • For deleted entries: Remove the level completely
  5. Maintain sorted order book with current market depth
curl --request GET \
  --url 'https://api.getlaplace.com/api/v1/stock/orderbook/live?filter=AKBNK,ASELS&region=tr&stream=c1cab622-c6db-4fa2-b6f7-102ce000e41f' \
  --header 'Authorization: Bearer your-api-key'

Parameters

NameDescriptionExampleParameter TypeData Type
filter
Comma-separated list of stock symbols. if not provided, all stocks will be returned. (Optional)
AKBNK,ASELSqueryarray
region
Region code
querystring
stream
This is the unique identifier for your connection
c1cab622-c6db-4fa2-b6f7-102ce000e41fquerystring

© 2024 Laplace API. All rights reserved.