Search code examples
facebookfacebook-graph-apifacebook-events

Query near public events via Facebook API v2.2


I want to retrieve a list of upcoming public events in my hometown from the Facebook Graph API.

I already know that FQL is deprecated and that I can query by keywords using a statement similar to

/v2.2/search?type=event&q=Berlin&since=2015-01-27

However, this list is not enough because there are lots of events which do not contain the City Name either in the event title, description or Location name.

On the other hand I can retrieve a list of places within the same City by using

/v2.2/search?type=place&since=2015-01-27&center=52.52,13.41&distance=10000

In my assumption I could retrieve a better event list if I create a query stating "give me all public events (eid) of all given places within this city in a specified distance".

Does anybody know if this is somehow possible to query? I am unsure if batch processing is the right way to go, or if there is another possibility to Combine These two entities. My simple Approach would be to query each given Place again by requesting

/v2.2/{placeid}/events

but I also know that Facebook has a rate Limit of 50 requests in this case.


Solution

  • Right now Facebook doesn't have a way to do what you want or at least not documented.

    The only way I think you could it is: 1- Find with the facebook API the pages in one city. (You can do do this manually or search for places near the city and then use the places that also ara pages) 2- Get the events of the pages (if exists) and save this in a db also with the location of the place/page. 3- Show all the events of the city.