1

Trying to retrieve facebook events through fql using the query below. I am unable to get venue details other than "id".

fql?q=SELECT name,description, pic_small,pic_big, eid,venue,location from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me())

output :

{
  "data": [
    {
      "name": "HappyHour",
      "description": "Let's have fun !!!",
      "pic_small": "http://profile.ak.fbcdn.net/static-ak/rsrc.php/v2/yy/r/XcB-JGXohjk.png",
      "pic_big": "http://profile.ak.fbcdn.net/static-ak/rsrc.php/v2/yn/r/5uwzdFmIMKQ.png",
      "eid": ......,
      "venue": {
        "id": .......
      },
      "location": "The Crab Pot Seattle"
    }
  ]
}

The graph api doc says "The venue where the event being queried is being held. Contains one or more of the following fields: street, city, state, zip, country, latitude, and longitude." but I don't see any of these except venue id.

Do I have to make another request to graph API to get the venue location details? Is there a better way to get the location details in one query itself?

akd
  • 1,427
  • 3
  • 16
  • 21
  • As what you quoted from the documentation says, one **or** more fields... As far as I know there's no way yo ask for the rest of the fields, you get what fb has. – Nitzan Tomer Jun 05 '12 at 17:53
  • Not sure whether facebook is returning me all the data. In the above result the venue id was "113801861983319". If I try http://graph.facebook.com/113801861983319 I see the location details. `code` { "id": "113801861983319", "name": "The Crab Pot Seattle", "website": "www.thecrabpotseattle.com", "username": "crabpotseattle", "location": { "street": "1301 Alaskan Way", "city": "Seattle", "state": "WA", "country": "United States", "zip": "98101-2013", "latitude": 47.605915163539, "longitude": -122.34114741484 }... } `code` – akd Jun 05 '12 at 18:22

1 Answers1

6

You can get the locations for events using this FQL Multiquery.

This will get your events and information about their venues. You'll have to write a script on your end to combine them into something usable.

fql?q={
 "event_info":
    "SELECT name,description, pic_small,pic_big, eid,venue,location 
      FROM event WHERE eid IN 
         (SELECT eid FROM event_member WHERE uid = me())", 
  "event_venue":
     "SELECT name, username, page_id, location 
        FROM page WHERE page_id IN 
          (SELECT venue.id FROM #event_info)"
 }

Facebook changed the default encoding for events sometime in April. It used to be that all location data always used to be returned. Since then only the id of the location has been returned.

cpilko
  • 11,792
  • 2
  • 31
  • 45