Get Multi Quote Ltp
This document outlines how to use the Get Multi Quotes LTP API within the Firstock trading platform.
Overview
The Get Multi Quotes LTP API enables you to retrieve a list of last traded prices (and a few associated fields) for multiple instruments at once. This is especially useful if you need to monitor a portfolio or watchlist of stocks and/or derivatives in near real-time.
Key benefits:
- Batch Retrieval: Get LTPs for multiple symbols in one request.
- Efficiency: Reduce the overhead of separate API calls for each symbol.
- Quick Updates: Ideal for watchlists or summary views where only LTP is required.
Endpoint & Method
POST
/getMultiQuotes/ltp
URL:
https://api.firstock.in/V1/getMultiQuotes/ltp
Headers
Name | Value |
---|---|
Content-Type |
application/json |
Body
Below is the general JSON body for the Get Multi Quote LTP API request. All fields marked as Mandatory must be included.
Field | Type | Mandatory | Description | Example |
---|---|---|---|---|
userId |
string |
Yes |
Unique identifier for |
AB1234 |
jKey |
string |
Yes |
Active session token obtained |
ce1c4471eb95... |
data |
array of objects |
Yes |
An array of instruments for |
See "data" example below |
Inside data :
Each object in the data array should include:
Field | Type | Mandatory | Description | Example |
---|---|---|---|---|
exchange |
string |
Yes |
Exchange code ("NSE", "BSE", "NFO", etc.) |
"NSE" |
tradingSymbol |
string |
Yes |
Symbol or instrument identifier |
"Nifty 50" |
Request
{
"userId": "AB1234",
"jKey": "6db79eaa7edce0432b012fdfa5fb3d03f40125916344ed9ce87fe701469bc59e",
"data": [
{
"exchange": "NSE",
"tradingSymbol": "Nifty 50"
},
{
"exchange": "NFO",
"tradingSymbol": "NIFTY03APR25C23500"
}
]
}
Example cURL Request
curl --location 'https://api.firstock.in/V1/getMultiQuotes/ltp' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AB1234",
"jKey": "6db79eaa7edce0432b012fdfa5fb3d03f40125916344ed9ce87fe701469bc59e",
"data": [
{
"exchange": "NSE",
"tradingSymbol": "Nifty 50"
},
{
"exchange": "NFO",
"tradingSymbol": "NIFTY03APR25C23500"
}
]
}'
Response Structure
Success Response
A valid request will typically return a 200 OK status and a JSON object containing:
- status: Typically "success".
- message: Short description (e.g., "Multiple quotes LTP data retrieved successfully").
- data: An array of objects—one for each symbol requested, containing LTP and related fields.
Key Fields within data :
- companyName: Display name for the instrument.
- exchange: The exchange code.
- identifier: Unique ID combining the exchange and symbol.
- lastTradedPrice: The LTP for the symbol.
- requestTime: The time at which this data was fetched.
- token: Numeric identifier for the instrument.
- tradingSymbol: The symbol for which the LTP applies.
Failure Response
If any required fields are missing, invalid, or the session is expired, the API may respond with a 400 or 401 status:
- status: "failed".
- code: Error code (e.g., "400", "401").
- Invalid or missing
jKey
- Empty or incorrectly formatted
data
array - Incorrect exchange or tradingSymbol
Response
{
"status": "success",
"message": "Multiple quotes LTP data retrieved successfully",
"data": [
{
"companyName": "RELIANCE INDUSTRIES LTD",
"exchange": "NSE",
"identifier": "NSE:RELIANCE-EQ",
"lastTradedPrice": "1300.00",
"requestTime": "09:13:20 22-04-2025",
"token": 2885,
"tradingSymbol": "RELIANCE-EQ"
},
{
"companyName": "VODAFONE IDEA LIMITED",
"exchange": "NSE",
"identifier": "NSE:IDEA-EQ",
"lastTradedPrice": "8.08",
"requestTime": "09:13:20 22-04-2025",
"token": 14366,
"tradingSymbol": "IDEA-EQ"
}
]
}
{
"status": "failed",
"code": "400",
"name": "BAD_REQUEST",
"error": {
"field": "tradingSymbol",
"message": "Trading Symbol is required"
}
}
Usage & Best Practices
- Watchlists & Dashboards
- Perfect for displaying multiple LTPs in real-time.
- Consolidate user symbols into a single request to reduce overhead.
- Error Handling
- Inspect the response for partial or total failures. If status = "failed", check the error object.
- Session Maintenance
- Keep your jKey fresh; if the server responds with INVALID_JKEY, prompt the user to log in again.
- Reasonable Polling
- If you’re polling, ensure you set a suitable interval to avoid API rate limits and performance bottlenecks.
- Integration with Other Data
- Combine LTP results with user holdings, open positions, or other analytics for a complete trading overview.
Conclusion
The Get Multi Quotes LTP API is a streamlined solution for retrieving last traded prices for multiple instruments in a single request. This helps developers create efficient watchlists and dashboards without retrieving full market-depth data. Always maintain a valid session (jKey), handle errors gracefully, and structure your requests to minimize API overhead. If you need detailed quotes (like best bid/ask levels or other fields), consider the Get Multi Quotes or Get Quotes APIs.