Skip to content

πŸ“ˆ Get real-time stocks from TradingView

Pagination was added to the searchMarketV3

zohourib7c12a4f7505
diff --git a/src/miscRequests.js b/src/miscRequests.js
index cfb8334..0cd3412 100644
--- a/src/miscRequests.js
+++ b/src/miscRequests.js
@@ -133,9 +133,10 @@ module.exports = {
* | 'futures' | 'forex' | 'cfd'
* | 'crypto' | 'index' | 'economic'
* } [filter] Caterogy filter
+ * @param {number} offset Pagination offset
* @returns {Promise<SearchMarketResult[]>} Search results
*/
- async searchMarketV3(search, filter = '') {
+ async searchMarketV3(search, filter = '', offset = 0) {
const splittedSearch = search.toUpperCase().replace(/ /g, '+').split(':');
const request = await axios.get(
@@ -148,6 +149,7 @@ module.exports = {
),
text: splittedSearch.pop(),
search_type: filter,
+ start: offset
},
headers: {
origin: 'https://www.tradingview.com',