Skip to content

getUserProfilePhotos

Sahri Riza Umami edited this page Jun 9, 2017 · 4 revisions

Returns profile photos of the user.

getUserProfilePhotos(user_id, offset, limit)

Result of this query can't be invalidated, so it must be used with care.

Option Description
user_id User identifier.
offset Photos to skip, must be non-negative.
limit Maximum number of photos to be returned, can't be greater than 100.

Example

  • Get 194211431 profiles photo. Because a user can have alots of photos, we limit the results to 3.

    getUserProfilePhotos(194211431, 0, 3)

    Response:

    {
      ID = "UserProfilePhotos",
      photos_ = {
        [0] = {
          ID = "Photo",
          has_stickers_ = false,
          id_ = "834131745110599771",
          sizes_ = {
            {
              ID = "PhotoSize",
              height_ = 320,
              photo_ = {
                ID = "File",
                id_ = 1154,
                path_ = false,
                persistent_id_ = "AgADBQADW6gxG2dukwvIkSnv53-n0BVQyjIABBXbjQXNMkF71HkDAAEC",
                size_ = 39168
              },
              type_ = "b",
              width_ = 320
            },
            {
              ID = "PhotoSize",
              height_ = 640,
              photo_ = {
                ID = "File",
                id_ = 1155,
                path_ = false,
                persistent_id_ = "AgADBQADW6gxG2dukwvIkSnv53-n0BVQyjIABC8HS8ezO2hr1XkDAAEC",
                size_ = 114986
              },
              type_ = "c",
              width_ = 640
            },
            [0] = {
              ID = "PhotoSize",
              height_ = 160,
              photo_ = {
                ID = "File",
                id_ = 1153,
                path_ = false,
                persistent_id_ = "AgADBQADW6gxG2dukwvIkSnv53-n0BVQyjIABAt-RZr5h2xE03kDAAEC",
                size_ = 12180
              },
              type_ = "a",
              width_ = 160
            }
          }
        }
      },
      total_count_ = 1
    }

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally