Facebook how to get actual photo URL using Graph API?

后端 未结 5 958
囚心锁ツ
囚心锁ツ 2021-02-05 11:44

It is possible to get the actual image url of a Facebook image using the Graph api??

For instance, for the below photo http://www.facebook.com/photo.php?fbid=3577553076

5条回答
  •  面向向阳花
    2021-02-05 12:17

    Is there some graph api way to achieving this?

    Therefore, you’d have to look at the source field of the photo object:

    source:

    The source image of the photo - currently this can have a maximum width or height of 720px, increasing to 960px on 1st March 2012

    string representing a valid URL

    That’ll give you the original size the photo was uploaded for smaller images, or resized to max. 960px in each direction.

    For even larger sizes, you’d have to check the images field:

    images:

    The 4 different stored representations of the photo

    array of objects, containing height, width, and source fields

    This “promises” to deliver much larger sizes (f.e. 2048×1417px) – but be aware, these entries will still deliver a smaller image if the original one wasn’t as large as requested.

提交回复
热议问题