'How can i get a list of all friends' names & birthdays from facebook
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)
Solution 1:[1]
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.
Solution 2:[2]
I found it GET
https://graph.facebook.com/v13.0/me?fields=friends%7Bbirthday%7D&access_token=
it doesn't get information when in "self" mode
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | andyrandy |
| Solution 2 | thuongsugar |
