Searching with FQL

Facebook Graph API and Search API are certainly the easiest ways to search for specific information about things on Facebook, but you also have an alternative way if you want to get more precise. Depending on what you're looking for, you may find that this allows you to get even more specific. Because Facebook Query Language (FQL) provides an SQL-like syntax toward queries, you can't neglect it as an option in doing your search queries on Facebook.

As I was writing this, I kept wondering, “The Graph API search seems very limited! Why can't I do things like search in individual users' streams, or search through just certain types of objects like links or photos?” If you search through Facebook's Developer forum, you see that this is also a common question there. Facebook actually does make this possible, with a catch. The catch is that you can't specify keywords if you're searching the stream, and you have to specify a filter. The stream_filters table is what makes this possible.

Working with filters

Facebook has been a little finicky over the years about using filters in its user interface. At times, filters have been prominently visible, and at other times, Facebook has completely removed the filters. Recently, shortly before this writing, Facebook added filters again. If Facebook's user interface is the same when you read this, the filters will be in the upper-right corner, where you can click the down arrow next to Recent Items.

All this time, however, Facebook ...

Get Facebook® Application Development For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.