Retrieving an Event

Problem

I need to retrieve a Facebook event using FQL.

Solution

If you have the eid (event ID) of the event, this is easy:

SELECT eid, name, pic_small, description, start_time,
 end_time, location FROM event WHERE eid = $eid;

You can, of course, SELECT a different set of fields.

Discussion

The only place you can get an eid using FQL is from the event_member table (see Event Member Table). This query will only return events that the current loggedinuser has permission to see.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.