2

Currently, I am calling the graph api to find out about the "fan page likes". I sleep for 1 second between each call. After around 10,000 calls, I start to experience HTTP 403, which says essentially "Quota Exceeded".

So, because of this, I checking into Real-Time-Updates. Here, I really got into several issues: 1) Cannot subscribe for page/likes For some reason, I am getting this:

{
    "error": {
        "message": "(#100) \"likes\" is an invalid field name",
        "type": "OAuthException",
        "code": 100
    }
}

I can subscribe, though, to fields: name, feed!

2) The documentation does not reveal how to connect your subscription with the pages you are interested in.

So, I successfully subscribe, but do not know how to add pages to this subscription

Thanks,

Tobi
  • 31,405
  • 8
  • 58
  • 90
Behzad Pirvali
  • 764
  • 3
  • 10
  • 28

2 Answers2

2

The docs don´t mention the page likes in the Realtime API, because it´s just not possible to subscribe. The error message tells you the same: "invalid field name".

Your only option to track page likes is what you do right now, but you need to increase the time between calls. Also, make sure you ALWAYS use an Access Token, at least an App Access Token. Btw, according to my tests, the Realtime API can take more than 10 seconds sometimes to kick in anyway.

About 100000 Pages a day: You should consider using a Page Access Token in that case, for every Page a different one. That should increase the limit a lot. Of course only Page Admins can create a Page Token though.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • If it kicks in at all... :-) – Tobi Dec 17 '14 at 08:33
  • i believe there were some downtimes recently, but apart from that it works pretty good :) – andyrandy Dec 17 '14 at 09:00
  • Yes, thank you,looking at the list again, Page/likes is not in the field subscription list. Now, the question becomes whether you could get the change-notification indirectly by subscribing to, for example, feed or some other fields? – Behzad Pirvali Dec 17 '14 at 16:19
  • I do wait 1 second between each call. I exponentially back-off to 10 sec once HTTP 403s start to show up. Once, HTTP 403s start to show up, the daily-quota is reached. I have even waited two hours and still got a 403. – Behzad Pirvali Dec 17 '14 at 16:33
  • you should not fall back to 10 seconds when you get a limit error, you should try to avoid limit errors before they even happen. just check for new likes every 10 seconds instead of every second. – andyrandy Dec 17 '14 at 16:42
  • i just saw that you want to query 100000 pages a day. are those even yours? why would you want to get their like count? i´ve added more information about that, maybe it helps. – andyrandy Dec 17 '14 at 16:44
1

It's clearly outlined in the docs at https://developers.facebook.com/docs/graph-api/real-time-updates/v2.2#subscribing that you can't subscribe to a Page's likes. That's because Page likes are belonging to the User data domain, not the Page's domain.

To me, it's not clear if you're just interested in the number of likes of a certain Page, or the actual "Likers". If it's the last thing, it's not possible. If the first, why do you have to query each second for the Likes? What kind of application makes this neccessary?

And, do you use your app access token, or no access token at all?

You could use the endpoint

/?fields=id,name,likes&access_token={app_id}|{app_secret}&id=https://www.facebook.com/CocaCola

as outlined in https://developers.facebook.com/docs/graph-api/reference/v2.2/url/ to get the number of likes for the CocaCola Page, where {app_id}|{app_secret} is your app access token.

Tobi
  • 31,405
  • 8
  • 58
  • 90
  • First of all, thank you so much, and sorry for not being clear. I am looking for the "No of Likes" of a fan-page and not the 'likers'. I want to query 100000 or more fan pages and only once per day. Currently, I am running out of daily-quota after issuing around 10000 requests. Facebook is return HTTP 403 and it starts to reject my calls for the day. So, it looks like a daily-quota. I do sleep 1 second between each call. Question is whether you could get the change notification indirectly through subscribing to some other fields? – Behzad Pirvali Dec 17 '14 at 16:30
  • I do wait 1 second between each call. I exponentially back-off to 10 sec once HTTP 403s start to show up. Once, HTTP 403s start to show up, the daily-quota is reached. I have even waited two hours and still got a 403. – Behzad Pirvali Dec 17 '14 at 16:34
  • Actually, I have not been using an access-token. I will try to use the app-id|app-secret and see whether this helps. Thank you so much again – Behzad Pirvali Dec 17 '14 at 16:39