I've looked at a ton of related posts here and can't seem to find an answer. I've been using the same code for months to get the Facebook share count of pages on my website. It's worked [relatively] flawlessly, but suddenly it started returning nothing. After trying the source URL in the browser, I realized it's throwing an API Limit error. Please help...
CODE:
[[[FUNCTION]]]
return jQuery.ajax({
url: 'https://graph.facebook.com/?fields=engagement&callback=FB.Share&id=' + permalinkWPSC + '&access_token=[[[ACCESS TOKEN]]]',
type: 'GET',
dataType: 'JSONP',
success: function(data) {
count = 0;
if (data.engagement) {
var count = Number(data.engagement.reaction_count + data.engagement.share_count + data.engagement.comment_count);
var share_count_http = 0;
if ($('[data-share-count]').length > 0) {
share_count_http = parseInt($('[data-share-count]').data('share-count'));
}
count = count + share_count_http;
}
$( ".share-num" ).html( count );
$( "span.fbCount" ).html( count );
}
});
[[[END FUNCTION]]]
So this is essentially using this URL string (with "URL" being actual URL and "ACCESSTOKEN" being the access token granted by the Facebook API: https://graph.facebook.com/?fields=engagement&callback=FB.Share&id=URL&access_token=ACCESSTOKEN
ERROR:
/**/ FB.Share({
"error": {
"message": "(#613) Calls to graph_url_engagement_count have exceeded the rate of 10 calls per 3600 seconds.",
"type": "OAuthException",
"code": 613,
"fbtrace_id": "Ad9vIHStlvzuGptF9LZmT-L"
}
});
Note that nothing else changed on the website or with traffic. Very strange...
