Getting Public Info about Location in Facebook Graph API

Posted by Allan Deamon on Stack Overflow See other posts from Stack Overflow or by Allan Deamon
Published on 2012-07-12T15:52:19Z Indexed on 2014/06/13 15:25 UTC
Read the original article Hit count: 256

I need to get the living city of each person in a group. Including people that are not my friends.

In the browser seeing facebook profile of some unknown person, they show "lives in ...", if this is set as public information. They include the link to the city object with the city id in the link. That's all that I need.

But, using a facebook app that I created to use the facebook graph api, this information is not public. I can only get the user propriety 'location' from friends of my that I have permission to see it. I gave ALL the possible permissions to my app.

In the api explorer, when I use it as REST, they show few informations about someone not friend of mine.

https://developers.facebook.com/tools/explorer/

Also in the api explorer, when I use the FQL, it didn't works.

This query works, returning the JSON with the data:

SELECT uid, name FROM user WHERE username='...';

But this other query doesn't work:

SELECT uid, name, location FROM user WHERE username='...';

They return a json with a error code:

{
  "error": {
    "message": "(#602) location is not a member of the user table.", 
    "type": "OAuthException", 
    "code": 602
  }
}

I asked for ALL the permissions options in the token. And I can get this info in the browser version of the facebook. But how can I get it with the API ?

© Stack Overflow or respective owner

Related posts about facebook

Related posts about facebook-graph-api