Get Quote
GET /quote/getQuote
Get market depth details for a specific equity scrip including but not limited to values like last trade price, previous close price, change value, change percentage, bids/asks, upper and lower circuit limits etc. This helps user with market picture of an equity scrip using which he will be able to place an order.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
exchange | string | false | Name of the exchange. Valid values include BSE, NSE, NFO, BFO, MCX, MFO, CDS. If not provided, default is NSE. For BSE, NFO, BFO, MFO, CDS, and MCX, exchange is mandatory. |
symbolName | string | true | Symbol name of the scrip. For Equity, enter the SymbolName of the scrip. For Derivatives, enter the TradingSymbol of the scrip. |
Sample Code
bash
curl -X GET 'https://tradeapi.samco.in/quote/getQuote?symbolName=ASIANPAINT24APR2760PE&exchange=NFO' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-session-token: <SESSION_TOKEN>'java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Sample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://tradeapi.samco.in/quote/getQuote?symbolName=ASIANPAINT24APR2760PE&exchange=NFO"))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("x-session-token", "<SESSION_TOKEN>")
.GET()
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}js
(async () => {
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-session-token': '<SESSION_TOKEN>',
};
const response = await fetch('https://tradeapi.samco.in/quote/getQuote?symbolName=ASIANPAINT24APR2760PE&exchange=NFO', {
method: 'GET',
headers,
});
const data = await response.json();
console.log(data);
})();py
import requests
import json
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-session-token': '<SESSION_TOKEN>',
}
r = requests.get('https://tradeapi.samco.in/quote/getQuote?symbolName=ASIANPAINT24APR2760PE&exchange=NFO',
headers=headers)
print(r.json())Sample Responses
json
{
"serverTime": "04/04/24 15:47:05",
"msgId": "4568350b-c552-4a53-8981-45241b5d20e7",
"status": "Success",
"statusMessage": "Quote details retrieved successfully",
"quoteDetails": {
"symbolName": "ASIANPAINT",
"tradingSymbol": "ASIANPAINT24APR2760PE",
"exchange": "NFO",
"lastTradedTime": "04/04/2024 15:29:58",
"lastTradedPrice": "09.95",
"previousClose": "14.7",
"changeValue": "-4.75",
"changePercentage": "-32.31",
"lastTradedQuantity": "200",
"lowerCircuitLimit": "0.05",
"upperCircuitLimit": "36.45",
"averagePrice": "11.92",
"openValue": "13.2",
"highValue": "18.85",
"lowValue": "7.65",
"closeValue": "14.7",
"totalBuyQuantity": "45200",
"totalSellQuantity": "29000",
"totalTradedValue": "31.4211200 (Lacs)",
"totalTradedVolume": "263600",
"yearlyHighPrice": "0",
"yearlyLowPrice": "0",
"tickSize": "0.05",
"bestBids": [
{
"number": "1",
"quantity": "200",
"price": "9.6"
},
{
"number": "2",
"quantity": "200",
"price": "9.55"
},
{
"number": "3",
"quantity": "200",
"price": "9.5"
},
{
"number": "4",
"quantity": "200",
"price": "9.45"
},
{
"number": "5",
"quantity": "6000",
"price": "8.35"
}
],
"bestAsks": [
{
"number": "1",
"quantity": "200",
"price": "10.2"
},
{
"number": "2",
"quantity": "200",
"price": "10.25"
},
{
"number": "3",
"quantity": "200",
"price": "10.6"
},
{
"number": "4",
"quantity": "200",
"price": "10.65"
},
{
"number": "5",
"quantity": "200",
"price": "10.75"
}
],
"listingId": "73859_NFO",
"openInterestChange": "-4200",
"instrument": "OPTSTK",
"expiryDate": "25 Apr 24",
"lotQuantity": "200",
"oIChangePer": "-9.95"
}
}Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
serverTime | string | Time at Server. |
msgId | string | Unique identifier for every request. Useful for tracking and troubleshooting. |
status | string | Status of the API response. Can be 'Success' or 'Failure'. |
statusMessage | string | Descriptive message regarding the result of the API call. |
symbolName | string | Symbol name of the scrip. |
tradingSymbol | string | Trading Symbol of the scrip. |
exchange | string | Name of the exchange. Valid values include BSE, NSE, NFO, MCX, CDS. Defaults to NSE if not provided. Mandatory for BSE, NFO, CDS, and MCX. |
companyName | string | Full name of the company. |
lastTradedTime | string | Time of the last transaction. |
lastTradedPrice | string | Price at which the last transaction was done. |
previousClose | string | Previous close refers to the prior day's final price of the security at market close. |
changeValue | string | Difference between the current value and the previous day's market close. |
changePercentage | string | Percentage change between the current value and the previous day's market close. |
lastTradedQuantity | string | Quantity of the last transaction. |
lowerCircuitLimit | string | Limit below which a stock price cannot trade on a particular trading day. |
upperCircuitLimit | string | Limit above which a stock price cannot trade on a particular trading day. |
averagePrice | string | Average price of the trading session. |
openValue | string | Opening price of the market snapshot. |
highValue | string | High value of the market snapshot. |
lowValue | string | Low value of the market snapshot. |
closeValue | string | Close value of the market snapshot. |
totalBuyQuantity | string | Total quantity of BUY transactions. |
totalSellQuantity | string | Total quantity of SELL transactions. |
totalTradedValue | string | Total value of trades made for the scrip. |
totalTradedVolume | string | Total volume of trading done. |
yearlyHighPrice | string | 52-week high price. |
yearlyLowPrice | string | 52-week low price. |
tickSize | string | Value of a single price tick. Default is 0.05. |
openInterest | string | Number of existing contracts held by buyers or sellers for any market on a given day. |
bestBids | object | Most frequent trading bids for BUY. |
number | string | Sequence number for Bid/Ask. |
quantity | string | Quantity asked for trading. |
price | string | Price asked for trading. |
bestAsks | object | Most frequent trading asks for SELL. |
number | string | Sequence number for Bid/Ask. |
quantity | string | Quantity asked for trading. |
price | string | Price asked for trading. |
expiryDate | string | Expiry date of the scrip. |
spotPrice | string | Spot price. Applicable in case of Futures and Options. |
instrument | string | Instrument Name. |
lotQuantity | string | Lot quantity. Applicable for Futures & Options. |
listingId | string | Identifier assigned to the scrip by the exchange in the format <>_<>. |
openInterestChange | string | Change in open interest, reflecting the number of contracts held for the market. |
getoIChangePer | string | Percentage change in open interest. |