user3524309
user3524309

Reputation: 23

Getting Facebook event information from URL

I've been reading some stuff about Facebook API's but as a non-programmer it's kinda hard to understand it all. It's probably a pretty simple question.

My question: is it possible to get all the information like coverphoto, time, description, location etc. from a (random) public Facebook event from just the URL of the event?

So I will have a field 'Insert event URL' on my page. Below that I will have some fields like 'Location' 'Start time' 'End time' which will be automatically filled in when the user inserts the URL of an event.

Please let me know! A link to the source with explanation etc. would also be really nice. (It's for a school project)

Upvotes: 2

Views: 947

Answers (1)

Sahil Mittal
Sahil Mittal

Reputation: 20753

Yes you can. Ill try to explain you the simplest possible way to do that.

  1. First of all go to : http://developers.facebook.com/apps and create an app.

  2. Then, save the App access token which is: app_id|app_secret

  3. Your url will be of format: https://www.facebook.com/events/{event-id}. Fetch the event id from this. Quite simple right?

  4. Then you are going to use the facebook's powerful graph api. Just get the contents from : https://graph.facebook.com/{event-id}?access_token={app-access-token}

The list of all possible fields that you can get (only if set in the event of-course): https://developers.facebook.com/docs/graph-api/reference/user/events/#pubfields

That's it!

Upvotes: 1

Related Questions