Skip to content

Index Quote

GET /quote/indexQuote

Getting Index Quote details for a specific Indicies. This helps user with market picture of an specific Index Details.

Parameters

NameTypeRequiredDescription
indexNamestringtrueIndex name of the scrip.

Sample Code

bash
curl -X GET 'https://tradeapi.samco.in/quote/indexQuote?indexName=Sensex' \
  -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/indexQuote?indexName=Sensex"))
        .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/indexQuote?indexName=Sensex', {
    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/indexQuote?indexName=Sensex',
  headers=headers)

print(r.json())

Sample Responses

json
{
    "serverTime": "04/04/24 14:34:13",
    "msgId": "13f6cb1e-8c31-4c5c-a15b-df7b27ac15a5",
    "status": "Success",
    "statusMessage": "Index Quote details retrieved successfully",
    "indexDetails": [
        {
            "indexName": "SENSEX",
            "listingId": "-101",
            "lastTradedTime": "2024-04-04 14:34:12.0",
            "spotPrice": 74344.02,
            "changePercentage": 0.63,
            "averagePrice": 0,
            "openValue": 74413.82,
            "highValue": 74501.73,
            "lowValue": 73485.12,
            "closeValue": 73876.82,
            "totalBuyQuantity": 0,
            "totalSellQuantity": 0,
            "totalTradedValue": 0,
            "totalTradedVolume": 0,
            "change": 467.2
        }
    ]
}

Response Schema

Status Code 200

NameTypeDescription
serverTimestringTime at Server.
msgIdstringThis is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request.
statusstringThe status of the API response. It can be either 'Success' or 'Failure'.
statusMessagestringA message describing the result of the API call.
indexNamestringIndex Name of the indices.
listingIdstringIdentifier assigned to the scrip by exchange in the format <>_<>.
lastTradedTimestringTime of the last transaction.
spotPricestringSpot price. Applicable in case of Futures and Options.
changePercentagestringPercentage of change between the current value and the previous day's market close.
averagePricestringAverage price of a market snapshot.
openValuestringOpening price of a market snapshot.
highValuestringHigh value of market snapshot.
lowValuestringLow value of market snapshot.
closeValuestringClose value of market snapshot.
totalBuyQuantitystringTotal quantity of BUY transactions.
totalSellQuantitystringTotal quantity of SELL transactions.
totalTradedValuestringValue of total trade made for the scrip.
totalTradedVolumestringTotal volume of trading done.
changestringChange value is the difference between the current value and the previous day's market close.