Retrieving an Album

Problem

I need to retrieve a Facebook album using FQL.

Solution

This is your most basic album-related query:

SELECT aid, cover_pid, name, link FROM album WHERE owner = $uid;

Discussion

Since SELECT * isn’t supported in FQL, you’ll have to list out the actual fields you’re looking for. This would be enough to let you display someone’s albums with links back to the original. Remember that this query will only return albums that the current loggedinuser has permission to see.

Get Facebook Cookbook 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.