Facebook Graph high resolution photos

前端 未结 7 2516
余生分开走
余生分开走 2021-02-15 09:18

I\'m doing a Facebook Graph API call for \"me/home\" to get the user\'s news feed. As everyone knows, the URL you get in the \"picture\" field is a low resolution photo that doe

7条回答
  •  逝去的感伤
    2021-02-15 09:43

    The graph api returns response which includes images and webp_images and it has image links in all available resolutions.

    As per the latest version: v2.12

    For profile photo:

    /me?fields=photos{picture,images,webp_images}
    

    For specific album:

    'album-id'?fields=photos{picture,images,webp_images}
    

    Field details:

    photos: array of available photos, this will return json like below:

    {
        data: [],
        pagin: []
    }
    

    In data object we'll get below fields:

    picture: link for a low resolution image might be for the use of thumbnails

    images: array of objects for picture image with the different different resolutions in raster format

    webp_images: array of objects for picture image with the different different resolutions in webp format

    images and web_images object will have data like:

    {
        height: number, // 400
        source: 'link for the image with the resolution of height and width specified', //https:....
        width: number //496
    }
    

提交回复
热议问题