0

i need to fetch data from https://www.nasdaq.com/api/v1/loadmore/content_feed_2_3?content_types=article&title=Latest%20News&load_more_text=See%20More%20News&total_limit=40&base_nid=7456&offset=0 . when i fetch data using postman (chrome extension ) it works well but when i fetch using php script it doesn't works.

error_reporting(E_ALL);
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.nasdaq.com/api/v1/loadmore/content_feed_2_3?content_types=article&title=Latest%20News&load_more_text=See%20More%20News&total_limit=40&base_nid=7456&offset=0',
    CURLOPT_RETURNTRANSFER => true,
   // CURLOPT_ENCODING => '',
    CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0',
    CURLOPT_HTTPHEADER => array('Content-type: text/plain'),
   // CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
//    CURLOPT_HTTPHEADER => array(
//        'Cookie: ak_bmsc=0A6F4EE1A61A153AF8CEACFCF215E5B6~000000000000000000000000000000~YAAQJ1stF9zG2kKDAQAAbw2EdBGJ660iRvYwu0OI1LbOUohUTyzwtnMcOXf1u3pf889WVJC69C2Jg7d7STDNE/jUR1BgOo8uoPCyJ/LY9d9ZCZu2zgSUOBNy5yeRkkONEcQigyuKK+9BnLnlJZWPgWNOIvCcZjPz4sUxrUDndRWL4z0eW7Cz/lwwZoaN1da85i+AwvwEUNbJEH+GgqcxUDo3Yur5d0dyPVrmnmDSeHYJojGC9Rc7HtFMGqa7M3+yIeFqGE4sLG2Jdc3ekb9ma0lCLuE+UF7sZtSmuEBNiGe08RqN5gCFWPnbxf44Sn479BfPN68HLY3JGVNaly5344Mk7QdHEuP29uuTAAmrYsLEsYaj2S1kzNeROZMQ'
//    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

0 Answers0