Skip to content

Instantly share code, notes, and snippets.

@arn-ob
Last active June 3, 2018 14:19
Show Gist options
  • Select an option

  • Save arn-ob/c3987942cebfa15b492374bcb545e83b to your computer and use it in GitHub Desktop.

Select an option

Save arn-ob/c3987942cebfa15b492374bcb545e83b to your computer and use it in GitHub Desktop.
Get Profile Info from facebook
"""
Created on Sun Jun 3 19:55:01 2018
@author: Arnob
"""
# pip install facebook-sdk
# make sure u install this properly
import facebook
"""
Get the token from Graph API Explore
https://developers.facebook.com/tools/explorer/
Then Click GET Token. Then Choose the information u want.
U can explore more at : https://developers.facebook.com/docs/graph-api/explorer/
"""
access_token = "YOUR_ACCESS_TOKEN"
graph = facebook.GraphAPI(access_token)
get_data = graph.get_object("me?fields=id,name,birthday,feed")
# Please make sure the data came before put here.
# Look is good or not ar Graph API Explore
# if everything okiee then the data will parse to the
get_data
# If you wanted to get spacific data. Put it in that way. You will get all the data
feed = get_data['feed']
feed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment