I would like to execute an FQL query for retrieving all the public events in a specific area (using longitude,latitude and maximum distance or simply location name). Do you know if it's possible?
Apparently, somebody is able to do it, somehow: http://elmcity.info/fb_events?location=tokyo
I'm wrestling with this same problem right now. It does not look possible. There are several problems I see:
the location fields are not searchable in thepage
orplace
tables,AS
statement to query based on the result of a calculation, andWhat the referenced site seems to do is query
event.description
for the presence of the input string. Query "IKEA", and you'll get lots of results. Definitely not a geo search. (BTW, the site's source code is on GitHub).Edit:
Okay, I was wrong. Facebook does expose a search method, but only in the Graph API. Using the batch request functionality, you could execute a series of requests that:
place
entries within a distance (in meters) of a known lat/long. The graph api acceptsq=*
for the search string to return all places.event
to find all events at the places returned above.I'm going to play with this. I'll update this post again as I flesh out this code better.
It is possible indeed to receive events using location based "search" To do so you'll need the longitude and latitude coordinates of the location you want to search and a access_token with user_events permission (i think you could also use the public search)
Here's an FQL example how can you get all the events nearby of a location. (this searches from your and your friends events):
The trick itself lies in the venue.longitude and venue.latitude useage. To get events from a city, just get the city coordinates and adjust the offset to your needs. If you don't know how to use FQL please look into Facebook PHP SDK
I believe that in http://elmcity.info/fb_events?location=tokyo they are not really searching for events in Tokyo, they simply executing a query like this
https://graph.facebook.com/search?type=event&q=tokyo
(access token is needed, see https://developers.facebook.com/tools/explorer?method=GET&path=search%3Ftype%3Devent%26q%3Dhaifa)
Note that this url also works http://elmcity.info/fb_events?location=sport
I'm also looking for a way to retrieve public events using fql and so far I didn't find any.
try this code worked for me returns all details of the upcoming public event which contains a specific key word that can be your location