0

I'm trying to find which of my friends have been to Paris before. I'm trying to use the Graph API to do this.

So basically there's the place id (for Paris it's 110774245616525), I can get basic informations using the endpoint https://graph.facebook.com/110774245616525/ to do this. Then, I'm getting an access_token with friends_status and user_status permissions (using the Graph Explorer) and I'm using this access token to get the checkins. So I'm doing a GET https://graph.facebook.com/110774245616525/checkins?access_token=my_access_token call and all I get is this error message :

page_id is not a member of the checkin table

Although, reading the documentation I see the connection with checkins :

Checkins made to this Place Page by the current user, and friends of the current user.

Is this an error with the Graph API or with the way I do it?

Thanks !

Benjamin Netter
  • 1,501
  • 3
  • 18
  • 34

3 Answers3

1

There's a breaking change for checkins in the July release https://developers.facebook.com/roadmap/ it mentions renaming page_id to target_id so this might be what's causing it. However the following fql query might be a starting point for you

   select author_uid from checkin where target_id = 110774245616525

author_uid should be the person who checked in https://developers.facebook.com/docs/reference/fql/checkin

TommyBs
  • 9,354
  • 4
  • 34
  • 65
  • yeah but that's not what I'm trying to do, because let's say I have 300 friends, I would have to do 300 requests. I'm pretty much just trying to do the **Friends who have visited Paris, France** box on the Paris page. – Benjamin Netter Apr 23 '13 at 16:00
  • Why would you have to do 300 requests? As far as I'm aware that is selecting all people who have checked into Paris, Paris is the target_id in the where clause. It returns author_uid which is the uid of your friend. I'm not telling you to replace it with an actual number. Just try out the query in the developer tools and see if it works – TommyBs Apr 23 '13 at 16:03
  • I tried, it just returns one friend. Is there any reasons for this? Knowing that it should pretty much returns ~400 entries. – Benjamin Netter Apr 23 '13 at 16:06
  • hmm try select name from user where uid in (select author_uid from checkin where target_id = 110774245616525) – TommyBs Apr 23 '13 at 16:08
  • i tried adding **limit 100**, but it gives me the same results. Maybe it's the only person who actually checked in Paris, when I'm trying to find persons who published anything from here. – Benjamin Netter Apr 23 '13 at 16:11
  • might have to use location_post instead. – Benjamin Netter Apr 23 '13 at 16:43
1

I got the following fql to work to display all the names of my friends who have checked in at a specific location. Only tried it in Graph API Explorer, and it was fairly slow :/ Let me know if it's helpful :)
Select name from user where uid in (Select author_uid from checkin where author_uid in (select uid2 from friend where uid1=me()) and target_id=110774245616525)

An additional note: I noticed that many of my friends show up in the "Friends who have visited Paris, France" box, but they don't have any actual checkins there. I think that the box also checks to see if your friends have any photos from paris.. Just a thought

asifrc
  • 5,781
  • 2
  • 18
  • 22
0

With the help of asifrc and TommyBs I found a way to do this in FQL using this query :

SELECT name 
  FROM user 
 WHERE uid IN (
       SELECT author_uid 
         FROM location_post 
        WHERE distance(latitude, longitude, "48.856614", "2.3522219") < 5000 
          AND author_uid IN (SELECT uid2 FROM friend WHERE uid1=me()))

It's pretty much getting all my friends, searching all their posts close to the center of Paris, then getting their names.

If anyone knows how to do this in Graph API, please let me know, because it's still not a good idea to rely on FQL, I think.

Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
Benjamin Netter
  • 1,501
  • 3
  • 18
  • 34