Help! I'm trying to search for public events by location using the Facebook Graph API. I've seen many posts saying that this is not possible with the current version of the Graph API out now or FQL. But, I do see sites with this feature as well as many FQL workarounds. None have been successful for me.
Here are my search parameters being requested from the API
/search?q=*&type=event¢er=10.4434041,-61.419835&distance=1000
It was my hope that this would be the answer, simply because it seems to cover the type event and specific location. But, I was wrong and I get a list of the same marketing event for a free samsung galaxy 20 years into the future in 30 different languages.
So I thought to query for the venue(place) in that specific location, which turned out successful, and then grab the id's from those venues and query each id one by one to see if there are any associated events to that specific venue. I don't know how to go about the second half of the query with the results of the first search query but this is what I have so far.
/search?type=place&q=*¢er=10.4434041%2C-61.419835&distance=1000&fields=name,id
Returns
{
"data": [
{
"name": "Valid Venue!",
"id": "740199068928858"
},
{
"name": "Valid Venue!",
"id": "522158807878843"
},
{
more valid venue data!!
}
}
I should also note that this venue search will give me all listed places in that location, which, I know is VERY bad and completely inefficient but I'm all out of ideas.
I'm not sure if this is the right path to go down but it seems like the most plausible solution I can think of to get events by location. Any guidance or at all would be greatly appreciated!!
Thanks!!
Tap Today, Tomorrow, or This Weekend to filter the events that show up in the search results. You can also change the location so you can look for events in other cities by tapping "Nearby" and changing the location before returning to the previous screen. You'll see events in that area for the day you chose.
The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.
The Legacy REST API is in the process of being deprecated, while the Graph API is the most current, so if you're unsure of which one to use, your best bet is to go with that one. As you suggested, the Graph API, just like the Legacy REST API, is in fact a RESTful API.
This used to work (or still works until August 7th 2016 if you have a v2.0 app, and the event was create by a page with a location/venue set) as described in
for example. With the Graph API itself, it is not possible to search for nearby events in one query.
What you could do is
Keep in mind that you'll have to filter yourself regarding passed events etc. It's very inefficient unfortunately...
EDIT 2017-12-20
You can use https://github.com/tobilg/facebook-events-by-location-core for this use case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With