Use this endpoint to get and publish to a Page. The Page Feed encompasses any interactions with a Facebook Page including: posts and links published by this Page, visitors to this Page, and public posts in which the Page has been tagged.
/{page-post-id}
endpoint allows you to update a specific Page post./{page-id}/tagged
endpoint to only retrieve public posts in which the Page has been tagged.The posts of a Facebook Page.
This API is supported for New Page Experience.
The person requesting the access token must be able to perform one of the following tasks on the Page:
And have granted the app the following permissions are required:
If you do not own or manage the Page, you will need:
GET /v21.0/{page-id}/feed HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{page-id}/feed',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/{page-id}/feed",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/feed",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/feed"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
{ "data": [ { "created_time": "2019-05-17T16:24:04+0000", "message": "Become a Facebook developer!", "id": "{page-id}_2191966997525824" }, { "created_time": "2019-02-26T21:35:42+0000", "message": "Hello world!", "id": "{page-id}_2072371269485398" }, ... { "created_time": "2018-01-26T20:57:22+0000", "message": "Friday Funday!", "id": "{page-id}_1569752556413941" } ], "paging": { "cursors": { "before": "Q2c4U1pXNT...", "after": "Q2c4U1pXNT..." }, "next": "https://graph.facebook.com/vX.X/{page-id}/feed?access_token={your-page-access-token}&pretty=0&limit=25&after=Q2c4U1pXNT..." } }
limit
field. If you try to read more than that you will get an error message to not exceed 100./{page-id}/tagged
to show the posts that tagged this Page, the results include posts from other Pages only if those Pages are authentic.Limitation: All posts (published and unpublished) will be pulled in the feed endpoint. The only difference is unpublished posts will not be listed in the physical feed. However, there is an is_published field that can be added to the /feed endpoint to let developers know whether the post listed in the /feed endpoint is published or not
Name | Type | Description | |
---|---|---|---|
id | string | The ID of the post. | |
actions | object | Action links on the post, Comment, Like, Share. | |
admin_creator | object | The admin creator of a Page post. If the Page has only one admin, no data is returned. Requires a Page Access Token and the | |
allowed_advertising_objects | string | The only objectives under which this post can be advertised. | |
application | object | Information about the app that published this post. | |
attachments | object | Any attachments that are associated with the story. See the story attachment node reference for | |
backdated_time | float | The backdated time for backdate post. For a regular post, this field is set to null. | |
call_to_action | object | The call to action type used in any Page posts for mobile app engagement ads. | |
can_reply_privately | boolean | Whether the Page viewer can send a private reply to this Post. Requires the | |
child_attachments | object | Sub-shares of a multi-link share post. | |
created_time | float | The time the post was initially published. For a post about a life event, this is the date and time of the life event. | |
feed_targeting | object | Object that controls Feed Targeting for this post. Anyone in these groups are more likely to see this post, others are less likely, but may still see it anyway. Any of the targeting fields shown here can be used, none are required (applies to Pages only). | |
from |
| The | |
full_picture | string | URL to a full-sized version of the Photo published in the Post or scraped from a link in the Post. If the photo's largest dimension exceeds 720 pixels, it is resized, with the largest dimension set to 720. | |
icon | string | A link to an icon representing the type of this post. | |
instagram_eligibility | enum{} | Whether the post can be promoted on Instagram. It returns the enum
| |
is_eligible_for_promotion | boolean | Indicates whether a post is eligible for promotion. | |
is_expired | boolean | Whether the post has an expiration time that has passed. | |
is_hidden | boolean | If this post is marked as hidden (Applies to Pages only). Hiding a post hides it in a Page's timeline however it is still visible in other places on Facebook, for example, a link. | |
is_instagram_eligible | string | Whether this post can be promoted in Instagram. | |
is_popular | boolean | Whether the post is popular. Based on whether the total actions as a percentage of reach exceeds a certain threshold. | |
is_published | boolean | Indicates whether a scheduled post was published (applies to scheduled Page Post only, for users post and instantly published posts this value is always | |
is_spherical | boolean | Whether the post is a spherical video post. | |
message | string | The status message in the post. | |
message_tags | array | An array of profiles tagged in the | |
parent_id | string | The ID of a parent post for this post, if it exists. For example, if this story is a 'Your Page was mentioned in a post' story, the | |
permalink_url | string | The permanent static URL to the post on www.facebook.com. Example: https://www.facebook.com/FacebookForDevelopers/posts/10153449196353553. | |
place | string | ID of the place associated with this post. | |
privacy | object | The privacy settings of the post. | |
promotable_id | string | ID of post to use for promotion for stories that cannot be promoted directly. | |
properties | object | A list of properties for any attached video, for example, the length of the video. | |
sheduled_publish_time | float | The UNIX timestamp of the scheduled publish time for the post. Date will be between 10 minutes and 75 days from the time of the | |
shares | object | The share count of this post. The share count may include deleted posts and posts you cannot see for privacy reasons. | |
status_type | enum{} | The type of a status update. Values include:
| |
story | string | Text of stories not intentionally generated by Users, such as those generated when a photo has been added. The "Include recent activity stories" migration must be enabled in your app to retrieve this field. | |
story_tags | array | The list of tags in the post description. | |
subscribed | boolean | Whether a User is subscribed to the post. | |
targeting | object | Object that limits the audience for this content. Only audiences in the specified demographics can view this content. The demographics are additive. Each additional value adds its audience to the cumulative targeted audience. These values do not override any Page-level demographic restrictions that may be in place. | |
to |
| Profiles mentioned or targeted in this post. If you read this field with a User access token, it returns only the current User. | |
updated_time | float | The time the post was last updated, which occurs when the post was created, edited, or a User comments on a post, expressed as a UNIX timestamp. | |
video_buying_eligibility | array | Whether the post can be promoted with different video buying options. It returns an empty list when video is eligible. Otherwise it returns a list of reasons why the post cannot be promoted. |
When finding posts that can be boosted, the promotable_id
must be used to create ads. In most cases, this id will be identical to the post_id
. However, this is not always the case. Note: once a post is boosted, you must have access to the connected ad account in order to edit the post.
curl -i -X GET \
"https://graph.facebook.com/{your-page-id}/feed
?fields=is_eligible_for_promotion,promotable_id
&access_token={your-page-access-token}"
{ "data": [ { "is_eligible_for_promotion": true, "promotable_id": "1353269864728879_1943344825721377", "id": "1353269864728879_1943344825721377" }, { "is_eligible_for_promotion": true, "promotable_id": "1353269864728879_1943313139057879", "id": "1353269864728879_1943378089051384" }, { "is_eligible_for_promotion": false, "promotable_id": "1353269864728879_1942095249179668", "id": "1353269864728879_1942095249179668" }, ...
Please visit our help center to learn why a post may not be boosted.
Please visit our Post Reference doc for all available post fields.
You can publish to Pages by using this edge. Either link
or message
must be supplied.
This API is supported for New Page Experience.
If you can perform the CREATE_CONTENT
task, you will need:
Posts will appear in the voice of the Page.
A Page access token requested by someone who can perform the
on the Page being queried
Note: If the viewer or app cannot see the url of link
, the post will fail.
POST /v21.0/{page-id}/feed HTTP/1.1
Host: graph.facebook.com
message=This+is+a+test+message
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/{page-id}/feed',
array (
'message' => 'This is a test message',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/{page-id}/feed",
"POST",
{
"message": "This is a test message"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("message", "This is a test message");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/feed",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"message": @"This is a test message",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/feed"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
{"id":"post-id"}
This endpoint supports read-after-write and can immediately return any fields returned by read operations.
Test in the Graph Explorer Tool using POST {page-id}/feed
:
Name | Type | Description |
---|---|---|
actions | array | The action links attached to the post. |
backdated_time | float | Specifies a time in the past to backdate this post to. |
backdated_time_granularity | enum{year, month, day, hour, minute} | Controls the display of how a backdated post appears. For example, if you pick |
child_attachments | object | Use to specify multiple links in the post. Minimum 2 and maximum of 5 objects. If you set multi_share_optimized to true, you can upload a maximum of 10 objects but Facebook will display the top 5. |
feed_targeting | object | Object that controls Feed Targeting for this content. Anyone in these groups will be more likely to see this content, those not will be less likely, but may still see it anyway. Any of the targeting fields shown here can be used, none are required. |
link | string | The URL of a link to attach to the post. Either |
message | string | The main body of the post. The message can contain mentions of Facebook Pages, |
multi_share_end_card | Boolean | If set to |
multi_share_optimized | Boolean | If set to |
object_attachment | string | Facebook ID for an existing picture in the person's photo albums to use as the thumbnail image. They must be the owner of the photo, and the photo cannot be part of a message attachment. |
place | string | Page ID of a location associated with this post. |
published | Boolean | Whether a story is shown about this newly published object. Default is |
scheduled_publish_time | timestamp | UNIX timestamp indicating when post should go live. Must be date between 10 minutes and 75 days from the time of the API request. |
tags | csv[string] | Comma-separated list of user IDs of people tagged in this post. You cannot specify this field without also specifying a |
targeting | object | Object that limits the audience for this content. Anyone not in these demographics will not be able to view this content. This will not override any Page-level demographic restrictions that may be in place. |
Add a feeling or activity and an icon to a page post. og_action_type_id
and og_object_id
are required when posting a feeling or activity. og_icon_id
is optional however if not used an icon will be automatically supplied based on the og_object_id
.
Name | Description |
---|---|
An action, i.e., feeling, watching, etc. | |
An icon perhaps representing the action type, i.e., a smiley face, a movie icon, etc. | |
The target of the action, i.e., happy, movie, etc. This can be a predefined object or any |
POST /v21.0/page-id/feed HTTP/1.1
Host: graph.facebook.com
message=This+is+a+test+activity&og_action_type_id=383634835006146&og_object_id=136050896551329&og_icon_id=609297155780549
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/page-id/feed',
array (
'message' => 'This is a test activity',
'og_action_type_id' => '383634835006146',
'og_object_id' => '136050896551329',
'og_icon_id' => '609297155780549',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/page-id/feed",
"POST",
{
"message": "This is a test activity",
"og_action_type_id": "383634835006146",
"og_object_id": "136050896551329",
"og_icon_id": "609297155780549"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("message", "This is a test activity");
params.putString("og_action_type_id", "383634835006146");
params.putString("og_object_id", "136050896551329");
params.putString("og_icon_id", "609297155780549");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/page-id/feed",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"message": @"This is a test activity",
@"og_action_type_id": @"383634835006146",
@"og_object_id": @"136050896551329",
@"og_icon_id": @"609297155780549",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/page-id/feed"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
The response will be the post_id
.
We support the following types of Unpublished Page Posts:
Post Type | Description |
---|---|
A link Page post is most effective for sharing links to your website. Allows for optional replacement of image and extra text. | |
A photo Page post with a text description and an optional link as part of the description. | |
A Page post with a text description. | |
A video Page post with optional text description. |
Unpublished Page posts are treated the same as published Page posts except that they do not appear in /feed
.
To see a list of unpublished Page posts, query the is_published
field.
curl -i -X GET \
"https://graph.facebook.com/{page-id}/feed
?fields=is_published
&access_token={your-page-access-token}"
To view a post on Facebook.com, you can navigate to https://www.facebook.com/{post-id} for most post types, or retrieve the actions
field of the post, which contains the URL at which a User can like or comment on the post.
You can enhance your link Page posts with call to action buttons.
The following call_to_action
field can be added to new link Page Posts.
Name | Type | Description |
---|---|---|
|
| Object that specifies a Call to Action button. This should be the action you want people to take when they see your post. Clicking on this button will take people to the link you specify. |
Post a link to a Page with a customized link image. The story's attachment renders an image retrieved from the link. Currently it is possible to override that image by providing an optional picture
parameter with a URL to a new image. The thumbnail
parameter offers similar functionality with the key difference being that the parameter accepts a local image file which is uploaded to Facebook in the API call.
To verify link ownership, check the ownership_permissions{can_customize_link_posts}
field on the URL
node. You must call this endpoint before posting new links. Without this step, custom link Page posts will not work for un-scraped links. See our Link Ownership Guide for more information. For versions 2.10 and lower, picture
, name
, thumbnail
, and description
are deprecated. caption
is deprecated for all versions.
Parameters | Type | Description |
---|---|---|
| string | The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page. |
| string | The name of the link attachment. This field is automatically populated by information scraped from the link. |
| string | URL for the image. Image is sourced from the URL supplied in |
| file | Image file to be uploaded. Accepts |
thumbnail
parameter is only available for link posts on Facebook Pages.thumbnail
parameter takes higher precedence over the picture
parameter. If both are supplied the picture
parameter is unused.thumbnail
parameter accepts images with extension .jpg
.jpeg
.gif
or .png
.thumbnail
parameter is not supported in batch requests.Post a link to a Page by sending a POST request to the /page/feed
edge. Set the publish
parameter to 1
to publish the post immediately or to 0
to create an unpublished post to be published later.
curl -i -X POST "https://graph.facebook.com/{your-page-id}/feed
?message=Become%20a%20Facebook%20developer!
&link=https%3A%2F%2Fdevelopers.facebook.com
&published=1
&access_token={your-page-access-token}"
{"id":"{post-id}"}
The call_to_action
field specifies the appropriate action and relevant link. This link should be the same as the link
parameter of the Page Post. In this call, title
, description
, caption
and picture
are optional, and when not provided, Facebook will read the equivalent properties from the link's Open Graph meta data. If the linked web page does not have Open Graph meta data, Facebook will try to guess these properties by scraping the web page's content.
curl -i -X POST "https://graph.facebook.com/{your-page-id}/feed
?message=Become a Facebook developer!
&link=https://developers.facebook.com
&call_to_action={"type":"SIGN_UP","value":{"link":"https://developers.facebook.com"}}
&published=1
&access_token={your-page-access-token}"
{"id":"{post-id}"}
curl -F 'link=http://www.example.com' \ -F 'thumbnail=@/local/path/to/file/on/hard/drive/image.jpg' \ -F 'access_token=page-access-token'\ https://graph.facebook.com/v2.11/page-id/feed
Return Value
{"id":"post-id"}
curl -F 'link=http://www.example.com' \ -F 'picture=https://www.example.com/path/to/image.jpg' \ -F 'access_token=page-access-token'\ https://graph.facebook.com/v2.11/page-id/feed
Return Value
{"id":"post-id>"}
Please visit our Photo Node Reference for more information.
Please visit our Page Video Reference for more information.
Please visit our Page Post Insights Reference for more information.
You can't update using this edge, however you can update posts using the /{post-id}
node.
You can't delete using this edge, however you can delete posts using the /{post-id}
node.