Facebook Graph API: Get Events by Venue - facebook

Is there a way to query all the events for a specific venue?
I noticed that there is no such entity Venue - it is a structure inside the event object.
Assuming there isn't, what do you think about the following solution?
Query all the events in the proximity of the Venue (I got the venue coordinates)
Filter all events that do not match the Venue ID.
Thanks!

Unfortunately you are right. The only way forward being to filter all the events by venue.

As of right now there is not a way via pure SQL. It'll get pretty ugly having to track all the events, and there are no assurances you got every event. There may that one facebook user who invites his 30 best friends for a birthday party, though I presume that is not much a worry.

Related

Is it possible (again) to collect event data from Facebook API?

I run an event platform and am looking for a way to retrieve event data (name, date, location, description, etc.) from different events (festivals) on Facebook.
We were working on a connection when the Cambridge Analytica thing happened. Since then my developers have not found a new way to retrieve info, but I'm a bit skeptical.
As of now, it is not possible to get Page Events (which you want to get, i assume):
This is a restricted edge. You cannot request access at this time.
Source: https://developers.facebook.com/docs/graph-api/reference/page/events/

Facebook User vs Event (get RSVP status for user on event)

Is there any better way of checking RSVP status of user (logged in our application) vs. specific Event through Graph API, than calling /v2.3/{user_id}/events and going through all events to find the one we're interested into and get the rsvp_status field there?
What I've tried, and what didn't work:
/v2.3/{user_id}/events/{event_id}
/v2.3/{user_id}/events?event={event_id}
/v2.3/{user_id}/events?event_id={event_id}
calling all of them, to find out if user is in any of RSVP groups: /v2.3/{event_id}/{attending|invited|maybe|declined|noreply}?user={user_id}
Also FQL is not a solution, if anybody wants to C&P existing FQL answers, because that's deprecated since API v2.0
This related answer is also wondering about efficiency on using Graph API, because pulling all user's events and going through them is both time and resource expensive operation
Ok, so I found the answer, which is quite simple:
/v2.3/{event_id}/invited?user={user_id}
Currently this method will
return nothing, if user is not yet part of event (was never invited and never attended/maybe himself)
return one object, with user object and his rsvp_status
/invited (what we've seen from testing) contains both users that were invited to the event, and users that joined the event themselves (so don't get confused by the word invited, at least unless facebook changes the API again)

Facebook graph event date time for users acceptance

I'm trying to find a way to get the order in which people decided to attend some Facebook events, using Graph.
I can see who is attending the event, who declined, who "maybe", but I didn't find a way to get the date time when people accepted or declined the invite.
Is there a way to do so?
I could see a downgrade in the evaluation of my question. Does this mean that there is a simple way to solve it which I didn't find ?
Having a look here http://developers.facebook.com/docs/reference/fql/event_member/, I found that event_member contains a date time, which is the one of the event, not of the relation between event and user.
This is what I'm interested in, finding when the user accepted the invite.
Thanks for your comments ;-)
Cédric

How do I use Facebook's API to get all events that a set of users has been invited to?

Say I want to get all the events that Bob, Jane and Joe have been invited to. An event should only be returned if ALL THREE have been invited. What's the most efficient way to do this using Facebook's API? Obviously I could retrieve each user's events individually and then intersect them, but that seems slow.
Here's the relevant events table that can be queried using FQL: https://developers.facebook.com/docs/reference/fql/event_member/
However, it seems FQL doesn't support INTERSECT, which would be helpful here?
There doesn't seem to be a way to get just the events where some group of users are members. It seems like the best you can do is get all the events each person is attending:
SELECT eid, uid, rsvp_status FROM event_member WHERE
uid IN (BOB'S_UID, JANE'S_UID, JOE'S_UID)
The response will give you all events that any one of these people are attending. You'll need to loop through the response to find the events that all three people are attending.
I tried chaining together uid [=/IN] n's_UID statements with AND. That didn't work for a sample event that two of my friends were attending.

Facebook Graph API Data Incorrect

Small problem here. I have an event created on Facebook and am using the Graph API to get the number of attendees.
I get the list of attendees with PHP from https://graph.facebook.com/EVENTID/attending?access_token=TOKENHERE and it returns a list of names.
However, the number of attendees is about 6 people lower than what is shown on the Facebook event page. Why would these numbers not match? Is there something in particular I'm supposed to do in the code to get the entire list?
As answered in the comments:
This discrepancy is probably down to a number of the attendees having opted out of Facebook Platform, which means their data isn't passed to apps via the API. Can't be 100% sure without the Event ID, but its a likely reason. – Simon Cross
From the Graph API, the people who have not joined the event will not show up under /{eventid}/attending, you need to add in the users who are returned in /{eventid}/not_replied. The not_replied set seems to be a special set in the GraphAPI.. and if you look at the docs, there is a mention of only people who have joined the event.