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
| Name | Type | Required | Description |
|---|---|---|---|
indexName | string | true | Index 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
| Name | Type | Description |
|---|---|---|
serverTime | string | Time at Server. |
msgId | string | This 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. |
status | string | The status of the API response. It can be either 'Success' or 'Failure'. |
statusMessage | string | A message describing the result of the API call. |
indexName | string | Index Name of the indices. |
listingId | string | Identifier assigned to the scrip by exchange in the format <>_<>. |
lastTradedTime | string | Time of the last transaction. |
spotPrice | string | Spot price. Applicable in case of Futures and Options. |
changePercentage | string | Percentage of change between the current value and the previous day's market close. |
averagePrice | string | Average price of a market snapshot. |
openValue | string | Opening price of a market snapshot. |
highValue | string | High value of market snapshot. |
lowValue | string | Low value of market snapshot. |
closeValue | string | Close value of market snapshot. |
totalBuyQuantity | string | Total quantity of BUY transactions. |
totalSellQuantity | string | Total quantity of SELL transactions. |
totalTradedValue | string | Value of total trade made for the scrip. |
totalTradedVolume | string | Total volume of trading done. |
change | string | Change value is the difference between the current value and the previous day's market close. |