100 free credits. No credit card required. Get a key

Facebook post API

One public Facebook post by URL (post, video, reel, photo): message, author, published time, attachments, reaction, comment, share and view counts, and the top comments.

GET /v1/facebook/postsBeta2 credits per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/facebook/posts?url=https%3A%2F%2Fwww.facebook.com%2Fzuck%2Fposts%2Fpfbid0Cj47VyownRywjfYupyWgyDKSmv3bFUDRWLpwjDzPZdF2mFfRMTWkyMS3vVRo5reyl",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 2 credits
{
"post_id": "10118155444854771",
"id": "UzpfSTQ6MTAxMTgxNTU0NDQ4NTQ3NzE6MTAxMTgxNTU0NDQ4NTQ3NzE=",
"feedback_id": "ZmVlZGJhY2s6cGZiaWQwQ2o0N1Z5b3duUnl3amZZdXB5V2d5REtTbXYzYkZVRFJXTHB3akR6UFpkRjJtRmZSTVRXa3lNUzN2VlJvNXJleWw=",
"url": "https://www.facebook.com/zuck/posts/pfbid0Cj47VyownRywjfYupyWgyDKSmv3bFUDRWLpwjDzPZdF2mFfRMTWkyMS3vVRo5reyl",
"creation_time": 1793554070,
"message": "Tried to get the family to dress as burger night, but couldn't corral the littlest burger",
"author": {
"id": "4",
"name": "Mark Zuckerberg",
"url": "https://www.facebook.com/zuck"
},
"attachments": [
{
"media": {
"__typename": "Photo",
"__isNode": "Photo",
"id": "10118155440653191"
},
"styles": {
"__typename": "StoryAttachmentAlbumStyleRenderer",
"__isStoryAttachmentStyleRendererUnion": "StoryAttachmentAlbumStyleRenderer",
"is_prod_eligible": true,
"attachment": {
"mediaset_token": "pcb.10118155444854771",
"url": "https://www.facebook.com/zuck/posts/pfbid0Cj47VyownRywjfYupyWgyDKSmv3bFUDRWLpwjDzPZdF2mFfRMTWkyMS3vVRo5reyl",
"all_subattachments": {
"count": 3,
"nodes": [
"…"
]
},
"comet_product_tag_feed_overlay_renderer": null
},
"__module_operation_CometFeedStoryAttachmentMatchRenderer_attachment": {
"__dr": "CometFeedStoryAlbumAttachmentStyle_styleTypeRenderer$normalization.graphql"
},
"__module_component_CometFeedStoryAttachmentMatchRenderer_attachment": {
"__dr": "CometFeedStoryAlbumAttachmentStyle.react"
}
}
}
],
"reaction_count": 228529,
"comment_count": 28701,
"share_count": 6825,
"video_view_count": null,
"top_comments": [
{
"id": "Y29tbWVudDoxMDExODE1NTQ0NDg1NDc3MV8xMTk4OTc5MTI5NTMwNzE0",
"text": "What does a human burger taste like? 😉",
"created_time": 1793558085,
"author": {
"id": "pfbid021StH2n3mR7TLVbLXnWPjqVdsugKkZsoiqacTjoP7PmA5oafkXG2BPXBHyTgfGsZsl",
"name": "Hassan Hafez",
"url": null
}
},
{
"id": "Y29tbWVudDoxMDExODE1NTQ0NDg1NDc3MV8xMDU4MTYwMTkwNTk0NTEy",
"text": "You all could have done the characters from Burger Time 😄",
"created_time": 1793560720,
"author": {
"id": "pfbid02iz4RhdW3FTRS4LgtRhPWYWpXqYx1dEuVKVc7AvVMtxSMyrDhgoNfbig8UqMLU4J8l",
"name": "Teri Mut",
"url": null
}
},
"… 8 more"
]
}

Parameters

NameTypeDescription
urlquery · requiredstringThe post URL. Example: https://www.facebook.com/zuck/posts/pfbid0Cj47VyownRywjfYupyWgyDKSmv3bFUDRWLpwjDzPZdF2mFfRMTWkyMS3vVRo5reyl.
Response fields

200 with a FacebookPost, in Facebook’s own JSON.

FieldTypeDescription
post_idstring
idstring | nullFacebook’s opaque node id for the story.
feedback_idstring | nullPass to facebook_post_comments to page through every comment.
urlstring
creation_timeinteger | nullPublished, Unix seconds (UTC).
messagestring | null
authorobject | null
attachmentsobject[]Facebook’s attachments: photos, the video (with media.id), links.
reaction_countinteger | null
comment_countinteger | null
share_countinteger | null
video_view_countinteger | null
top_commentsobject[]The few top comments a logged-out visitor sees.
Status codes
StatusMeaning
200The post.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The ad, Page or advertiser is not in the Meta Ad Library.
429Too many requests. Wait for Retry-After seconds.
503Facebook is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Facebook is a trademark of Meta Platforms, Inc. We are not affiliated with or endorsed by Meta.