Home > Software design >  How can i get a list of all friends' names & birthdays from facebook
How can i get a list of all friends' names & birthdays from facebook

Time:02-24

I need to get a list of all friends' names and birthdates from facebook to make a program to automatically send out birthday messages, but even after going through the facepy, and facebook documentation I couldn't find anything up to date that works.This is the closest i have gotten, this returns the amount of friends I have.

from facepy import GraphAPI

graph = GraphAPI('user_token')
query = graph.get("me")['name']  # user's name
print(query)
friend_count = graph.get("me/friends")['summary']['total_count']  # user's friend count
print(friend_count)

CodePudding user response:

Getting all friends is not possible anymore, since many years. You can only get friends who authorized your App too, and they need to authorize with the correct permission.

Automatically sending messages would not be possible anyway for other reasons too, there is no API to automatically send messages from user to user, for example.

CodePudding user response:

I found it GET

https://graph.facebook.com/v13.0/me?fields=friends{birthday}&access_token=

it doesn't get information when in "self" mode

  • Related