File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/API/Finance/tv/best-performing.php
Back
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://scanner.tradingview.com/india/scan', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"filter":[{"left":"name","operation":"nempty"},{"left":"exchange","operation":"in_range","right":["NSE"]},{"left":"type","operation":"equal","right":"stock"},{"left":"subtype","operation":"equal","right":"common"}],"options":{"lang":"en"},"markets":["india"],"symbols":{"query":{"types":[]},"tickers":[]},"columns":["logoid","name","close","change","change_abs","Recommend.All","volume","Value.Traded","market_cap_basic","price_earnings_ttm","earnings_per_share_basic_ttm","number_of_employees","sector","description","type","subtype","update_mode","pricescale","minmov","fractional","minmove2","currency","fundamental_currency_code"],"sort":{"sortBy":"name","sortOrder":"asc"},"range":[0,1950]}', CURLOPT_HTTPHEADER => array( 'Content-Type: text/plain' ), )); $response = curl_exec($curl); $datajson = json_decode($response); curl_close($curl); $totalval = $datajson->totalCount; $no = 0; while($no<$totalval) { echo $datajson->data[$no]->d[1].'</br>'; $no = $no + 1; } /*include_once("simple_html_dom.php"); $html = file_get_html("https://in.tradingview.com/markets/stocks-india/market-movers-best-performing/"); //$table = $html->find('table',0); $tds = $html->find('td'); $no = 1; echo '<table border="1"> <tr>'; foreach($tds as $td) { if($td->plaintext == '') echo 'NOT FOUND'; /*if($no%15==0) echo '</tr><tr>'; echo '<td>'.$td.'</td>'; $no = $no + 1; } echo '</tr>';*/ ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.4 |
proxy
|
phpinfo
|
Settings