I need some advice. I need to get data from API to display it on my application. The API is working both through Postman or through the browser, but when I upload the same code to the server, my API response returns NULL.
Here is the response I am getting with POSTMAN:
And here is the code I am using:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.instagram.com/myexcellentuser/?__a=1');
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$file_data = json_decode(curl_exec($ch));
curl_close($ch);
var_dump($file_data);
And here is what this same code returns on the app hosted on a server:
I would be extremely grateful for the advice!
Thanks!