Search code examples
node.jsfacebookfacebook-graph-apifacebook-javascript-sdk

How to include Group cover photo in Group Info Endpoint on Facebook Graph API


I have the following endpoint to retrieve the details of a Facebook group via its id

let groupInfoUrl = `https://graph.facebook.com/${group_id}?access_token=${accessToken}`;

Below is an example of the response I got:

{
  "name": "Group Name",
  "privacy": "OPEN",
  "id": "012345678901234"
}

How can I make the response to also include the Group Cover photo or icon?

Thank you.


Solution

  • You just have to add fields=cover to your query:

    let groupInfoUrl = `https://graph.facebook.com/${group_id}?fields=cover&access_token=${accessToken}`;