Personal Index
GET /indexData
The Personal Index API provides detailed insights into a user's trading performance by aggregating the overall profit and loss of all executed trades. This API delivers comprehensive data on an individual's personal index, allowing users to monitor and analyze their trading activities efficiently. It is an essential tool for evaluating performance metrics and managing investment strategies based on historical trade outcomes.
Sample Code
bash
curl -X GET 'https://tradeapi.samco.in/indexData' \
-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/indexData"))
.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/indexData', {
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/indexData',
headers=headers)
print(r.json())Sample Response
json
{
"serverTime": "04/04/24 11:22:12",
"msgId": "2164268d-d38b-490e-bbb2-d3cedda3a907",
"status": "Success",
"statusMessage": "Index Data retrieved successfully",
"indexData": {
"indexName": "MXXXXXXD IXXXx",
"networth": "209.52",
"indexData": {
"index": "4.04",
"indexChange": "0.04",
"indexChangePercentage": "1.04",
"latestTime": "2024-04-04 11:21:00",
"networthChange": "2.15",
"networthChangePercentage": "1.04",
"fundReceipt": "0.00"
}
}
}Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
serverTime | string | The date and time when the server generated the response. |
msgId | string | A unique identifier for the API response message. Useful for tracking or debugging. |
status | string | The status of the API response. Possible values: 'Success', 'Error', or 'Failure'. |
statusMessage | string | A message describing the result of the API call. |
indexDataDetails | Object | Detailed information about the user's personal index. |
indexName | string | The name of the personal index. |
networth | string | The current net worth associated with the personal index. |
indexData | Object | Specific details about the index's performance. |
Index | string | The current value of the index. |
IndexChange | string | The absolute change in the index value compared to the previous update. |
IndexChangePercentage | string | The percentage change in the index value compared to the previous update. |
latestTime | string | The timestamp indicating the most recent update to the index data. |
networthChange | string | The variance between yesterday's and today's net worth values. |
networthChangePercentage | string | The percentage change in net worth value from yesterday to today. |
fundReceipt | string | Today's payment amount: the sum received or transferred to fund. |