Facebook profile photos API
  1. Docs
  2. Facebook
  3. Facebook profile photos API

Facebook profile photos API

Photos from a page's Photos tab (type "image"): id, caption, image URL and size.

GET /v1/facebook/profile/photos

GET /v1/facebook/profile/photos

Photos from a page's Photos tab (type "image"): id, caption, image URL and size. The cursor carries both of ScrapeCreators' paging values (next_page_id and cursor).

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLyesProfile or page URL. Accepted hosts: facebook.com, fb.com, fb.watch.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/facebook/profile/photos" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "url=https://www.facebook.com/NASA" \4  --data-urlencode "cursor=eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRlciI6IkFRSFR4Tl81dXUtMGFtdDR5NzRYM0hQbGVncy1CSVI4X21MVUxRQnk3dFM3OXQtLWVBb2d1dnZXMGRhU0ZnMElXd1FZUHRUMHVVeHN5cWRmeVFXSktwM2ZudyIsInUiOiJodHRwczovL3d3dy5mYWNlYm9vay5jb20vTkFTQSJ9"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_d901d6509f944c63019eab32",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "facebook",14        "id": "1662377855257584",15        "url": "https://www.facebook.com/photo.php?fbid=1662377855257584&set=pb.100044561550831.-2207520000&type=3",16        "type": "image",17        "author": null,18        "title": null,19        "text": null,20        "published_at": null,21        "duration_seconds": null,22        "language": null,23        "hashtags": null,24        "mentions": null,25        "stats": {26          "views": null,27          "likes": null,28          "comments": null,29          "shares": null,30          "saves": null,31          "dislikes": null32        },33        "media": {34          "thumbnail_url": "https://scontent-ord5-2.xx.fbcdn.net/v/t39.99422-6/859947285_1150825193952429_7405308645209914641_n.png?stp=c228.0.1145.1145a_dst-jpg_tt6&cstp=mx1145x1145&ctp=s206x206&_nc_cat=104&ccb=1-7&_nc_sid=714c7a&_nc_ohc=upapdFU9i_EQ7kNvwHSJyVu&_nc_o...",35          "video_url": null,36          "audio_url": null,37          "image_urls": [38            "https://scontent-ord5-2.xx.fbcdn.net/v/t39.99422-6/859947285_1150825193952429_7405308645209914641_n.png?stp=c228.0.1145.1145a_dst-jpg_tt6&cstp=mx1145x1145&ctp=s206x206&_nc_cat=104&ccb=1-7&_nc_sid=714c7a&_nc_ohc=upapdFU9i_EQ7kNvwHSJyVu&_nc_o..."39          ],40          "width": 1600,41          "height": 114542        },43        "song": null,44        "location": null,45        "is_pinned": null,46        "is_sponsored": null,47        "extra": {48          "accessibility_caption": "Secretary Marco Rubio and Uzbekistan Foreign Minister Bakhtiyor Saidov smile at the camera against a background of American and Uzbekistan flags. They are both wearing suits and ties. They appear to be shaking hands while also holding up a...",49          "node_id": "YXBwX2l0ZW06MTAwMDQ0NTYxNTUwODMxOjIzMDUyNzI3MzI6NTo6MTY2MjM3Nzg1NTI1NzU4NA==",50          "source": "logged_out_public_view"51        }52      },53      {54        "object": "post",55        "platform": "facebook",56        "id": "1658876725607697",57        "url": "https://www.facebook.com/photo.php?fbid=1658876725607697&set=pb.100044561550831.-2207520000&type=3",58        "type": "image",59        "author": null,60        "title": null,61        "text": null,62        "published_at": null,63        "duration_seconds": null,64        "language": null,65        "hashtags": null,66        "mentions": null,67        "stats": {68          "views": null,69          "likes": null,70          "comments": null,71          "shares": null,72          "saves": null,73          "dislikes": null74        },75        "media": {76          "thumbnail_url": "https://scontent-ord5-1.xx.fbcdn.net/v/t39.99422-6/855339932_1777262476839819_3793054615548579050_n.png?stp=c0.119.1086.1086a_dst-jpg_tt6&cstp=mx1086x1086&ctp=s206x206&_nc_cat=106&ccb=1-7&_nc_sid=714c7a&_nc_ohc=3G0SXarMeMQQ7kNvwEcDfez&_nc_o...",77          "video_url": null,78          "audio_url": null,79          "image_urls": [80            "https://scontent-ord5-1.xx.fbcdn.net/v/t39.99422-6/855339932_1777262476839819_3793054615548579050_n.png?stp=c0.119.1086.1086a_dst-jpg_tt6&cstp=mx1086x1086&ctp=s206x206&_nc_cat=106&ccb=1-7&_nc_sid=714c7a&_nc_ohc=3G0SXarMeMQQ7kNvwEcDfez&_nc_o..."81          ],82          "width": 1086,83          "height": 144884        },85        "song": null,86        "location": null,87        "is_pinned": null,88        "is_sponsored": null,89        "extra": {90          "accessibility_caption": "The exhaust plumes from a SpaceX Falcon rocket are lit up by the Sun, creating a shape that looks like a jellyfish. The plumes are blue and red. There is a fuzzy, faint form below that would make the jellyfish's \"legs\".",91          "node_id": "YXBwX2l0ZW06MTAwMDQ0NTYxNTUwODMxOjIzMDUyNzI3MzI6NTo6MTY1ODg3NjcyNTYwNzY5Nw==",92          "source": "logged_out_public_view"93        }94      }95    ],96    "cursor": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRl...",97    "has_more": true,98    "parent": null99  },100  "cursor": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRl...",101  "has_more": true102}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.