开发者

Can you obtain friends' postcodes via the facebook api?

Does the facebook api expose friends postcodes? Ie is it possible to make a call to the api and have it return a list of postcodes of your friends which have address information listed under the "friends only" privacy s开发者_运维问答etting?


In short no. Very few people have their addresses on Facebook and the graph API does not expose those fields anyway, just like it does not expose mobile phone numbers.


I recently came up with a workaround for an application of my own. Through Facebook permissions, pull the users location (City, State) out of his/her basic information. With that, you can make an HTTP request to the Google Geocoding API. Make sure to pass the users City and State, and in return, the API will spit out a JSON encoded response containing a handful of useful data -- including the postal code that you're looking for.

See: http://code.google.com/apis/maps/documentation/geocoding/#GeocodingRequests

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜