channa ly
channa ly

Reputation: 9927

Facebook Graph API does not return shares but comment count and like count are ok

I am trying to get shares, comments and likes count from Facebook graph API. Everything works great except the shares did not return in the response payload.

Here is the params I sent:

mypost_id?fields=message,shares,likes.summary(true).limit(0),comments.summary(true).limit(0)

Here is the response

{
  "message": "HUAWEI WiFi Router AX3",
  "likes": {
    "data": [
    ],
    "summary": {
      "total_count": 2,
      "can_like": true,
      "has_liked": true
    }
  },
  "comments": {
    "data": [
    ],
    "summary": {
      "order": "ranked",
      "total_count": 2,
      "can_comment": true
    }
  },
  "id": "103851678893717_115163661095852"
}

Here is the graph API screenshot

enter image description here

I've noticed that the shares parameter was marked as grey ( see in the figure above ), there might be something wrong with it.

I am using Facebook graph v13.0.

Is there anyone experiencing this issue before?

Upvotes: 2

Views: 377

Answers (1)

C3roe
C3roe

Reputation: 96226

Looks like the API only returns shares, if there are any actual shares.

For posts with no shares, this is simply completely omitted from the result.

For posts that do have shares, you should get "shares": { "count": xy } in the resulting structure.

Upvotes: 1

Related Questions