1080x1080 photos via Instagram API

后端 未结 10 1106
长情又很酷
长情又很酷 2020-12-08 05:11

http://www.theverge.com/2015/7/6/8899807/instagram-1080p-pictures-photo-upload

The Verge recently made known the latest app versions of Instagram are uploading photo

相关标签:
10条回答
  • 2020-12-08 05:49

    I noticed that simply removing the size part, the biggest image is returned:

    https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s640x640/e35/sh0.08/11370971_837216559694773_771634899_n.jpg

    to

    https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/e35/sh0.08/11370971_837216559694773_771634899_n.jpg

    Hence this should do the trick:

    var hightUrl = data.images.standard_resolution.url.replace("/s640x640/","/");
    
    0 讨论(0)
  • 2020-12-08 05:49

    I'm unsure whether it's possible to get a 1080p resolution image. But here is one way to get an image with 320x320 resolution.

    1) Enter the username of the user in the following URL. Here I'm using simonsterstrength as username. https://www.instagram.com/simonsterstrength/?__a=1

    2) Search for "profile_pic_url_hd" and copy the URL and access the picture that IG calls it as HD.


    Note: As of June-2020, the response from IG CDN is OK.

    0 讨论(0)
  • 2020-12-08 05:51

    You received

    "standard_resolution": {
        "url": "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s640x640/e35/sh0.08/11370971_837216559694773_771634899_n.jpg",
        "width": 640,
        "height": 640
      }
    

    It's possible to replace s640x640 with s1080x1080 or 2048x2048. Both this request return image with resolut 1080x1080

    var hightUrl = data.images.standard_resolution.url.replace("s640x640","s1080x1080");
    
    0 讨论(0)
  • 2020-12-08 05:52

    [Update] After Mar 23, 2018

    I used Ekrem Gurdal's answer to make it work:

    The IG API gives you "link" attribute, e.g. https://www.instagram.com/p/BTduOwSAwN6/

    Then you can append ?__a=1 to this e.g. https://www.instagram.com/p/BTduOwSAwN6/?__a=1

    And you can extract from the json result where the high resolution photo is stored: graphsql.shortcode_media.display_url

    E.g. https://instagram.fmnl2-1.fna.fbcdn.net/vp/f8f54b9fcb2bca69d7c73d9ffb232d64/5C324A1C/t51.2885-15/e35/18161146_397673830625587_2385146908864675840_n.jpg

    Hope this helps. Maybe IG folks will also find a way to disable this in the future. Why do they not just include the hi-res photo in the API response, smh

    [Update] As of Mar 23, 2018, workaround below doesn't work anymore.

    Just to update anyone who's looking at this in 2018. The solution that worked for me is to remove the "vp/" on top of replacing the resolution to 1080x1080.

    E.g.

    https://scontent.cdninstagram.com/vp/41d5aee08758061976d26e48f45e673a/5ADA338E/t51.2885-15/s320x320/e35/20065394_1785212551507111_5192354829363576832_n.jpg
    

    to

    https://scontent.cdninstagram.com/41d5aee08758061976d26e48f45e673a/5ADA338E/t51.2885-15/s1080x1080/e35/20065394_1785212551507111_5192354829363576832_n.jpg
    
    0 讨论(0)
提交回复
热议问题