Reputation: 21
Dear fellow community!
Does anyone know how to get the photo files in original size from Instagram? They surely store original files in full size, since you can upload a photo via app to your IG profile, delete it from the phone, and it still syncs your IG with phone library to get this photo back in full resolution.
Their API supports fetching up to 1080x1080px, plus I found this method via Chrome developer tools: http://www.dailydot.com/debug/instagram-high-quality-photos-download-google-chrome/. Script that could do it doesn't seem reliable on large scale, so I'm still looking for a automated better solution.
Please share any experience that could help.
Upvotes: 2
Views: 17648
Reputation: 119
Try to change 640 to 1080 and remove sharpness like in my example:
str_replace(array("s640x640","sh0.08/"),array( "s1080x1080",""),$img['standard_resolution']['url']);
Upvotes: 1
Reputation: 11
Sorry to say, but the code on the pastebin will not work correctly for this purpose. Standard_resolution does not display the representation for original size of posted media.
$url = $datas->images->standard_resolution->url;
Will yield the following result, while the original image that was uploaded is 1080px wide. (Following is an example, not a working link)
"standard_resolution": {
"url": "https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/14613148_236279861425099_8741797152912868864_n.jpg?ig_cache_key=MTX3ODU5Mjg5NDY4NDEEN3E0CA%3D%3D.2",
"width": 640,
"height": 334
}
The trick is to replace the s640x640 part in the url, thus adding the next line in order to get the url of the picture as it was uploaded :
$url=str_replace("s640x640/","",$url);
Upvotes: 0
Reputation: 432
all photos on instagram have real image url (except profile picture image), you just need get access instagram api, decode json result then get real url image.
you can see my example code for search tag using instagram api : http://pastebin.com/fMu7w808
Upvotes: 0