I am asked to analyze the data of Facebook insights from a companies Page. I want to use Python for the analysis so I am using the Facebook-sdk from python to access the API. I can't find any info how to get the insights from a page using this sdk, can somebody help me with this?
For example, a page like this https://www.facebook.com/nespresso . I do have access to their insights on facebook, and I used https://developers.facebook.com/tools/explorer to obtain an access token.
this is what I've tried but I expect results, and I don't get any.
graph = facebook.GraphAPI( ACCESS_TOKEN )
insights = graph.get_connections( page_id, "insights/page_views" )
print insights
but the only thing I get is this:
{'paging': {'next': 'h.ttps://graph.facebook.com/10151605375094653/insights/page_stories/page_post?access_token= xxxx', 'previous': 'h.ttps://graph.facebook.com/10151605375094653/insights/page_stories/page_post?access_token= xxxx'}, 'data': []}
xxxx
represents the accces token.
The "." in h.ttps
I put in myself because Stackoverflow compained that I couldn't post more than 2 links.
Thanks.