Extract post metadata
Scrape post metadata
Input a Facebook post URL to collect detailed metadata, including engagement metrics, captions, comments and media information.
Base URL
POST https://facebook-scraper-api.datashake.com/v1/scrape
Request payload
callback_url
Field type: string
Required: true
Description: A URL to receive API results via a JSON POST request.
url
Field type: string
Required: true
Description: URL of the Facebook post to scrape.
get_comments
Field type: boolean
Required: false
Description: Set this to true
to collect comments. Retrieve them using the comments endpoint after request completion.
external_identifier
Field type: string
Required: false
Description: A custom identifier for tracking your request. This value will be included in the callback payload.
Code example
curl --location 'https://facebook-scraper-api.datashake.com/v1/scrape' --header 'x-api-key: your-api-key' --header 'Content-Type: application/json' --request POST --data '{"url": "https://www.facebook.com/humansofnewyork/posts/1217775029913484", "callback_url": "https://example.com/callback", "external_identifier": "my-custom-id", "get_comments": true}'
import requests
url = "https://facebook-scraper-api.datashake.com/v1/scrape"
payload = {
"url": "https://www.facebook.com/humansofnewyork/posts/1217775029913484",
"callback_url": "https://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true,
}
headers = {
"x-api-key": "your-api-key",
}
response = requests.post(url=url, headers=headers, json=payload)
Response and callback payload
API response example
{
"status": "created",
"message": "Your request was successfully submitted.",
"request_id": "1742515679047322765-7538bd54-2bd7-45"
}
Callback payload example
{
"request_id": "1742515679047322765-7538bd54-2bd7-45",
"status": "completed",
"credits_used": 130,
"request_metadata": {
"url": "https://www.facebook.com/humansofnewyork/posts/1217775029913484",
"callback_url": "http://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true
},
"results": [
{
"unique_id": null,
"post_id": "1217775029913484",
"text": "I crashed in college. I’d been this perfect student all through high school, but then I got dropped into this environment where there weren’t many Latinos. I’ve always been chubby-- and even though I don’t have it now, I usually have really curly hair. So I was super insecure. Then at the end of my freshman year, I lost my father and two of my grandparents. Three deaths in one semester. And I just crashed. I didn’t want to get up in the morning. Didn’t want to eat. Didn’t want to do anything. I don’t want to say I had no power; but I had no energy. Then one day I stumbled across this YouTube video about manifestation. It’s based on the law of assumption. If you assume you have something, then it will be yours: love, money, confidence, radiance. The first thing I did was assume some things about myself. I made a tape of the same affirmation. It was my own voice, and I just looped it all day long. All of the statements were ‘I’ statements: ‘I'm confident. I'm beautiful. I'm smart. I'm intelligent. I'm magnetic. I attract good people. I attract healthy love. I'm enough.’ That’s what I needed to believe more than anything: that I’m enough. That I deserve to be here, as in alive. I looped that tape all day long. I slept with it in my ears. And my life was completely changed in a matter of three weeks. I found this group: this amazing core group of people that till this day are my friends. And it was that group of people that changed my entire perception on life. If eighteen-year-old me could see the twenty-five-year-old me, she’d be amazed. I have my own place. I help my mother out. I help my little sister out. I have two cats. I have an amazing support system. That group of people changed my life. And of course, it was the manifestation that brought me the group that changed my life.",
"hashtags": [],
"url": "https://www.facebook.com/humansofnewyork/posts/1217775029913484",
"comments_count": 866,
"likes_count": 61142,
"view_count": null,
"share_count": 1077,
"upload_date": "2025-03-31T14:40:26.000Z",
"author": {
"profile_picture_url": null,
"name": "Humans of New York",
"url": null,
"id": "100050429952420"
},
"media": [
{
"type": "photo",
"thumbnail_url": "https://scontent.fric1-2.fna.fbcdn.net/v/t39.30808-6/487118421_1217774936580160_7849404820025704157_n.jpg?stp=dst-jpg_p180x540_tt6&_nc_cat=103&ccb=1-7&_nc_sid=127cfc&_nc_ohc=Iy19pbdlFnkQ7kNvgGtGN4o&_nc_oc=AdnbczBaxLnMsiGmwWyJ0vr1Qu4arZJE_nWlwhsxmpA-nMcaR5p6SQ_KGqcdIlN6Zco&_nc_zt=23&_nc_ht=scontent.fric1-2.fna&_nc_gid=7IyzfOJI6OTHxyU7jvkx6Q&oh=00_AYFlBKmw3Z4Yp5IPX2bZEOgquxGgOki33aLl0mm8ivARTQ&oe=67F2B737",
"url": "https://www.facebook.com/photo/?fbid=1217774933246827&set=a.755664696124522",
"id": "1340416587083699",
}
],
"created_at": "2025-03-21T00:08:07.793135Z",
"updated_at": "2025-03-21T00:08:07.793136Z",
},
...
],
"summary": null,
"pagination": null
}
Get scraping results
Use this endpoint to retrieve results in a synchronous manner.
Note that this endpoint is not intended for polling - make sure to check if your request has completed before calling it.
Base URL
GET https://facebook-scraper-api.datashake.com/v1/scrape/:request_id
Path parameters
request_id
Field type: string
Required: true
Description: The unique identifier for the request.
Code example
curl --location 'https://facebook-scraper-api.datashake.com/v1/scrape/1742517759478683074-2b1a61cf-89d0-4d' --header 'x-api-key: your-api-key'
import requests
url = "https://facebook-scraper-api.datashake.com/v1/scrape/1742517759478683074-2b1a61cf-89d0-4d"
headers = {
"x-api-key": "your-api-key",
}
response = requests.get(url=url, headers=headers)
Response
API response example
{
"request_id": "1742515679047322765-7538bd54-2bd7-45",
"status": "completed",
"credits_used": 130,
"request_metadata": {
"url": "https://www.facebook.com/humansofnewyork/posts/1217775029913484",
"callback_url": "http://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true
},
"results": [
{
"unique_id": null,
"post_id": "1217775029913484",
"text": "I crashed in college. I’d been this perfect student all through high school, but then I got dropped into this environment where there weren’t many Latinos. I’ve always been chubby-- and even though I don’t have it now, I usually have really curly hair. So I was super insecure. Then at the end of my freshman year, I lost my father and two of my grandparents. Three deaths in one semester. And I just crashed. I didn’t want to get up in the morning. Didn’t want to eat. Didn’t want to do anything. I don’t want to say I had no power; but I had no energy. Then one day I stumbled across this YouTube video about manifestation. It’s based on the law of assumption. If you assume you have something, then it will be yours: love, money, confidence, radiance. The first thing I did was assume some things about myself. I made a tape of the same affirmation. It was my own voice, and I just looped it all day long. All of the statements were ‘I’ statements: ‘I'm confident. I'm beautiful. I'm smart. I'm intelligent. I'm magnetic. I attract good people. I attract healthy love. I'm enough.’ That’s what I needed to believe more than anything: that I’m enough. That I deserve to be here, as in alive. I looped that tape all day long. I slept with it in my ears. And my life was completely changed in a matter of three weeks. I found this group: this amazing core group of people that till this day are my friends. And it was that group of people that changed my entire perception on life. If eighteen-year-old me could see the twenty-five-year-old me, she’d be amazed. I have my own place. I help my mother out. I help my little sister out. I have two cats. I have an amazing support system. That group of people changed my life. And of course, it was the manifestation that brought me the group that changed my life.",
"hashtags": [],
"url": "https://www.facebook.com/humansofnewyork/posts/1217775029913484",
"comments_count": 866,
"likes_count": 61142,
"view_count": null,
"share_count": 1077,
"upload_date": "2025-03-31T14:40:26.000Z",
"author": {
"profile_picture_url": null,
"name": "Humans of New York",
"url": null,
"id": "100050429952420"
},
"media": [
{
"type": "photo",
"thumbnail_url": "https://scontent.fric1-2.fna.fbcdn.net/v/t39.30808-6/487118421_1217774936580160_7849404820025704157_n.jpg?stp=dst-jpg_p180x540_tt6&_nc_cat=103&ccb=1-7&_nc_sid=127cfc&_nc_ohc=Iy19pbdlFnkQ7kNvgGtGN4o&_nc_oc=AdnbczBaxLnMsiGmwWyJ0vr1Qu4arZJE_nWlwhsxmpA-nMcaR5p6SQ_KGqcdIlN6Zco&_nc_zt=23&_nc_ht=scontent.fric1-2.fna&_nc_gid=7IyzfOJI6OTHxyU7jvkx6Q&oh=00_AYFlBKmw3Z4Yp5IPX2bZEOgquxGgOki33aLl0mm8ivARTQ&oe=67F2B737",
"url": "https://www.facebook.com/photo/?fbid=1217774933246827&set=a.755664696124522",
"id": "1340416587083699",
}
],
"created_at": "2025-03-21T00:08:07.793135Z",
"updated_at": "2025-03-21T00:08:07.793136Z",
},
...
],
"summary": null,
"pagination": null
}