views:

1279

answers:

2

The old Facebook API provided the user sex/gender as part of the default user data. Apparently the new Graph API does not provide that information, even though the documentation says that it does.

I've heard people say that you need to request special permissions to get it and other pieces of data, but I have not been successful in getting it to work.

Does anyone have an example, using the Facebook Graph API, of how to get the user's gender and/or location (city/state/country/whatever)?

+1  A: 

As far as I can tell some permissions like user_location simply aren't working at the moment. I can get email permissions and some others but for most of the user_... ones, nope. Yes they are wrong about gender as part of default data and there appears to be no permission for it either. So use the old api until the kinks in the new one get worked out.

Sandy Vanderbleek
Thanks for the feedback Sandy, that's exactly the results I've been getting as well.
Mark
http://fbrell.com/auth/extended-permissionsthis is a good place to test out which permissions work quickly!
Sandy Vanderbleek
+2  A: 

Just FYI, location (City and state only, country is still missing) and gender have been added to the Graph API sometimes today.

I was testing an app tonight and noticed there was a couple more fields :)

Pier-Luc Gendreau
Looks like the way they do location has changed. I used to have my City,State,Country, However now they use the city id (ie 108424279189115) to point to a Hub. The auto complete looks up the location name, and inserts the ID as the field value. What shows up from the API is whatever that hub (Page) title is - which may or may not show country.
Jason

related questions