how do I get the profile picture of an instagram profile in full-res? (The old URL scheme stopped working today).
regex='profile_pic_url_hd":"([0-9a-zA-Z._-/:]*)",'
Is working for 320px pictures, but nothing else. The prefix to the 150x150 img is different, but the ID/ending of the url with jpg is the same.
Thanks
Go to Instagram's website on your mobile or PC browser (any browser will work), and then log in with your credentials. As you can't click on a picture directly from your feed, visit the user's profile, and then open the photo that you want to see. Hit Enter, and you'll see the picture in full size.
Instagram profile picture size: 320 x 320 pixels Instagram profile photos are displayed at 110 x 100 pixels, but the image files are stored at 320 x 320 pixels, so make sure to upload an image that's least that big. Even though the dimensions are in a square format, Instagram profile photos are displayed as a circle.
Okay guys I found a final solution:
Get the user_id of the account using this link https://www.instagram.com/{name}/?__a=1
Visit this JSON-API with the user_id above https://i.instagram.com/api/v1/users/{user_id}/info/ The full size profile picture link can be found in [hd_profile_pic_url_info][url]
Thats it! :)
[EDIT]
If step 1 doesn't work, my Php solution to get the user-id:
$name = "{username}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.instagram.com/$name/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if($http=="200") {
$doc = new DOMDocument();
$doc->loadHTML($result);
$xpath = new DOMXPath($doc);
$js = $xpath->query('//body/script[@type="text/javascript"]')->item(0)->nodeValue;
$start = strpos($js, '{');
$end = strrpos($js, ';');
$json = substr($js, $start, $end - $start);
$data = json_decode($json, true);
$user_id = $data["entry_data"]["ProfilePage"][0]["graphql"]["user"]["id"];
}
I'm searching in the HTML document for user-id.
If you view the source html and run a simple find text search for logging_page_id
, it will have profilePage_
, then a number. That number is the user id.
e.g.:
logging_page_id":"profilePage_123456789
The user id is: 123456789
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With