1080x1080 photos via Instagram API

后端 未结 10 1105
长情又很酷
长情又很酷 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:34

    Not sure why you are getting down-voted, but no, that resolution is not returned by the API at the moment. However, it can be "guessed" from the other resolutions returned by the API, but that could change at any time. For example, given the standard resolution JSON:

      "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
      }
    

    Remove the size part (s640x640 here) and the two paths that follows (e35/sh0.08 for this picture, likely different for yours) to end up with the URL to the 1080x1080:

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

    This has worked since that resolution was activated on my account. But again, I would just wait for the API.

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

    The problem with instagram image URL's is that the URL signatures provided in the json responses expire after some time. My workaround for this problem is as follows:

    Steps: 1. Get the instagram post link. Eg : https://www.instagram.com/p/Bo-Jru-g7Wa/

    or if you don't have the link, the instagram api provides you with a permalink(image-code) option in the result array which for the above link is Bo-Jru-g7Wa

    1. Now just add media?size=l after the url ie.,

    Result: High quality image url:

    https://www.instagram.com/p/Bo-Jru-g7Wa/media?size=l

    you can see it in action here: https://jsfiddle.net/nmj1z7wo/fiddle URL

    This link can be considered as a shorthand code to instagram image URL's which are very much bigger. Supported values for size are t (thumbnail), m (medium), l (large). Defaults to m.

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

    As of 26th March 2018, Instagram changed their links. Here's a working solution to get 1080x1080 resolution images from API.

    1. Get the user_Id from https://www.instagram.com/{username}/?__a=1.

    2. Paste the user_id in this link https://i.instagram.com/api/v1/users/{user_id}/info/.

    3. Get the hd url link from hd_profile_pic_url_info. :)

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

    You can simply fetch 1080p image if available by using this url:

    https://www.instagram.com/p/['IMAGE-CODE']/?__a=1
    

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

    This worked for me today (15 August 2018) for most public images. I think, because people use different apps to upload images, the API may show different sizes but the links are to the same default resolution file.

    1. Go to the user's page: https://www.instagram.com/username
    2. Click on the image you want and the URL bar will change to: https://www.instagram.com/p/image-code/?taken-by=username
    3. Copy the image-code from the URL
    4. Go to: https://www.instagram.com/p/image-code/?__a=1
    5. Scan through the JSON file (it helps to have a JSON viewer extension enabled) and click on the highest resolution image to download it. For example:

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

    This works as of 20th March 2018.

    Remove the vp and the size parts. So if we have a 150x150 image here

    https://scontent.cdninstagram.com/vp/6f28b299faab04675a936073c94d0fde/5B2E3498/t51.2885-15/s150x150/e35/c135.0.810.810/28152308_875888592619569_7505395194448052224_n.jpg
    

    Remove /vp and /s150x150 to get

    https://scontent.cdninstagram.com/6f28b299faab04675a936073c94d0fde/5B2E3498/t51.2885-15/e35/c135.0.810.810/28152308_875888592619569_7505395194448052224_n.jpg
    

    And we can get the 1080 image here

    You can even just leave the last two segments

    https://scontent.cdninstagram.com/e35/28152308_875888592619569_7505395194448052224_n.jpg
    

    which can be seen here

    Hope this helps

    0 讨论(0)
提交回复
热议问题