Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get facebook public page rating and review

I am not the owner of some page but i want access the pages reviews and ratings,Each access time i am getting empty data set

> http="https://graph.facebook.com/102227700571/tabs/reviews?access_token=fb_oauth"
>  content=callAPIInfo(http,fb_oauth)
> content
$data
list()

I saw some of the similar12 question but didnt get my answer,I dont wanna collect page access tokens from the admin of each pages,Is it possible to fetch review and rating.thanks.

EDIT

Finally i find a very detailed answer by ifaour for access pages token by admin and its necessary to take page access token so here is how to get page access token and review and rating

  1. Go to the Graph API Explorer
  2. Choose your app from the dropdown menu
  3. Click "Get Access Token"
  4. Choose the manage_pages permission (you may need the user_events permission too, not sure)
  5. Now access the me/accounts connection and copy your page's access_token Click on
  6. your page's id Add the page's access_token to the GET fields Call
  7. the connection you want (e.g.: PAGE_ID/events)

    access_token="xxx" #[what u find above]
    > content=callAPIInfo(http,access_token)
    > content
    $data
    $data[[1]]
    $data[[1]]$created_time
    [1] "2014-04-13T11:37:26+0000"
    
    $data[[1]]$reviewer
    $data[[1]]$reviewer$name
    [1] "abc"
    
    $data[[1]]$reviewer$id
    [1] "100000579606903"
    
    $data[[1]]$rating
    [1] 4
    
    $data[[1]]$review_text
    [1] "Enjoy having coffee here...:)"
    
like image 516
user2801682 Avatar asked Apr 10 '14 11:04

user2801682


People also ask

How do you get your Facebook page rating?

A Page's rating is based on multiple sources, such as the reviews and Recommendations people share about business Pages on Facebook. Only Pages that allow Recommendations may show a rating, and a Page may not have a rating if it hasn't received enough Recommendations.

How do I enable reviews and star ratings on my Facebook page?

Step #1: Log in to your Facebook Business page. Step #2: Click on the “Settings” tab. Step #3: Navigate to “Templates and Tabs” Step #4: Enable Reviews through the slider.

Are reviews on Facebook public?

In the Sharing section, select who will be able to see your review. You can choose just friends, or set it to public so that anyone can see it.


1 Answers

See, all-most all the graph API calls needs an access token for access else you'll not get the result.

The different APIs require different kinds of access tokens, some required current user's access token, some requires page access token and some require app access token. And there are also some APIs that can use either of these tokens.

You want to get the rating/reviews of a page. If you read the official documentation for the same (/{page-id}/ratings), it clearly says-

A page access token is required to retrieve this data.

So you have to have the page access token to get the ratings/reviews of that page. (and for that you should add manage_pages permission and get the page access token with /{page-id}?fields=access_token)

like image 96
Sahil Mittal Avatar answered Oct 26 '22 23:10

Sahil Mittal