FQL:stream_filter

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

Query this table to return a filter_key that can be used to query the stream FQL table, as seen through any content filters the user has available on Facebook. These include friend lists, applications, networks, and the home page stream (News Feed), which comprises all users and Pages the user has not hidden.

Columns

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

Name Type Description
uid string The ID of the user whose filters you are querying.
filter_key string A key identifying a particular filter for a user's stream. This filter is useful to retrieve relevant items from the stream table.
name string The name of the filter as it appears on the home page.
rank int A 32-bit int that indicates where the filter appears in the sort.
icon_url string The URL to the filter icon. For applications, this is the same as your application icon.
is_visible bool If true, indicates that the filter is visible on the home page. If false, the filter is hidden in the More link.
type string The type of filter. One of application, newsfeed, friendlist, network, or publicprofile.
value int A 64-bit ID for the filter type.

Examples

To get the filter keys for all the applications a user has authorized, format your query like this:

SELECT filter_key FROM stream_filter WHERE uid=<uid> AND type="application"

To get all the filters for a particular user, format your query like this:

SELECT filter_key FROM stream_filter WHERE uid=<uid>

A typical use case for this table piped into the stream filter. In this case, retrieving the News Feed of user 3.

SELECT post_id, actor_id, target_id, message FROM stream WHERE filter_key in 
   (SELECT filter_key FROM stream_filter WHERE uid = 3 AND type = 'newsfeed')

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Graph API
FQL
Toolbox