Feed
The Groww Feed provides methods to subscribe to and receive Groww data streams and updates.
Feed Client
Once you have your API key, you can use the GrowwFeed
client to subscribe to live data streams and receive updates.
The Feed Client can either be used synchronously to get the last updated data or asynchronously to trigger a callback whenever new data is received.
To use the methods in Feed Client, you need a exchange token for the corresponding instrument. You can get the exchange token of a particular instrument from the instruments csv file.
You can subscribe for up to 1000 instruments at a time.
Feed Methods
The SDK provides methods to subscribe to and receive live data streams using the GrowwFeed
class accessible from the growwapi
module.
- Live Data: Subscribe to, get, and unsubscribe from the live data of Derivatives, Stocks and Indices. Each of them support subscribing, getting data and unsubscribing for multiple instruments in one go.
- Order updates of Derivatives and Equity and also Position updates of Derivatives.
Live Data
Subscribe and get the live data of equity, index and derivatives.
Live Data for Equity and Derivatives
Subscribe to, get, and unsubscribe from the live data for equities or derivatives contracts.
Live Data for Equity and Derivatives - Request Fields
Name | Type | Description |
---|---|---|
exchange | str | Stock Exchange |
segment | str | Segment of the instrument such as CASH, FNO etc. |
exchange_token | str | Exchange token of the equity or derivative as provided in instrument csv. |
Output
Live Data for Equity and Derivatives - Response Fields
Name | Type | Description |
---|---|---|
tsInMillis | int | Epoch time in milliseconds. |
ltp | float | The last traded price of the instrument. |
Indices Live Data
Subscribe to, get, and unsubscribe from live data for indices.
Live Index Data - Request Fields
Name | Type | Description |
---|---|---|
exchange | str | Stock Exchange |
segment | str | Segment of the instrument such as CASH, FNO etc. |
exchange_token | str | Exchange token of the equity or derivative as provided in instrument csv. |
Output
Live Index Data - Response Fields
Name | Type | Description |
---|---|---|
tsInMillis | int | Epoch time in milliseconds. |
value | float | The current value of the index. |
Market Depth
Subscribe and get the live data of equity, index and derivatives.
Market Depth for Equity and Derivatives
Subscribe to, get, and unsubscribe from the market depth for equities or derivatives contract.
Market Depth - Request Fields
Name | Type | Description |
---|---|---|
exchange | str | Stock Exchange |
segment | str | Segment of the instrument such as CASH, FNO etc. |
exchange_token | str | Exchange token of the equity or derivative as provided in instrument csv. |
Output
Market Depth - Response Fields
Name | Type | Description |
---|---|---|
tsInMillis | int | Epoch time in milliseconds. |
buyBook | Optional[dict[int, dict]] | Aggregated buy orders showing demand with the different price levels as keys and quantities at the price levels as values. |
sellBook | Optional[dict[int, dict]] | Aggregated sell orders showing supply with the different price levels as keys and quantities at the price levels as values. |
Order Updates
Subscribe and get the latest updates on execution of orders for both equity and derivatives.
Derivatives order updates
Subscribe to, get, and unsubscribe from derivative order updatess.
Output
Equity order updates
Output
Order updates - Response Fields
Name | Type | Description |
---|---|---|
qty | int | Quantity of the equity or derivative |
filledQty | int | Quantity for which trades has been executed |
avgFillPrice | str | Avg price of the order placed |
growwOrderId | str | Order id generated by Groww for an order |
exchangeOrderId | str | Order ID assigned by the exchange for tracking purposes. |
orderStatus | str | Current status of the placed order |
duration | str | Validity of the order |
exchange | str | Stock Exchange |
contractId | str | ISIN (International Securities Identification number) for stocks and contract symbol for derivatives |
Position Updates
Subscribe and get the latest updates on creation and execution of derivatives positions.
Derivatives position updates
Subscribe to, get, and unsubscribe from position updates on your holdings.
Output
Position updates - Response Fields
Name | Type | Description |
---|---|---|
symbolIsin | str | ISIN (International Securities Identification number) symbol of the instrument |
exchangePosition | object | Contains exchange-wise position details |
exchangePosition.BSE | object | Position details on BSE |
exchangePosition.NSE | object | Position details on NSE |
exchangePosition.NSE.creditQty | float | Quantity credited on NSE |
exchangePosition.NSE.creditPrice | float | Price at which credit occurred on NSE |
exchangePosition.NSE.debitQty | float | Quantity debited on NSE |
exchangePosition.NSE.debitPrice | float | Price at which debit occurred on NSE |
Metadata
Metadata refers to additional information about the feed data, such as the exchange, segment, feed type, and feed key. This metadata is useful for identifying and categorizing the data received from the Groww Feed.
Metadata Fields
Name | Type | Description |
---|---|---|
exchange | str | Stock Exchange |
segment | str | Segment of the instrument such as CASH, FNO etc. |
feed_type | str | The type of feed data (e.g., ltp, order_updates, position_updates). |
feed_key (Exchange token) | str | A unique identifier for the feed topic. |
Example Metadata Usage
The metadata is passed to the callback function when data is received. You can use it to filter or process the data based on its attributes.