Skip to content

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

NameTypeRequiredDescription
exchangestringfalseName 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.
symbolNamestringtrueSymbol 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

NameTypeDescription
serverTimestringTime at Server.
msgIdstringUnique identifier for every request. Useful for tracking and troubleshooting.
statusstringStatus of the API response. Can be 'Success' or 'Failure'.
statusMessagestringDescriptive message regarding the result of the API call.
symbolNamestringSymbol name of the scrip.
tradingSymbolstringTrading Symbol of the scrip.
exchangestringName of the exchange. Valid values include BSE, NSE, NFO, MCX, CDS. Defaults to NSE if not provided. Mandatory for BSE, NFO, CDS, and MCX.
companyNamestringFull name of the company.
lastTradedTimestringTime of the last transaction.
lastTradedPricestringPrice at which the last transaction was done.
previousClosestringPrevious close refers to the prior day's final price of the security at market close.
changeValuestringDifference between the current value and the previous day's market close.
changePercentagestringPercentage change between the current value and the previous day's market close.
lastTradedQuantitystringQuantity of the last transaction.
lowerCircuitLimitstringLimit below which a stock price cannot trade on a particular trading day.
upperCircuitLimitstringLimit above which a stock price cannot trade on a particular trading day.
averagePricestringAverage price of the trading session.
openValuestringOpening price of the market snapshot.
highValuestringHigh value of the market snapshot.
lowValuestringLow value of the market snapshot.
closeValuestringClose value of the market snapshot.
totalBuyQuantitystringTotal quantity of BUY transactions.
totalSellQuantitystringTotal quantity of SELL transactions.
totalTradedValuestringTotal value of trades made for the scrip.
totalTradedVolumestringTotal volume of trading done.
yearlyHighPricestring52-week high price.
yearlyLowPricestring52-week low price.
tickSizestringValue of a single price tick. Default is 0.05.
openIntereststringNumber of existing contracts held by buyers or sellers for any market on a given day.
bestBidsobjectMost frequent trading bids for BUY.
numberstringSequence number for Bid/Ask.
quantitystringQuantity asked for trading.
pricestringPrice asked for trading.
bestAsksobjectMost frequent trading asks for SELL.
numberstringSequence number for Bid/Ask.
quantitystringQuantity asked for trading.
pricestringPrice asked for trading.
expiryDatestringExpiry date of the scrip.
spotPricestringSpot price. Applicable in case of Futures and Options.
instrumentstringInstrument Name.
lotQuantitystringLot quantity. Applicable for Futures & Options.
listingIdstringIdentifier assigned to the scrip by the exchange in the format <>_<>.
openInterestChangestringChange in open interest, reflecting the number of contracts held for the market.
getoIChangePerstringPercentage change in open interest.