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 7510835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:20:46+00:00 2026-05-29T23:20:46+00:00

Using Facebook graph API, I am trying to retrieve number of mutual friends 2

  • 0

Using Facebook graph API, I am trying to retrieve number of mutual friends 2 users have. However, I am getting number of friends of one of them instead.

Here is my code:

    <?php

    $mutual_array = json_decode(file_get_contents("https://graph.facebook.com/".$fb_id."/mutualfriends/".$other_fb_id."?".$access_token), true);

    $mutual_friends = $mutual_array['data'];
    $mutual_number = count($mutual_friends);

    ?>

$mutual_number gives the number of facebook friends $other_fb_id user has. And when I try to print_r $mutual_friends it gives all the friends the user has.

Anyone know what’s going on here? Thanks.

  • 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-29T23:20:47+00:00Added an answer on May 29, 2026 at 11:20 pm

    This is a facebook api bug. Even though the information is symetrical, to get the number of mutual friends, you have to use the access token of the current user (user a), not of the other user you are checking with.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to retrieve information through Facebook graph api, using the below code
I'm trying to retrieve data using the new graph API, however the token I'm
I have a Facebook desktop application and am using the Graph API . I
Follow up to this question for Facebook Friends.getAppUsers using Graph API that pulls friends
I want to check in using facebook android sdk (graph api), I am trying
I'm trying to post a note using Facebook Graph API. I would like to
Hello I am using facebook graph api..and trying to display comments of each post..But
I am trying to upload a photo to facebook using graph api and keep
I'm trying to get the education info from Facebook's graph API using stdclass. here's
I am trying to get the names of my friends using FB Graph API

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.