Facebook Graph API - Get Group Feed using Graph API

by
Jeremy Canfield |
Updated: November 11 2023
| Facebook Graph API articles
This assumes you are already created an app in https://developers.facebook.com. If not, check out my article Getting Started with Facebook Graph API.
You will first need to get the User Access Token. Check out my article Facebook Graph API - Get Access Token. For example,
- Go to https://developers.facebook.com and select My Apps.
- Select your App.
- Select Tools > Graph API Explorer.
By default, the query should be setup to GET v18.0/me?fields=id,name. Select Submit and this should return your User ID and User Access Token, something like this.
EAANROE66DrsBOy1TiJVQPEPEZAgo2Iap7QzdKEGRfJBW30drpIpkprZB4N5MRxDfZCoLh4OQZCCDgPqVxFEO39YDTIZCmChr9b3QcDr5MxPSjxvnY4Q1uPpMZCgG6Tr0FsZAW2vJD3qo5LpYZCu2JE2VhBUZCAPnZCCnysHlvca9QQ9BS2cvXxccHmUGPEKml4ncE0BYrfh7bI9ZAL9M7sLBgZDZD
Then submit a GET request to the /<group id> endpoint and something like this should be returned.
{
"name": "my Group",
"privacy": "OPEN",
"id": "123456789012345"
}
Or like this, using curl.
curl \
--request GET \
--url "https://graph.facebook.com/v18.0/<group id>?access_token=<user access token>"
And then you can submit a request to the /<group id>/feed endpoint to list the groups feed.
curl \
--request GET \
--url "https://graph.facebook.com/v18.0/<group id>/feed?limit=2&access_token=<user access token>"
Something like this should be returned.
{
"data": [
{
"updated_time": "2023-11-02T00:15:31+0000",
"message": "Hello",
"id": "123456789012345_1234567890123456"
},
{
"updated_time": "2023-10-23T02:59:17+0000",
"message": "World",
"id": "123456789012345_1234567890123456"
}
],
"paging": {
"previous": "https://graph.facebook.com/v18.0/123456789012345/feed?access_token=EAANR.....5QZDZD",
"next": "https://graph.facebook.com/v18.0/123456789012345/feed?access_token=EAANR.....AZDZD&__previous"
}
}
Did you find this article helpful?
If so, consider buying me a coffee over at