Facebook profile photos
Beta 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
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
url | URL | yes | Profile or page URL. Accepted hosts: facebook.com, fb.com, fb.watch. |
Every request also accepts:
cursor: the cursor from the previous page (Pagination).trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.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).
curl
curl -G "https://api.socialscrape.io/v1/facebook/profile/photos" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "url=https://www.facebook.com/NASA" \
--data-urlencode "cursor=eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRlciI6IkFRSFR4Tl81dXUtMGFtdDR5NzRYM0hQbGVncy1CSVI4X21MVUxRQnk3dFM3OXQtLWVBb2d1dnZXMGRhU0ZnMElXd1FZUHRUMHVVeHN5cWRmeVFXSktwM2ZudyIsInUiOiJodHRwczovL3d3dy5mYWNlYm9vay5jb20vTkFTQSJ9"Python
import os
import requests
params = {
"url": "https://www.facebook.com/NASA",
"cursor": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRlciI6IkFRSFR4Tl81dXUtMGFtdDR5NzRYM0hQbGVncy1CSVI4X21MVUxRQnk3dFM3OXQtLWVBb2d1dnZXMGRhU0ZnMElXd1FZUHRUMHVVeHN5cWRmeVFXSktwM2ZudyIsInUiOiJodHRwczovL3d3dy5mYWNlYm9vay5jb20vTkFTQSJ9",
}
res = requests.get(
"https://api.socialscrape.io/v1/facebook/profile/photos",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])TypeScript
const url = new URL("https://api.socialscrape.io/v1/facebook/profile/photos");
url.search = new URLSearchParams({
"url": "https://www.facebook.com/NASA",
"cursor": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRlciI6IkFRSFR4Tl81dXUtMGFtdDR5NzRYM0hQbGVncy1CSVI4X21MVUxRQnk3dFM3OXQtLWVBb2d1dnZXMGRhU0ZnMElXd1FZUHRUMHVVeHN5cWRmeVFXSktwM2ZudyIsInUiOiJodHRwczovL3d3dy5mYWNlYm9vay5jb20vTkFTQSJ9"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}n8n
{
"nodes": [
{
"name": "SocialScrape Facebook profile photos",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/facebook/profile/photos",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "url",
"value": "https://www.facebook.com/NASA"
},
{
"name": "cursor",
"value": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRlciI6IkFRSFR4Tl81dXUtMGFtdDR5NzRYM0hQbGVncy1CSVI4X21MVUxRQnk3dFM3OXQtLWVBb2d1dnZXMGRhU0ZnMElXd1FZUHRUMHVVeHN5cWRmeVFXSktwM2ZudyIsInUiOiJodHRwczovL3d3dy5mYWNlYm9vay5jb20vTkFTQSJ9"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_d901d6509f944c63019eab32",
"data": {
"object": "list",
"items": [
{
"object": "post",
"platform": "facebook",
"id": "1662377855257584",
"url": "https://www.facebook.com/photo.php?fbid=1662377855257584&set=pb.100044561550831.-2207520000&type=3",
"type": "image",
"author": null,
"title": null,
"text": null,
"published_at": null,
"duration_seconds": null,
"language": null,
"hashtags": null,
"mentions": null,
"stats": {
"views": null,
"likes": null,
"comments": null,
"shares": null,
"saves": null,
"dislikes": null
},
"media": {
"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...",
"video_url": null,
"audio_url": null,
"image_urls": [
"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..."
],
"width": 1600,
"height": 1145
},
"song": null,
"location": null,
"is_pinned": null,
"is_sponsored": null,
"extra": {
"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...",
"node_id": "YXBwX2l0ZW06MTAwMDQ0NTYxNTUwODMxOjIzMDUyNzI3MzI6NTo6MTY2MjM3Nzg1NTI1NzU4NA==",
"source": "logged_out_public_view"
}
},
{
"object": "post",
"platform": "facebook",
"id": "1658876725607697",
"url": "https://www.facebook.com/photo.php?fbid=1658876725607697&set=pb.100044561550831.-2207520000&type=3",
"type": "image",
"author": null,
"title": null,
"text": null,
"published_at": null,
"duration_seconds": null,
"language": null,
"hashtags": null,
"mentions": null,
"stats": {
"views": null,
"likes": null,
"comments": null,
"shares": null,
"saves": null,
"dislikes": null
},
"media": {
"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...",
"video_url": null,
"audio_url": null,
"image_urls": [
"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..."
],
"width": 1086,
"height": 1448
},
"song": null,
"location": null,
"is_pinned": null,
"is_sponsored": null,
"extra": {
"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\".",
"node_id": "YXBwX2l0ZW06MTAwMDQ0NTYxNTUwODMxOjIzMDUyNzI3MzI6NTo6MTY1ODg3NjcyNTYwNzY5Nw==",
"source": "logged_out_public_view"
}
}
],
"cursor": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRl...",
"has_more": true,
"parent": null
},
"cursor": "eyJrIjoicGhvdG9zIiwiY29sIjoiWVhCd1gyTnZiR3hsWTNScGIyNDZjR1ppYVdRd00yNUtURUo0ZGs1U01WZzVTRTVFUkZseFp6aERNamN5UVdKWmRFcHJlbUpuZW5OMFEzbE9hR1pFVldOR05rNUtlRTQwVFdoSFIyNWpkRmszV1dsNE5VUmFiMFJRV1RoclJIbFdibEZpVEcxaE9UVm5jVGRTUms0NFRtUnMiLCJhZnRl...",
"has_more": true
}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.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
unsupported_url | 400 | no | The URL is not one this endpoint accepts (wrong platform or form). |
not_found | 404 | no | The 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.
Related endpoints#
- Facebook Ad Library search (
GET /v1/facebook/ad-library/search) - Facebook Ad Library search (POST body) (
POST /v1/facebook/ad-library/search) - Facebook Ad Library ads by page (
GET /v1/facebook/ad-library/company/ads) - Facebook Ad Library ads by page (POST body) (
POST /v1/facebook/ad-library/company/ads) - Facebook Ad Library ad details (
GET /v1/facebook/ad-library/ad) - Facebook Ad Library ad transcript (
GET /v1/facebook/ad-library/ad/transcript) - Facebook Ad Library advertiser search (
GET /v1/facebook/ad-library/search/companies) - Facebook profile or page (
GET /v1/facebook/profile)