How to fetch facebook page reviews and ratings using API

Getting ratings and reviews on your Facebook Fan Page is a simple, important way to help people to trust and choose your business. So, how do you set up star ratings and reviews on your Facebook Page? The good news is it is super easy.

We just need an running page on your Facebook account. using JavaScript sdk we will get the page access token and make API call to get all Facebook review and rating

Facebook-reviews-and-ratings
Facebook-review-and-rating

PROGRAM CODE:-
You must have an app in your Facebook account. because to make API call we need app_id and secret_code of facebook app.

<javascript style="text/javascript">
window.fbAsyncInit = function() {
    FB.init({
      appId      : '###############', ///Facebook APP_Id
      cookie     : true,
      xfbml      : true,
      version    : 'v2.8'
    });
    FB.AppEvents.logPageView(); 
};

(function(d, s, id){
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.8&appId=###############";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

function checkLoginState(){
    FB.getLoginStatus(function(response) {
        if(response.status === 'connected'){
            var uid = response.authResponse.userID;
            var user_access_token = response.authResponse.accessToken;
            
            //Get Long live access_token
            $.get('https://graph.facebook.com/oauth/access_token?client_id=###########################&client_secret=################################
&grant_type=fb_exchange_token
&fb_exchange_token='+user_access_token, function(extended_response) {
                var newAccessToken = extended_response['access_token'];            
                jQuery.get('https://graph.facebook.com/me/accounts', {access_token: newAccessToken}, function(res) {
                    if (res.data.length != 0){
                        var radio = '';
                        $.each(res.data,function(i, k){
                            var pageAccessToken = res.data[i].access_token; //Here you will get permanent pageAccessToken to make API request
                            var pageName = res.data[i].name.trim();
                            var pageId = res.data[i].id;
                            var pageUrl = 'https://www.facebook.com/'+pageName+'-'+pageId.trim();                            
                        });                                              
                    }
                });
            });
        }
    });
}
</javascript>

Now you have got permanent PageAccessToken and PageId. To make an API call you have to hit this following
https://graph.facebook.com/v2.9/your_page_id?fields=ratings,cover&pageAccessToken=your_page_access_token

Here is the HTML code from we have to call the javascript SDK. Place below line in html code

<fb:login-button scope="manage_pages" onlogin="checkLoginState();" 
login_text="Login with Facebook">
</fb:login-button>

Getting facebook page reviews and rating
How to get Facebook page reviews using facebook api
Javascript SDK to get facebook reviews