User (FQL)

From Facebook Developer Wiki

Jump to: navigation, search


Contents

Description

The FQL user table. 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.

To structure your query, use the table name (user in this case) in the FROM clause. The items in the Name column correspond to columns in the table that can be referenced in the SELECT and WHERE clauses.

In order to make your query indexable, the WHERE in your query should contain an = or IN clause for one of the columns marked with a * in the Indexable column of the table.

The See Also section lists API functions that work on similar data; their documentation pages contain additional information about the contents of the column and example FQL queries.

Note: Facebook user information that the user selects from a combo box (for example, sex or relationship_status) may get returned as a localized string. For more information, see API#API Results and Localization.

Columns

IndexableNameTypeDescription
* uid int The user ID of the user being queried.
first_name string The first 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.
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 sex of the user being queried.
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.
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 from 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.
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.
proxied_email string The proxied wrapper for a user's email address.
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 string 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 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.

Notes

Privacy Note: For any user submitted to this method, the following user fields are visible to an application only if that user has authorized that application:

  • meeting_for
  • meeting_sex
  • religion
  • significant_other_id

In addition, the visibility of all fields, with the exception of affiliations, first_name, last_name, name, and uid may be restricted by the user's Facebook privacy settings in relation to the calling user (the user associated with the current session).

Compatibility Note: Searching the family field is not currently possible using an associative array.

Ex:
SELECT name, family FROM user WHERE uid=1315610129 AND family.relationship='daughter'

will return an FQL error for users that have the family field populated (see bug)

See Also

reference