Goutham
Goutham

Reputation: 297

How to get the Facebook Friends Birthdays for a particular date?

I want to get the facebook friends birthdays for a particular date.For example i want to get the friends birthday on date of feb 5th 2014.Is it possible.If it is possible please guide me and give your suggestions and code.

Upvotes: 1

Views: 175

Answers (1)

Tobi
Tobi

Reputation: 31479

You can use FQL to achieve this. Remember that you need the "friends_birthday" permission!

Try the following FQL query:

SELECT name, birthday, birthday_date FROM user 
WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) 
    AND (substr(birthday_date, 0, 2) = "02")
    AND (substr(birthday_date, 3, 2) = "05")
LIMIT 500

Try it here:

https://graph.facebook.com/fql?q=SELECT+name,birthday,birthday_date+FROM+user+WHERE+uid+in+(SELECT+uid2+FROM+friend+WHERE+uid1+=+me())+AND+(substr(birthday_date,+0,+2)+=+%2202%22)+AND+(substr(birthday_date,+3,+2)+=+%2205%22)+ORDER+BY+birthday_date+ASC+LIMIT+500&access_token={YOUR_ACCESS_TOKEN}

Upvotes: 2

Related Questions