Index IntraDay candle data
GET /intraday/indexCandleData
Gets the Index intraday candle data such as Open, high, low, close and volume within specific time period per min for a specific index.
Supported Index names:
| BSE CG | SENSEX | BSE CD | NIFTY50 PR 1x INV |
|---|---|---|---|
| BSE IT | METAL | OILGAS | NIFTY50 PR 2x LEV |
| BSEIPO | GREENX | POWER | NIFTY50 TR 1x INV |
| CARBON | BASMTR | CDGS | NIFTY50 TR 2x LEV |
| BSEFMC | BSE HC | ALLCAP | NIFTY50 TR 2x LEV |
| REALTY | SMEIPO | DOL30 | NIFTY Mid LIQ 15 |
| LRGCAP | MIDSEL | SMLSEL | NIFTY100 LIQ 15 |
| SNXT50 | SNSX50 | NIFTY 50 | NIFTY Quality 30 |
| NIFTY BANK | NIFTY NEXT 50 | DOL100 | NIFTY MIDCAP 50 |
| NIFTY 100 | NIFTY 200 | NIFTY 500 | NIFTY FIN SERVICE |
| NIFTY AUTO | NIFTY FMCG | NIFTY IT | NIFTY COMMODITIES |
| NIFTY MEDIA | NIFTY METAL | NIFTY PHARMA | NIFTY CONSUMPTION |
| NIFTY PSU BANK | NIFTY PVT BANK | NIFTY REALTY | NIFTY GROWSECT 15 |
| NIFTY CPSE | NIFTY ENERGY | NIFTY INFRA | NIFTY DIV OPPS 50 |
| NIFTY MNC | NIFTY PSE | NIFTY SERV SECTOR | NIFTY MID100 FREE |
| DOL200 | TECK | BSEPSU | NIFTY SML100 FREE |
| AUTO | BANKEX | INDIA VIX | NIFTY50 VALUE 20 |
| NIFTY MID SELECT |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
indexName | string | true | Index name of the scrip. |
fromDate | string | true | From date in yyyy-MM-dd hh:mm:ss format. |
toDate | string | false | To date in yyyy-MM-dd hh:mm:ss format. |
interval | string | false | Interval of data; default is 1 minute. |
Sample Code
bash
curl -X GET 'https://tradeapi.samco.in/intraday/indexCandleData?indexName=SENSEX&fromDate=2020-03-11%2010%3A00%3A00' \
-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/intraday/indexCandleData?indexName=SENSEX&fromDate=2020-03-11%2010%3A00%3A00"))
.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/intraday/indexCandleData?indexName=SENSEX&fromDate=2020-03-11%2010%3A00%3A00', {
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/intraday/indexCandleData?indexName=SENSEX&fromDate=2020-03-11%2010%3A00%3A00',
headers=headers)
print(r.json())Sample response
200 Response
json
{
"serverTime": "12/12/19 16:20:11",
"msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
"status": "Success",
"statusMessage": "Index details retrieved successfully.",
"indexIntraDayCandleData": [
{
"dateTime": "2019-11-11 10:01:00",
"open": "689.9",
"high": "694.0",
"low": "682.75",
"close": "688.0",
"volume": "600344"
}
]
}Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
serverTime | string | Time at Server. |
msgId | string | Unique identifier for every request. |
status | string | Response status; can be success or failure. |
statusMessage | string | Status message of the Index request. |
indexIntraDayCandleData | [object] | List of Index IntraDay Candle Data. |
dateTime | string | Date for which Candle Data is shown. |
open | string | Opening price of a market snapshot. |
high | string | High value of market snapshot. |
low | string | Low value of market snapshot. |
close | string | Close value of market snapshot. |
volume | string | Volume of security traded on the specific day. |