Search code examples
facebookfacebook-fqlphoto-tagging

FQL: Retrieving photos that have multiple friends tagged


How would I retrieve all the photos that have multiple friends tagged given a few friend IDs?

The following doesn't seem to retrieve all photos (or any in many cases):

SELECT object_id, src_big FROM photo WHERE pid IN 
  (SELECT pid FROM photo_tag WHERE subject = me() AND pid IN 
       (SELECT pid FROM photo_tag WHERE subject=<friend ID1>)) AND pid IN 
           (SELECT pid FROM photo_tag WHERE subject=<friend ID2>))

Would I need to specifically query within friend 1 and friend 2's photo albums?


Solution

  • I agree Facebook API may not even return all the photos I was tagged in. But i believe it may be because of the privacy setting of the person who tagged me. I have tried similar request using via the Graph API too but no luck. (Exact same results)

    I ran you query and it worked fine for me. (Except you have a extra bracket at end). It does return me all the photos I have tagged myself but only some of friend photos in which I was tagged. I do have friends_photo permission ( You may want to check for yours) . I have also tried running following commands but it still didn't return me all the pics which my friends have tagged me.

      SELECT object_id, src_big, caption FROM photo WHERE owner!=me() and pid IN 
      (SELECT pid FROM photo_tag WHERE subject = me())