Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5967115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:53:51+00:00 2026-05-22T19:53:51+00:00

Can any one help how to get facebook recommended count in php. I search

  • 0

Can any one help how to get facebook recommended count in php.

I search for facebook api but i dint found any.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:53:51+00:00Added an answer on May 22, 2026 at 7:53 pm

    A Recommendation is a Like. You can see it in the reference of the like button :

    action – the verb to display on the button. Options: ‘like’, ‘recommend’

    To get the counts for a URL (here http://stackoverflow.com), you can make an FQL call :

     SELECT url, share_count, like_count, comment_count, total_count
     FROM link_stat WHERE url="http://stackoverflow.com"
    

    Call directly

    $fql = 'SELECT url, share_count, like_count, comment_count, total_count
            FROM link_stat WHERE url="http://stackoverflow.com"';
    $json = file_get_contents('https://api.facebook.com/method/fql.query?format=json&query=' . urlencode($fql));
    

    And $json will contain :

    [
        {
            "url"           : "http://stackoverflow.com",
            "share_count"   : 1353,
            "like_count"    : 332,
            "comment_count" : 538,
            "total_count"   : 2223
        }
    ]
    

    You have here :

    • share_count : the counts of shares for the URL
    • like_count : the count of likes (= recommendations)
    • comment_count : the count of comments in Facebook below shares of that link
    • total_count : the sum of theses 3 counts

    You can read json in PHP with json_decode :

    $data = json_decode($json);
    echo  $data[0]->like_count;
    

    Use the Facebook PHP SDK

    EDIT : As Rufinus pointed out int the comments of his answer, for stability reasons, if you are on a long term project and not just a quick experiment you should use the Facebook PHP SDK (see on github) to make FQL queries : Facebook is more and more closing public access (read without access token) to its API (see this blog post on Facebook developers blog). Even like here when theses queries are not related to any user : the SDK is using the app access token to make the query.

    require "facebook.php";
    $facebook = new Facebook(array(
        'appId'  => YOUR_APP_ID,
        'secret' => YOUR_APP_SECRET,
    ));
    
    $fql = 'SELECT url, share_count, like_count, comment_count, click_count, total_count 
            FROM link_stat WHERE url="http://stackoverflow.com"';
    
    $result = $facebook->api(array(
        'method' => 'fql.query',
        'query' => $fql,
    ));
    

    The $result array contains what you need (like_count field) and even more :

    Array (
        [0] => Array (
            [url] => http://stackoverflow.com
            [share_count] => 1356
            [like_count] => 332
            [comment_count] => 538
            [click_count] => 91
            [total_count] => 2226
        )
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can Any one help me reading this XML and Looping through <MedicationDispensed> I get
Can any one help me to get logged in user's info like email id,name,city
Can anyone help me with the question. I'm trying to get msmq messages count
can any one help me with code that subtract 1 from a digit stored
can any one help me in creating a regular expression for password validation. The
Can any one help me how to sort rows by relevance for the following
I am new in Pocket PC and Smart phone. so can any one help
I want to bound JVM with a fixed memory limit. Can any one help
Can any one please help me solve this. I am resizing some flash object/embed
Can any one of you help me in converting an windows dll file in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.