Reputation: 23
I'm trying to access Instagram Stories endpoint as described here and here but with PHP -- sending user_id and sessionid obtained with Spy HTTP Chrome Extension.
I'm getting the response/error: string(105) "5xx Server Error" ¿What it could be?
Also when i change the user agent to Instagram 10.8.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US
i get string(67) "{"message": "login_required", "logout_reason": 2, "status": "fail"}"
function Geturl($url){
$process = curl_init($url);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_COOKIE, "ds_user_id=XXXXXX; sessionid=XXXXXX");
curl_setopt($process, CURLOPT_USERAGENT, "Instagram 9.5.1 (iPhone9,2; iOS 10_0_2; en_US; en-US; scale=2.61; 1080x1920) AppleWebKit/420+");
$return = curl_exec($process);
if(curl_error($process))
{
return 'error:' . curl_error($process);
}
curl_close($process);
return $return;
}
var_dump(Geturl("https://i.instagram.com/api/v1/feed/reels_tray/"));
Upvotes: 0
Views: 1043
Reputation: 23
The URL endpoint was wrong, the working URL is:
var_dump(Geturl("http://i.instagram.com/api/v1/feed/user/user-id/reel_media/"));
Upvotes: 1