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 failureimport 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
| Name | Type | Description |
|---|---|---|
urlquery · required | string | The post URL. Example: https://www.facebook.com/zuck/posts/pfbid0Cj47VyownRywjfYupyWgyDKSmv3bFUDRWLpwjDzPZdF2mFfRMTWkyMS3vVRo5reyl. |
Response fields
200 with a FacebookPost, in Facebook’s own JSON.
| Field | Type | Description |
|---|---|---|
post_id | string | |
id | string | null | Facebook’s opaque node id for the story. |
feedback_id | string | null | Pass to facebook_post_comments to page through every comment. |
url | string | |
creation_time | integer | null | Published, Unix seconds (UTC). |
message | string | null | |
author | object | null | |
attachments | object[] | Facebook’s attachments: photos, the video (with media.id), links. |
reaction_count | integer | null | |
comment_count | integer | null | |
share_count | integer | null | |
video_view_count | integer | null | |
top_comments | object[] | The few top comments a logged-out visitor sees. |
Status codes
| Status | Meaning |
|---|---|
200 | The post. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The ad, Page or advertiser is not in the Meta Ad Library. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Facebook 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.