pocketful logo light
pocketful logo light

Get Market Data

The MarketData API provides detailed market data for the specified instrument. It returns key metrics such as bid and ask prices, trade volume, high/low prices, and exchange-specific information. This data helps traders and investors make informed decisions by analyzing current market conditions for the instrument.

Endpoint: /api/v1/marketdata/:exchange/:token
Method-Type: GET

Path Parameters

Field NameData TypeDescription
exchangeStringe.g. NSEBSEMCXNFOBFO
tokenStringe.g. 90197

Example

response = pocket.getMarketdata('NSE', 14366)

Response

{
  "data": {
    "ask_price": 1290,
    "ask_qty": 1089393,
    "average_trade_price": 12.97,
    "bid_price": 1285,
    "bid_qty": 3486991,
    "close_price": 13.1,
    "exchange": "NSE",
    "exchange_timestamp": 1710486278,
    "high_price": 13.3,
    "instrument_token": 14366,
    "last_trade_price": 12.9,
    "last_trade_qty": 1,
    "last_trade_time": 1710486277,
    "low_price": 12.75,
    "open_price": 13.15,
    "segment": "Capital",
    "total_buy_qty": 31748583,
    "total_sell_qty": 40173028,
    "trade_volume": 178286763,
    "yearly_high": 1840,
    "yearly_low": 570
  },
  "message": "",
  "status": "success"
}
KeyDescription
ask_priceThe price at which sellers are willing to sell the asset.
ask_qtyThe quantity of the asset available at the ask price.
average_trade_priceThe average price at which trades have been executed.
bid_priceThe price at which buyers are willing to buy the asset.
bid_qtyThe quantity of the asset available at the bid price.
close_priceThe closing price of the asset.
exchangeThe exchange where the asset is traded.
exchange_timestampThe timestamp of the exchange’s last update.
high_priceThe highest price of the asset during the trading day.
instrument_tokenThe unique identifier of the financial instrument.
last_trade_priceThe price at which the last trade was executed.
last_trade_qtyThe quantity of the last trade.
last_trade_timeThe timestamp of the last trade.
low_priceThe lowest price of the asset during the trading day.
open_priceThe opening price of the asset.
total_buy_qtyThe total quantity of buy orders.
total_sell_qtyThe total quantity of sell orders.
trade_volumeThe total volume of trades.
yearly_highThe highest price of the asset in the past year.
yearly_lowThe lowest price of the asset in the past year.

Error response

{
    "data": {},
    "message": "Invalid parameters",
    "status": "error"
}