I'm trying to access the past events of a given user. I'm using the following FQL query: SELECT eid, name, pic_square, start_time, end_time, location FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = me() AND rsvp_status != 'declined') AND start_time < 1338974650 ORDER BY start_time DESC LIMIT 0,20
(1338974650
is supposed to be the current UNIX timestamp). This works fine. However, facebook only returns a set of 4 events in my case, whereas facebook.com displays a lot more. Why is that?
Asked
Active
Viewed 1,743 times
1

mplappert
- 1,314
- 11
- 18
2 Answers
1
Yes. Facebook severely limits the amount of past items returned by an API call. When I visit one of my pages, I see over 75 events listed on the past events page. When I query the page's events using either FQL or Graph API, I only get 2 events. My guess is Facebook has a separate table that stores past events that isn't available via the API.
BTW, You can make your code simpler by replacing your timestamp with now()
.

cpilko
- 11,792
- 2
- 31
- 45
-
That's what I assumed, but that just sucks. I'll try a different, timestamp-based approach. `now()` wouldn't work in my case since I'm constructing the `start_time` timestamp so that I always get events that take place today even though they might have already started. – mplappert Jun 06 '12 at 12:13
-
Alright, using `start_time` to get older events doesn't work either. – mplappert Jun 06 '12 at 12:29
-2
if you query the event_member table by passing the uid, you will get all the events that were CREATED by the user. if you query the table by passing one eid, it gives you the members of the event and their rsvp statuses.
EDIT: try setting start_date > 0 as stated here it should show you ALL the events.

Luca S.
- 94
- 1
- 9
-
I mainly query the `event` table, not the `event_member` table. The subquery `SELECT eid FROM event_member WHERE uid = me() AND rsvp_status != 'declined'` is just in there to get all events the user's a member of, which is then used in the `WHERE eid IN` clause of my main query. The query works fine, I get the events that I'm interested in (which are **not** only the events the user created). I'm only asking about the LIMIT part. – mplappert Jun 06 '12 at 09:08
-
so u are telling me that with the query SELECT eid FROM event_member WHERE uid = me() AND rsvp_status != 'declined' you won't get only the events CREATED by you? are you sure? cause this is my case... I can only get the event that I created. – Luca S. Jun 06 '12 at 10:44
-
According to the first line of [the documentation, event_member](https://developers.facebook.com/docs/reference/fql/event_member/) "Contains the list of attendees for an event..." – cpilko Jun 06 '12 at 11:45
-
Yes, that's what I'm telling you. If you don't believe me, try the query yourself or read the documentation. – mplappert Jun 06 '12 at 12:28
-
ok, ok, I though you wanted to look for event another person has been invited that's not you or the one using your app. [here](https://developers.facebook.com/blog/post/486/) I found that you can set the start_date > 0 to get all the events that you have been invited to. – Luca S. Jun 06 '12 at 13:09