Facebook Graph API - how to get user country?
https://api.facebook.com/method/fql.query?format=json&query=SELECT%20current_location%20FROM%20user%20WHERE%20uid=4&access_token=<ACCESS_TOKEN>
[
{
"current_location": {
"city": "Palo Alto",
"state": "California",
"country": "United States",
"zip": "",
"latitude": 37.4441,
"longitude": -122.163,
"id": 104022926303756,
"name": "Palo Alto, California"
}
}
]
FQL Documentation
One solution I have found, which is merely a workaround, is to use the GeoNames API - http://www.geonames.org/export/web-services.html
Using something like:
http://api.geonames.org/search?q=houston%2C%20texas&featureClass=P&username=myusername
Returns results in an xml object, with the country as part of the data.
I'm not particularly happy with this as a solution however, as it adds an unnecessary layer of complications on to my application - plus requests to this free services are limited to 2000 per hour and 30,000 per day.