Skip to content

Intraday Chart Data

Intraday Chart Data APIs

method path description
GET https://api.mstock.trade/openapi/typea/instruments/intraday/{exchange}/{instrument_token}/{interval} View intraday Chart Data

The Intraday Chart data API provides the current data chart data for instruments across various exchange segment based on interval frame.

Intraday Chart Data Limit

Only current date data will be show for that script and exchange based on interval frame

Request Headers -

  • X-Mirae-Version: Specifies the version of the API being used. In this case, it is set to 1.

  • Authorization: A token-based authentication header. The format is token api_key:access_token.

  • Content-Type : Indicated the media type of the resource. For this request, it is set to application/x-www-form-urlencoded, which is used for submiting form data.

curl --location 'https://api.mstock.trade/openapi/typea/instruments/intraday/1/22/minute' \
--header 'X-Mirae-Version: 1' \
--header 'Authorization: token api_key:access_token'
import axios from 'axios';

const response = await axios.get('https://api.mstock.trade/openapi/typea/instruments/intraday/1/22/minute', {
params: {
    'from': '2024-08-02 09:15:00',
    'to': '2024-08-04 09:20:00'
},
headers: {
    'X-Mirae-Version': '1',
    'Authorization': 'token api_key:access_token'
}
});
import http.client

conn = http.client.HTTPSConnection('api.mstock.trade')
headers = {
    'X-Mirae-Version': '1',
    'Authorization': 'token api_key:access_token',
}
conn.request(
    'GET',
    '/openapi/typea/instruments/intraday/1/22/minute',
    headers=headers
)
response = conn.getresponse()
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mstock.trade/openapi/typea/instruments/intraday/1/22/minute"))
    .GET()
    .setHeader("X-Mirae-Version", "1")
    .setHeader("Authorization", "token api_key:access_token")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

Query Parameter -

Field Type Description
Exchange string Exchange segment (1-NSE, 2-NFO, 3-CDS, 4-BSE, 5-BFO)
instrument_token string Instrument token from the Script Master CSV. Download the file scriptmaster.
interval string Interval frame (minute, 3minute, 5minute, 10minute, 15minute, 30minute, 60minute, day)

Query Parameter -

Field Type Description
exchange string 1
instrument_token string 22
interval string minute

Request Body - This endpoint does not require a request body or additional parameters in the query string for the retrieval of orders.

Request Response -

The response of the request will be based on authentication outcome.

  • Success (HTTP Status 200): On successful request update, the server returns a JSON object.
{
    "status": "success",
    "data": {
        "candles": [
            [
                "2025-03-13T12:03:00+05",
                502.95,
                502.95,
                502.6,
                502.65,
                4634
            ],
            [
                "2025-03-13T12:02:00+05",
                502.8,
                502.95,
                502.7,
                502.7,
                4069
            ],
            [
                "2025-03-13T12:01:00+05",
                502.85,
                503.1,
                502.75,
                502.75,
                5504
            ],
            [
                "2025-03-13T12:00:00+05",
                502.95,
                502.95,
                502.65,
                502.65,
                9583
            ]
        ]
    }
}
  • Failure (HTTP Status 400): If the request fails due to invalid parameters the server will return an error message with below json format.
{
    "status": "error",
    "message": "Invalid request. Please try again.",
    "error_type": "InputException",
    "data": null
}
  • Failure (HTTP Status 401): If the request fails due to authentication issues the server will return an error message with below json format.
{
    "status": "error",
    "message": "Invalid request. Please try again.",
    "error_type": "TokenException",
    "data": null
}
  • Failure (HTTP Status 403): If the API Key is Invalid or expired.
{
    "status": "error",
    "message": "API is suspended/expired for use. Please check your API subscription and try again.",
    "error_type": "APIKeyException",
    "data": null
}