0

The idea is a contest in which participants publish your photo on my site and using the "FB Likes" button to receive votes.

I want to get the "FB Likes" by the publication URL on my site, but no longer works with the old URL method, only returns shares.

I'm testing with the new API, but do not get the "Likes" or "Reactions" and I get the following error.

{
   "error": {
   "message": "(#12) singular links API is deprecated for versions v2.4 and higher",
      "type": "OAuthException",
      "code": 12,
      "fbtrace_id": "EtqLBMRNwZK"
   }
}

Try the solutions given in this link but fails to obtain the data.

Getting Facebook Reactions with Graph API

Regards. Thanks!

Community
  • 1
  • 1
MWDS
  • 1
  • 1
  • Possible duplicate of [Get Facebook share/like/comment count of URL](http://stackoverflow.com/questions/39028734/get-facebook-share-like-comment-count-of-url) – dim Nov 23 '16 at 08:30

1 Answers1

1

Try this solution that allow get the number of likes/reposts/comments by next request:

https://graph.facebook.com/?fields=og_object{likes.limit(0).summary(true)},share&ids=http://google.com,http://stackoverflow.com/

Response:

{
  http://google.com: {
    og_object: {
      likes: {
        data: [ ],
        summary: {
          total_count: 88216
        }
      },
      id: "381702034999"
    },
    share: {
      comment_count: 0,
      share_count: 36084403
    },
    id: "http://google.com"
  },

  http://stackoverflow.com/: {
    og_object: {
      likes: {
        data: [ ],
        summary: {
          total_count: 660
        }
      },
      id: "10150180465825637"
    },
    share: {
      comment_count: 12,
      share_count: 45367
    },
    id: "http://stackoverflow.com/"
  }
}
dim
  • 310
  • 2
  • 8
  • your URL works! But because only with HOMEs? I'll show you 2 links, a **HOME** and a **NOTE**, and the **NOTE** returns nothing .. why? **HOME** [link](https://graph.facebook.com/?fields=og_object{likes.limit(0).summary(true)},share&ids=http://www.lagaceta.com.ar/) **NOTE** [link](https://graph.facebook.com/?fields=og_object{likes.limit(0).summary(true)},share&ids=http://www.lagaceta.com.ar/nota/695810/sociedad/supermercado-indemnizara-clienta-identifico-como-gluteos-grandes.html?utm_source=facebook.com&utm_medium=social&utm_campaign=fanpagetucuman) Thank you! – MWDS Aug 25 '16 at 16:09