Reputation: 821
I'm relatively new to the facebook graph api. I'm the owner of a business page and I want to get some information about the fan (interest - pages they likes). How can I achieve that? This is what I wrote until this moment:
api_endpoint = "https://graph.facebook.com/v2.10/"
page_id = "1627395454223846"
node='/'+ page_id + '/insights/page_impressions'
url = api_endpoint+node
Now I create the graph object:
graph = facebook.GraphAPI(access_token=access["token"], version = 2.10)
I have had in mind to use requests but how?
I have to use it withe the graph object.
Thanks
Upvotes: 0
Views: 1086
Reputation: 14216
Using requests for this I think is preferred to be honest.
import requests
payload = {'access_token': access['token']}
api_endpoint = 'https://graph.facebook.com/v2.10'
page_id = '1627395454223846'
url = '{}/{}/insights/page_impressions'.format(api_endpoint, page_id)
resp = requests.get(url, params = payload)
...process data as you wish...
Upvotes: 1