facebook – Return only albums with at least one photo


I'm currently doing the following FQL query to return all albums of the logged in user that have at least one photo (with the number of photos):

SELECT object_id, name, photo_count 
FROM album 
WHERE owner = me() AND photo_count > 0

Unfortunately version 2.1 of the platform removed FQL support.

I know I can get the values ​​in question with the following call:


But I haven't found a way to filter out empty albums. Iterating through each value and checking those with non-zero count is not very convenient as a user can have a large amount of albums; I would be forced to iterate over several pages just to count the amount of non-empty albums.

Cross posting to SOen: Question in English


Unfortunately there is no manipulation possible for this purpose of filtering or ordering results, the Graph API is very strict in this regard.

As version 2.0, which still supports FQL , will have support until 8/7/2016 , my suggestion is to continue using FQL to make this and other queries more complex and migrate the simpler accesses to version 2.1.

Because FQL is infinitely more powerful, in terms of complexity and data analysis capability, than the Graph API alone. We hope that by 2016 Facebook will provide an alternative that meets most needs, otherwise it could cause problems for a lot of people.

Scroll to Top