Skip to content

Commit

Permalink
Merge pull request #36 from mihirharshe/fix-api
Browse files Browse the repository at this point in the history
fixed NSE API URLs
  • Loading branch information
maanavshah authored Nov 25, 2021
2 parents 5121914 + 22d0680 commit 5bfc8e1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions nse/service/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ function searchStocks(searchString) {
var options = {
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Referer': 'https://www.nseindia.com/ChartApp/install/charts/mainpage.jsp',
Host: 'www.nseindia.com'
'Referer': 'https://www1.nseindia.com/ChartApp/install/charts/mainpage.jsp',
Host: 'www1.nseindia.com'
},
transformResponse: searchTransformer(false)
};
Expand Down Expand Up @@ -198,8 +198,8 @@ function getStockFuturesData(symbol, expiryDate, isIndex) {
params: params,
headers: {
'X-Requested-With': 'XMLHttpRequest',
Host: 'www.nseindia.com',
'Referer': 'https://nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=' + symbol + '&instrument=' + params['instrument'] + '&type=SELECT&strike=SELECT&expiry=' + expiryDate,
Host: 'www1.nseindia.com',
'Referer': 'https://www1.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=' + symbol + '&instrument=' + params['instrument'] + '&type=SELECT&strike=SELECT&expiry=' + expiryDate,
}
});
}
Expand All @@ -210,8 +210,8 @@ function get52WeekHigh() {
url: YEAR_HIGH_URL,
headers: {
'X-Requested-With': 'XMLHttpRequest',
Host: 'www.nseindia.com',
'Referer': 'https://nseindia.com/products/content/equities/equities/eq_new_high_low.htm'
Host: 'www1.nseindia.com',
'Referer': 'https://www1.nseindia.com/products/content/equities/equities/eq_new_high_low.htm'
}
});
}
Expand All @@ -222,7 +222,7 @@ function get52WeekLow() {
url: YEAR_LOW_URL,
headers: {
'X-Requested-With': 'XMLHttpRequest',
Host: 'www.nseindia.com',
Host: 'www1.nseindia.com',
'Referer': 'https://nseindia.com/products/content/equities/equities/eq_new_high_low.htm'
}
});
Expand All @@ -234,8 +234,8 @@ function getTopValueStocks() {
url: TOP_VALUE_URL,
headers: {
'X-Requested-With': 'XMLHttpRequest',
Host: 'www.nseindia.com',
'Referer': 'https://nseindia.com/live_market/dynaContent/live_analysis/most_active_securities.htm'
Host: 'www1.nseindia.com',
'Referer': 'https://www1.nseindia.com/live_market/dynaContent/live_analysis/most_active_securities.htm'
}
});
}
Expand All @@ -246,8 +246,8 @@ function getTopVolumeStocks() {
url: TOP_VOLUME_URL,
headers: {
'X-Requested-With': 'XMLHttpRequest',
Host: 'www.nseindia.com',
'Referer': 'https://nseindia.com/live_market/dynaContent/live_analysis/most_active_securities.htm'
Host: 'www1.nseindia.com',
'Referer': 'https://www1.nseindia.com/live_market/dynaContent/live_analysis/most_active_securities.htm'
}
});
}
Expand Down

0 comments on commit 5bfc8e1

Please sign in to comment.