Get photo/thumbnail of a "link post" - Graph API Facebook

1.3k views Asked by At

I'm using Facebook Graph API to get posts on a public page. For every post, I get the following:

{
    "message": "XXXXX",
    "id": "104076318XXXX",
    "created_time": "2017-01-11TXXXX",
    "link": "http://bit.lXXXXX",
    "type": "link",
    "name": "XXXX",
    "permalink_url": "https://www.facebook.comXXX",
    "full_picture": "https://external.xx.fbcdn.net/safe_image.php?d=XXXX",
    "picture": "https://external.xx.fbcdn.net/safe_image.php?d=AQBXXXX"
}

The picture and full_picture URLs return a 1x1 px image. Is it normal? If so, how could I get the thumbnail picture generated by Facebook?

PS: I am using version 2.8 of Graph API

1

There are 1 answers

0
Phuc Nguyen On

50x50 pixels

<img src="https://graph.facebook.com/{{fid}}/picture">

200 pixels width

<img src="https://graph.facebook.com/{{fid}}/picture?type=large">

Type picture

  1. Square: maximum width and height of 50 pixels.
  2. Small : maximum width of 50 pixels and a maximum height of 150 pixels.
  3. Normal: maximum width of 100 pixels and a maximum height of 300 pixels.
  4. Large: maximum width of 200 pixels and a maximum height of 600 pixels.

Or you can use html code

<img src="https://graph.facebook.com/{{fid}}/picture?width=140&height=110">

Examples

https://graph.facebook.com/351843608490742/picture?width=300&height=300

You can see more on Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to "Allow" the application)