Facebook Developers
DocumentationSupportBlogAppsLog In
  • Getting Started
  • Core Concepts
  • Advanced Topics
    • Dialogs
    • FQL
    • Internationalization
    • Ads API
    • Credits
    • Chat API
    • Legacy REST API
    • Legacy FBML
    • Legacy FBJS
    • Legacy Javascript SDK
  • SDK Reference
  • Tools
  • Tables
    • album
    • application
    • apprequest
    • checkin
    • comment
    • comments_info
    • connection
    • cookies
    • developer
    • domain
    • domain_admin
    • event
    • event_member
    • family
    • friend
    • friend_request
    • friendlist
    • friendlist_member
    • group
    • group_member
    • insights
    • like
    • link
    • link_stat
    • location_post
    • mailbox_folder
    • message
    • note
    • notification
    • object_url
    • offer
    • page
    • page_admin
    • page_blocked_user
    • page_fan
    • page_milestone
    • permissions
    • permissions_info
    • photo
    • photo_src
    • photo_tag
    • place
    • privacy
    • privacy_setting
    • profile
    • profile_view
    • question
    • question_option
    • question_option_votes
    • review
    • standard_friend_info
    • standard_user_info
    • status
    • stream
    • stream_filter
    • stream_tag
    • subscription
    • thread
    • translation
    • unified_message
    • unified_thread
    • unified_thread_action
    • unified_thread_count
    • url_like
    • user
    • video
    • video_tag

friend

Advanced Topics › FQL › friend

An FQL table that can be used to return a list of a user's friends or to show whether two users are friends.

If this table is queried with two user IDs and they are not friends, it will return an empty array.

The User Graph API object has an equivalent friends connection.

To read the friend table you need

  • any valid access_token to retrieve friends of the current session user

This is the only user that this table can be queried for, the friends of friends cannot be retrieved.

Examples

The friends of the currently logged in user (Try this query):

SELECT uid2 FROM friend WHERE uid1 = me()

Determine whether the currently logged in user is friends with another user, Bret Taylor (Try this query):

SELECT uid1, uid2 FROM friend WHERE uid1 = me() AND uid2 = 220439

Columns

IndexableNameTypeDescription
*uid1int

The user ID of the first user in a particular friendship link.

*uid2int

The user ID of the second user in a particular friendship link.

Updated about 11 months ago
Facebook © 2012 · English (US)
AboutCareersPlatform PoliciesPrivacy Policy