GET/market-quote/ltp
LTP Quotes V3
API provides LTP quotes for specified instruments. In V3, the response has been enhanced to include:
ltq: The quantity of the last traded transaction.volume: The cumulative trading volume for the current day.cp: The closing price from the previous trading day.
This API allows 50 requests per second, 500 per minute and 2,000 per 30 minutes. Send up to 500 instrument keys in one request, and each call counts as one request. See Rate Limits.
New Instruments
- Global Index — Major global stock market indices such as GIFT NIFTY, Dow Jones, S&P, FTSE 100, and more. See Global Instruments for details and download the Global Instruments file for instrument keys.
- India VIX — The NSE Volatility Index, available using instrument key
NSE_INDEX|India VIX.
Request
curl --location 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
Additional samples in various languages are available in the Sample Code section on this page.
Query Parameters
| Name | Required | Description |
|---|---|---|
| instrument_key | Required | Comma separated list of instrument keys. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
Responses
- 200
- 4XX
Response body
{
"status": "success",
"data": {
"NSE_FO:NIFTY2543021600PE": {
"last_price": 303.9,
"instrument_token": "NSE_FO|51834",
"ltq": 75,
"volume": 170325,
"cp": 29.0
}
}
}
| Name | Type | Description |
|---|---|---|
| status | string | A string indicating the outcome of the request. Typically success for successful operations. |
| data | object | Data object holding LTP information |
| data.last_price | number | The last traded price of symbol |
| data.instrument_token | string | Key of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
| data.ltq | number | Last traded quantity |
| data.volume | number | Volume traded today till current time |
| data.cp | number | Previous day's closing price |
Error codes
| Error code | Description |
|---|---|
| UDAPI1009 | instrument_key is required - The instrument_key parameter is missing. |
| UDAPI1011 | instrument_key is of invalid format - The provided instrument_key does not conform to the accepted format. |
| UDAPI1087 | Invalid Instrument key - The provided instrument_key is invalid. |
| UDAPI100043 | Maximum instrument key limit exceeded - The request exceeds the maximum number of instrument keys allowed. |
Sample Code
Get ltp (last traded price) market quotes
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
import requests
url = 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
response = requests.get(url, headers=headers)
print(response.text)
const axios = require('axios');
const url = 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016';
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
};
axios.get(url, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpHeaders;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016";
String contentTypeHeader = "application/json";
String acceptHeader = "application/json";
String authorizationHeader = "Bearer {your_access_token}";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", contentTypeHeader)
.header("Accept", acceptHeader)
.header("Authorization", authorizationHeader)
.build();
HttpResponse<String> response = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
int statusCode = response.statusCode();
HttpHeaders headers = response.headers();
String responseBody = response.body();
System.out.println("Status Code: " + statusCode);
System.out.println("Response Headers: " + headers);
System.out.println("Response Body: " + responseBody);
}
}
<?php
$url = 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016';
$contentTypeHeader = 'application/json';
$acceptHeader = 'application/json';
$authorizationHeader = 'Bearer {your_access_token}';
$ch = curl_init($url);
// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: ' . $contentTypeHeader,
'Accept: ' . $acceptHeader,
'Authorization: ' . $authorizationHeader,
]);
// Execute cURL session and get the response
$response = curl_exec($ch);
// Check for cURL errors
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
// Close cURL session
curl_close($ch);
// Output the response
echo $response;
?>
import upstox_client
from upstox_client.rest import ApiException
configuration = upstox_client.Configuration()
configuration.access_token = '{your_access_token}'
apiInstance = upstox_client.MarketQuoteV3Api(upstox_client.ApiClient(configuration))
try:
# For a single instrument
response = apiInstance.get_ltp(instrument_key="NSE_EQ|INE848E01016")
print(response)
except ApiException as e:
print("Exception when calling MarketQuoteV3Api->get_ltp: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
let defaultClient = UpstoxClient.ApiClient.instance;
var OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = "{your_access_token}";
let marketQuoteApiInstance = new UpstoxClient.MarketQuoteV3Api();
marketQuoteApiInstance.getLtp({instrumentKey: "NSE_EQ|INE848E01016"}, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.MarketQuoteV3Api;
import com.upstox.model.GetMarketQuoteLastTradedPriceResponseV3;
import com.upstox.auth.*;
public class Main {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");
MarketQuoteV3Api marketQuoteV3Api = new MarketQuoteV3Api();
try {
GetMarketQuoteLastTradedPriceResponseV3 result = marketQuoteV3Api.getLtp("NSE_EQ|INE848E01016");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MarketQuoteV3Api#getLtp");
e.printStackTrace();
}
}
}
Get ltp (last traded price) market quotes for multiple instruments keys
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016,NSE_EQ|INE669E01016' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
import requests
url = 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016,NSE_EQ|INE669E01016'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
response = requests.get(url, headers=headers)
print(response.text)
const axios = require('axios');
const url = 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016,NSE_EQ|INE669E01016';
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
};
axios.get(url, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpHeaders;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016,NSE_EQ|INE669E01016";
String contentTypeHeader = "application/json";
String acceptHeader = "application/json";
String authorizationHeader = "Bearer {your_access_token}";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", contentTypeHeader)
.header("Accept", acceptHeader)
.header("Authorization", authorizationHeader)
.build();
HttpResponse<String> response = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
int statusCode = response.statusCode();
HttpHeaders headers = response.headers();
String responseBody = response.body();
System.out.println("Status Code: " + statusCode);
System.out.println("Response Headers: " + headers);
System.out.println("Response Body: " + responseBody);
}
}
<?php
$url = 'https://api.upstox.com/v3/market-quote/ltp?instrument_key=NSE_EQ%7CINE848E01016,NSE_EQ|INE669E01016';
$contentTypeHeader = 'application/json';
$acceptHeader = 'application/json';
$authorizationHeader = 'Bearer {your_access_token}';
$ch = curl_init($url);
// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: ' . $contentTypeHeader,
'Accept: ' . $acceptHeader,
'Authorization: ' . $authorizationHeader,
]);
// Execute cURL session and get the response
$response = curl_exec($ch);
// Check for cURL errors
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
// Close cURL session
curl_close($ch);
// Output the response
echo $response;
?>
import upstox_client
from upstox_client.rest import ApiException
configuration = upstox_client.Configuration()
configuration.access_token = '{your_access_token}'
apiInstance = upstox_client.MarketQuoteV3Api(upstox_client.ApiClient(configuration))
try:
# For multiple instruments
response = apiInstance.get_ltp(instrument_key="NSE_EQ|INE848E01016,NSE_EQ|INE669E01016")
print(response)
except ApiException as e:
print("Exception when calling MarketQuoteV3Api->get_ltp: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
let defaultClient = UpstoxClient.ApiClient.instance;
var OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = "{your_access_token}";
let marketQuoteApiInstance = new UpstoxClient.MarketQuoteV3Api();
marketQuoteApiInstance.getLtp({instrumentKey: "NSE_EQ|INE848E01016,NSE_EQ|INE669E01016"}, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.MarketQuoteV3Api;
import com.upstox.model.GetMarketQuoteLastTradedPriceResponseV3;
import com.upstox.auth.*;
public class Main {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");
MarketQuoteV3Api marketQuoteV3Api = new MarketQuoteV3Api();
try {
GetMarketQuoteLastTradedPriceResponseV3 result = marketQuoteV3Api.getLtp("NSE_EQ|INE848E01016,NSE_EQ|INE669E01016");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MarketQuoteV3Api#getLtp");
e.printStackTrace();
}
}
}