FQL:user

From Facebook Developer Wiki (FbDevWiki.com)
Jump to: navigation, search

Query this table to return detailed information from a user's profile. If you need user information for analytic purposes, query the standard_user_info table instead.

Note: You can cache this data and subscribe to real time updates on any of its fields which are also fields in the corresponding Graph API version.

Contents

Columns

Highlighted rows are indexable / searchable and one is usually required in the WHERE portion of the query.

Name Type Description
uid int The user ID of the user being queried.
first_name string The first name of the user being queried.
middle_name string The middle name of the user being queried.
last_name string The last name of the user being queried.
name string The full name of the user being queried.
pic_small string The URL to the small-sized profile picture for the user being queried. The image can have a maximum width of 50px and a maximum height of 150px. This URL may be blank.
pic_big string The URL to the largest-sized profile picture for the user being queried. The image can have a maximum width of 200px and a maximum height of 600px. This URL may be blank.
pic_square string The URL to the square profile picture for the user being queried. The image can have a maximum width and height of 50px. This URL may be blank.
pic string The URL to the medium-sized profile picture for the user being queried. The image can have a maximum width of 100px and a maximum height of 300px. This URL may be blank.
affiliations array The networks to which the user being queried belongs. The status field within this field will only return results in English.
profile_update_time time The time the profile of the user being queried was most recently updated. If the user's profile has not been updated in the past three days, this value will be 0.
timezone string The time zone where the user being queried is located.
religion string The religion of the user being queried.
birthday string The birthday of the user being queried. The format of this date varies based on the user's locale.
birthday_date string The birthday of the user being queried, rendered as a machine-readable string. The format of this date never changes.
sex string The gender of the user being queried. This field will only return results in English.
hometown_location array The home town (and state) of the user being queried.
meeting_sex array A list of the genders the person the user being queried wants to meet.
meeting_for array A list of the reasons the user being queried wants to meet someone.
relationship_status string The type of relationship for the user being queried. This field will only return results in English.
significant_other_id uid The user ID of the partner (for example, husband, wife, boyfriend, girlfriend) of the user being queried.
political string The political views of the user being queried.
current_location array The current location of the user being queried.
activities string The activities of the user being queried.
interests string The interests of the user being queried.
is_app_user bool Indicates whether the user being queried has logged in to the current application.
music string The favorite music of the user being queried.
tv string The favorite television shows of the user being queried.
movies string The favorite movies of the user being queried.
books string The favorite books of the user being queried.
quotes string The favorite quotes of the user being queried.
about_me string More information about the user being queried.
hs_info array Information about high school of the user being queried.
education_history array Post-high school information for the user being queried.
work_history array The work history of the user being queried.
notes_count int The number of notes created by the user being queried.
wall_count int The number of Wall posts for the user being queried.
status string The current status of the user being queried.
has_added_app bool Deprecated. This value is now equivalent to is_app_user.
online_presence string The user's Facebook Chat status. Returns a string, one of active, idle, offline, or error (when Facebook can't determine presence information on the server side). The query does not return the user's Facebook Chat status when that information is restricted for privacy reasons. Requires friends_online_presence or user_online_presence extended permissions
locale string The two-letter language code and the two-letter country code representing the user's locale. Country codes are taken from the ISO 3166 alpha 2 code list (except for es_LA).
proxied_email string The proxied wrapper for a user's email address. If the user shared a proxied email address instead of his or her primary email address with you, this address also appears in the email field (see above). Facebook recommends you query the email field to get the email address shared with your application.
profile_url string The URL to a user's profile. If the user specified a username for his or her profile, profile_url contains the username.
email_hashes array An array containing a set of confirmed email hashes for the user. Emails are registered via the connect.registerUsers API call and are only confirmed when the user adds your application. The format of each email hash is the crc32 and md5 hashes of the email address combined with an underscore (_).
pic_small_with_logo string The URL to the small-sized profile picture for the user being queried. The image can have a maximum width of 50px and a maximum height of 150px, and is overlaid with the Facebook favicon. This URL may be blank.
pic_big_with_logo string The URL to the largest-sized profile picture for the user being queried. The image can have a maximum width of 200px and a maximum height of 600px, and is overlaid with the Facebook favicon. This URL may be blank.
pic_square_with_logo string The URL to the square profile picture for the user being queried. The image can have a maximum width and height of 50px, and is overlaid with the Facebook favicon. This URL may be blank.
pic_with_logo string The URL to the medium-sized profile picture for the user being queried. The image can have a maximum width of 100px and a maximum height of 300px, and is overlaid with the Facebook favicon. This URL may be blank.
allowed_restrictions string A comma-delimited list of Demographic Restrictions types a user is allowed to access. Currently, alcohol is the only type that can get returned.
verified bool Indicates whether or not Facebook has verified the user.
profile_blurb string This string contains the contents of the text box under a user's profile picture.
family array Note: For family information, you should query the family FQL table instead.

This array contains a series of entries for the immediate relatives of the user being queried. Each entry is also an array containing the following fields:

  • relationship -- A string describing the type of relationship. Can be one of parent, mother, father, sibling, sister, brother, child, son, daughter.
  • uid (optional) -- The user ID of the relative, which gets displayed if the account is linked to (confirmed by) another account. If the relative did not confirm the relationship, the name appears instead.
  • name (optional) -- The name of the relative, which could be text the user entered. If the relative confirmed the relationship, the uid appears instead.
  • birthday -- If the relative is a child, this is the birthday the user entered.

Note: At this time, you cannot query for a specific relationship (like SELECT family FROM user WHERE family.relationship = 'daughter' AND uid = '$x'); you'll have to query on the family field and filter the results yourself.

username string The username of the user being queried.
website string The website of the user being queried.
is_blocked bool Returns true if the user is blocked to the viewer/logged in user.
contact_email string A string containing the user's primary Facebook email address. If the user shared his or her primary email address with you, this address also appears in the email field (see below). Facebook recommends you query the email field to get the email address shared with your application.
email string A string containing the user's primary Facebook email address or the user's proxied email address, whichever address the user granted your application. Facebook recommends you query this field to get the email address shared with your application.
third_party_id string A string containing an anonymous, but unique identifier for the user. You can use this identifier with third-parties.

Notes

Privacy Note: Please read users.getInfo to see which fields are visible to an application only if that user has authorized that application. Also, read about fields can always be seen.

See Also

Notes/Bugs/Gotchas

What language?

There seems to be an ongoing debate at Facebook as to whether certain fields should be sent as English-only or as the localized language. For example, "sex" was returning a localized string, but currently (2011-02-17) is passing only English. In the table it says "English only", but at the top of the official docs it says "Facebook user information that the user selects from a combo box (for example, 'sex' or 'relationship_status') may get returned as a localized string.".

As a work-around, you can try this (taken from bugzilla #10711):

$result = $facebook->api(array('method' => 'fql.query',
                               'query' => $query,
                               'locale' => 'en_US'
                        ));

This should force the response to be English if it suddenly decides to start returning localized strings.

Personal tools
Namespaces
Variants
Actions
Navigation
Graph API
FQL
Toolbox