MTF Smartlist
API for retrieving a ranked list of Margin Trade Funding (MTF) eligible stocks enriched with live LTP data. Each entry shows the actual market price, the effective MTF price after margin, and the total margin saved.
Request
curl --location 'https://api.upstox.com/v2/market/smartlist/mtf?page_number=1&page_size=20' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
For additional samples in various languages, please refer to the Sample code section on this page.
Query Parameters
| Name | Required | Description |
|---|---|---|
| page_number | false | Page number, 1-indexed. Defaults to 1. |
| page_size | false | Number of records per page. Maximum 50. |
Responses
- 200
- 4XX
Response body
{
"status": "success",
"data": {
"asset_type": "STOCK",
"category": "MTF",
"time_stamp": 1780045827238,
"metric_key": "margin_saved",
"smartlist": [
{
"instrument_key": "NSE_EQ|INE040A01034",
"price": {
"actual_price": 755.1,
"mtf_price": 555.00,
"margin_saved": 200.10,
"close_price": 758.65
},
"mtf_percent": 26.5
},
{
"instrument_key": "NSE_EQ|INE463A01038",
"price": {
"actual_price": 505.8,
"mtf_price": 363.67,
"margin_saved": 142.13,
"close_price": 526.95
},
"mtf_percent": 28.1
},
{
"instrument_key": "NSE_EQ|INE750A01020",
"price": {
"actual_price": 95.3,
"mtf_price": 61.94,
"margin_saved": 33.36,
"close_price": 97.55
},
"mtf_percent": 35.0
}
],
"page_number": 1,
"page_size": 3,
"total_pages": 469
}
}
| Name | Type | Description |
|---|---|---|
| status | string | Outcome of the request. Typically success for successful operations. |
| data | object | Response data object. |
| data.asset_type | string | Always STOCK for MTF. |
| data.category | string | Always MTF. |
| data.time_stamp | integer | Unix timestamp in milliseconds when the data was generated. |
| data.metric_key | string | Always margin_saved for MTF. |
| data.smartlist | array | Ranked list of MTF-eligible stocks. |
| data.smartlist[].instrument_key | string | Unique instrument identifier. See Instrument keys. |
| data.smartlist[].price.actual_price | number | Current market price (LTP). |
| data.smartlist[].price.mtf_price | number | Effective price after applying MTF margin (actual_price - margin_saved). |
| data.smartlist[].price.margin_saved | number | Margin amount saved via MTF (mtf_percent of actual_price). |
| data.smartlist[].price.close_price | number | Previous close price. |
| data.smartlist[].mtf_percent | number | MTF margin percentage for this stock. |
| data.page_number | integer | Current page number. |
| data.page_size | integer | Number of records in the current page. |
| data.total_pages | integer | Total number of pages available. |
Error codes
| Error code | Description |
|---|---|
| UDAPI1214 | Invalid page_size — The page_size value exceeds the maximum allowed value of 50. |
Sample Code
Get MTF Smartlist stocks
- Curl
- Python
- Node.js
- Java
- PHP
curl --location 'https://api.upstox.com/v2/market/smartlist/mtf?page_number=1&page_size=20' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
import requests
url = 'https://api.upstox.com/v2/market/smartlist/mtf'
params = {
'page_number': 1,
'page_size': 20,
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
response = requests.get(url, params=params, headers=headers)
print(response.text)
const axios = require('axios');
const url = 'https://api.upstox.com/v2/market/smartlist/mtf';
const params = {
page_number: 1,
page_size: 20,
};
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
};
axios.get(url, { params, headers })
.then(response => console.log(response.data))
.catch(error => console.error(error));
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) throws Exception {
String url = "https://api.upstox.com/v2/market/smartlist/mtf"
+ "?page_number=1"
+ "&page_size=20";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Bearer {your_access_token}")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$query = http_build_query([
'page_number' => 1,
'page_size' => 20,
]);
$url = 'https://api.upstox.com/v2/market/smartlist/mtf?' . $query;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer {your_access_token}',
]);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
echo $response;
?>
Loading...