lohaido.blogg.se

Facebook data extractor
Facebook data extractor





facebook data extractor
  1. #Facebook data extractor how to#
  2. #Facebook data extractor code#

To get the list of events, do: eventList = eventsĮxtracting all information for a event from the list of events extracted above: This will give a dictionary of all the events that have been created on Facebook and has string “Poetry” in its name. Now to find information on events for any search term say “Poetry” and limiting those events’ number to 10000: graph = facebook.GraphAPI(access_token=token, version = 2.7) events = graph.request(‘/search?q=Poetry&type=event&limit=10000’) token= ‘aiufniqaefncqiuhfencioaeusKJBNfljabicnlkjshniuwnscslkjjndfi’ Define a variable token and set its value to what you got above as “User Access Token”. This blog is primarily on getting events data.įirst of all, import ‘urllib3’, ‘facebook’, ‘requests’ if they are already available.

#Facebook data extractor how to#

Go to examples of codes after having selected these and then select “facebook graph api” and you will get hints on how to extract information. From this documentation, choose any field you want from which you want to extract data such as “groups” or “pages” etc. Go to link if want to collect data on anything that is available publicly.

#Facebook data extractor code#

Python Code to Access Facebook Public Data: This will ensure that your token does not expire every two hours.

facebook data extractor

Select “Debug” corresponding to “User Token”. Select permissions from the menu that appears and then select “Get Access Token.” From this drop down, select “Get User Access Token”. From “Graph API Explorer” drop down, select your app. You will see “Graph API Explorer” below “My Apps” in the top right corner. Again get back to the same link /tools/explorer.Choose a display name and a category and then “Create App ID”. Go to “My apps” drop down in the top right corner and select “add a new app”.To be able to extract data from Facebook using a python code you need to register as a developer on Facebook and then have an access token. I wrote a Python code to extract publicly available data on Facebook. I have moved on from struggling to code to being a bit comfortable since the first story. How to use Facebook Graph API and extract data using Python!







Facebook data extractor