Last active
October 22, 2023 15:09
-
-
Save hsleonis/36757e4da75516a60140c5b9a5b156ac to your computer and use it in GitHub Desktop.
Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to “Allow” the application)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Basic: (50x50 pixels) | |
| <img src="//graph.facebook.com/nusraatfariaofficial/picture"> | |
| Square: | |
| maximum width and height of 50 pixels. | |
| Small | |
| maximum width of 50 pixels and a maximum height of 150 pixels. | |
| Normal | |
| maximum width of 100 pixels and a maximum height of 300 pixels. | |
| Large | |
| maximum width of 200 pixels and a maximum height of 600 pixels. | |
| <img src="//graph.facebook.com/nusraatfariaofficial/picture?type=large"> | |
| You can specify the height and width: | |
| <img src="//graph.facebook.com/nusraatfariaofficial/picture?width=140&height=110"> | |
| It will return a JSON response if you're using one of the Facebook SDKs request methods. | |
| Otherwise it will return the image itself. | |
| * To always retrieve the JSON, add: | |
| &redirect=false | |
| Example: graph.facebook.com/nusraatfariaofficial/picture?type=large&redirect=false | |
| Response: | |
| { | |
| "data": { | |
| "is_silhouette": false, | |
| "url": "https://scontent.xx.fbcdn.net/hprofile-xpt1/v/t1.0-1/p200x200/12804615_1759832994236748_7994254082136289991_n.jpg?oh=247525e33c07520415207982fdd8cdfa&oe=578CF6EB" | |
| } | |
| } |
Please note that this DOESN'T WORK for users. It only works for PAGES, like the on you're using as the example.
If you want to get a user profile picture, you need his/her user ID and an access_token.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks