Paul
Paul

Reputation: 588

How to get average rating and number of ratings of a facebook page?

I am trying to find the count of ratings and the average value from facebook pages.

I obtained a long term page token via oauth and can access everything but these fields. Am I missing something, or do they not return these like google places or foursquare APIs do ?

I can collect individual ratings via /{page-id}/ratings, however, if I have a page with 1,000 reviews, will all these be returned? Is it a reliable alternative to calculate my own averages/count?

The google places rating count is a hidden field (not shown in the API docs). Hoping there might be one of these for facebook...?

Upvotes: 2

Views: 2751

Answers (2)

dragmosh
dragmosh

Reputation: 393

I'm not sure if this was the case when this question was asked, but now there's an overall_star_rating field on the page.

You can access it like so: /{page-id}?fields=overall_star_rating

There's also a rating count, which you can access with : /{page-id}?fields=rating_count

Both are listed in their docs: https://developers.facebook.com/docs/graph-api/reference/page

Upvotes: 13

Sojan Jose
Sojan Jose

Reputation: 3238

You can get page ratings and review using /page/ratings node . There isn't an aggregate rating attribute for the facebook pages mentioned in the graph api docs .But you calculate the aggregate rating from the individual ratings obtained via graph api .

Graph api is pretty reliable and you should get almost every post via that . and yeah you can calculate your own averages/count cause when dealing with 1,000 reviews even if you miss 1 or 2 it won't make a big difference as ratings is between (1-5) .

note :

It is mentioned here at page/feed that

All of these derivative edges share the exact same reading structure, however /feed should be used for all publishing purposes. They all have an upper boundary for the limit parameter of 250 posts. Specifying any higher limit will throw an error.

So for obtaining something like 1000 posts , make sure you will be using paging .

Upvotes: 0

Related Questions