Intraday Candle Data V3
Get data with a 1-minute interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/1 \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/1'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/1';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/1";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/1';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "minutes", "1")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", "1", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", 1);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get data with a 3-minute interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/3' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/3'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/3';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/3";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/3';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "minutes", "3")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", "3", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", 3);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get data with a 5-minute interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/5' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/5'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/5';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/5";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/5';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "minutes", "5")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", "5", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", 5);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get data with a 15-minute interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/15' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/15'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/15';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/15";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/15';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "minutes", "15")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", "15", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", 15);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get data with a 30-minute interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/30' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/30'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/30';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/30";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/minutes/30';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "minutes", "30")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", "30", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "minutes", 30);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get data with a 1-hour interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/1' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/1'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/1';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/1";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/1';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "hours", "1")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "hours", "1", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "hours", 1);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get data with a 2-hour interval
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/2' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/2'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/2';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/2";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/hours/2';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "hours", "2")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "hours", "2", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "hours", 2);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}
Get current day data
- Curl
- Python
- Node.js
- Java
- PHP
- Python SDK
- Node.js SDK
- Java SDK
curl --location 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/days/1' \
--header 'Accept: application/json'
import requests
url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/days/1'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
# Check the response status
if response.status_code == 200:
# Do something with the response data (e.g., print it)
print(response.json())
else:
# Print an error message if the request was not successful
print(f"Error: {response.status_code} - {response.text}")
const axios = require('axios');
const url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/days/1';
const headers = {
'Accept': 'application/json'
};
axios.get(url, { headers })
.then(response => {
// Do something with the response data (e.g., print it)
console.log(response.data);
})
.catch(error => {
// Print an error message if the request was not successful
console.error(`Error: ${error.response.status} - ${error.response.data}`);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/days/1";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.build();
try {
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
// Check the response status
if (httpResponse.statusCode() == 200) {
// Do something with the response body (e.g., print it)
System.out.println(httpResponse.body());
} else {
// Print an error message if the request was not successful
System.err.println("Error: " + httpResponse.statusCode() + " - " + httpResponse.body());
}
} catch (Exception e) {
// Handle exceptions
e.printStackTrace();
}
}
}
<?php
$url = 'https://api.upstox.com/v3/historical-candle/intraday/NSE_EQ%7CINE848E01016/days/1';
$options = [
'http' => [
'header' => "Accept: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
// Check for errors
if ($response === FALSE) {
echo 'Error fetching data';
} else {
// Do something with the response (e.g., print it)
echo $response;
}
?>
import upstox_client
apiInstance = upstox_client.HistoryV3Api()
try:
response = apiInstance.get_intra_day_candle_data("NSE_EQ|INE848E01016", "days", "1")
print(response)
except Exception as e:
print("Exception when calling HistoryV3Api->get_intra_day_candle_data: %s\n" % e)
let UpstoxClient = require('upstox-js-sdk');
const historicalApiInstance = new UpstoxClient.HistoryV3Api();
historicalApiInstance.getIntraDayCandleData("NSE_EQ|INE848E01016", "days", "1", (error, data, response) => {
if (error) {
console.error(error.response.text);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}
});
public class Main {
public static void main(String[] args) {
HistoryV3Api historyV3Api = new HistoryV3Api();
try {
GetIntraDayCandleResponse result = historyV3Api.getIntraDayCandleData("NSE_EQ|INE848E01016", "days", 1);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HistoryV3Api->getIntraDayCandleData");
e.printStackTrace();
}
}
}