Facebook how to get actual photo URL using Graph API?

后端 未结 5 865
囚心锁ツ
囚心锁ツ 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:13

    There seems to be lack of documentation for this. It can simple be achieved in this way. In that url http://www.facebook.com/photo.php?fbid=357755307655174 , take out the id of the pic represented by fbid.In the above case it is 357755307655174. Now do a graph api query, to this object https://graph.facebook.com/357755307655174 . This will return a JSON with all the aspect ratio's present in their database and their actual URL's. Each data field following the format

    {
          "height": 1080, 
          "source": "https://scontent-a.xx.fbcdn.net/hphotos-xpf1/t31.0-8/10296099_566697856780203_6555830953677139074_o.jpg", 
          "width": 1980
    }
    

    Use the Graph Explorer to check once again the format of returned JSON data.The source is what you are looking for.

提交回复
热议问题