How to Get Facebook User’s Profile Picture Using Facebook Graph API

The Facebook API can be used to retrieve a user’s profile picture in different sizes without the need of an access token by sending a GET request to the following url.

Add the optional width and height fields as URL parameters:


USER_ID is the user id number

WIDTH and HEIGHT are your requested dimension values.

This will return a profile picture with a minimum size of WIDTH x HEIGHT while trying to preserve the aspect ratio. For example,


   "data": {
     "url": "",
     "width": 140,
     "height": 110,
     "is_silhouette": false

To get a user profile picture of a specific size, call

where SIZE should be replaced with one of the defined values square, small, normal or large depending on the size you want.

This call will redirect you to a single image with its size based on your chosen type parameter.

For example:

returns a URL to a small version of the image.

The API only specifies the maximum size for profile images, not the actual size.


maximum width and height of 50 pixels.


maximum width of 50 pixels and a maximum height of 150 pixels.


maximum width of 100 pixels and a maximum height of 300 pixels.


maximum width of 200 pixels and a maximum height of 600 pixels.

If you call the default USER_ID/picture you get the square type.


If you call (as per above example)

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 object so you can parse the response based on your needs, add:


like so:

To return just the url of the image, I used the following CURL request in PHP.

function getProfilePic( $userId ) {
  $curl = curl_init();
  $url = "". $userId ."/picture?width=100&height=100&redirect=false";
  curl_setopt_array($curl, array(
    CURLOPT_URL => $url,

  $response = curl_exec($curl);


  $image = json_decode($response, true);

  if ($image['data']['url']) {
    return $image['data']['url'];
  } else {
    return '';


This guide has been modified which originally appears in Stackoverflow.

Cromwell Bayon

He is a self-tutored programmer and a Full-Stack Developer. He strives to excel in the newest technology as possible. He has a very high sense of technicality and analytical skills which allows him to resolve any kind of issues related to technology. He also loves woodworking. Read more about him here...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.