Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching for a Facebook venue using geolocation

I'm trying to retrieve a venue's information by searching for it using a particular geolocation on facebook. I'm trying to do this using FQL.

For example, I want to retrieve a Starbucks places info (I know the Starbucks is actually there), so far i have come up with:

SELECT name, description, latitude, longitude, checkin_count
FROM place 
where page_id in ( SELECT page_id from place where name = 'Starbucks' ) and distance(latitude, longitude, "9.961718","-84.054542") < 1000

But unfortunately I only get the following error

"Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql "

Does someone know what am i doing wrong or how to do what i'm trying to?

like image 838
André Hess Avatar asked Dec 21 '25 06:12

André Hess


1 Answers

FQL answer (deprecated)

Since FQL is deprecated and unusable, you will now find the FQL way of doing this in the revision history of this post.

Graph API (up-to-date)

To find a place, you can use the Graph API Search.

Places: /search?q=coffee&type=place. You can narrow your search to a specific location and distance by adding the center parameter (with latitude and longitude) and an optional distance parameter: /search?q=coffee&type=place&center=37.76,-122.427&distance=1000

So, the Graph API query that might interest you, would be:

/search?q=Starbucks&type=place&center=9.961718,-84.054542&distance=1000

Also, note that distance represents meters.

like image 151
Stéphane Bruckert Avatar answered Dec 22 '25 21:12

Stéphane Bruckert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!