'Searching keywords using facebook graph API in Python

I recently started working on sentiment analysis for which I need data from Facebook/Instagram post/comment/replies. I plan to search a keyword or tag and would get data from the results. I looked up facebook graph api and some blogs and I found code of 2016 which did exactly that but it isn't working.

import urllib3
import facebook
import requests  

token= # mytoken
graph = facebook.GraphAPI(access_token=token, version = 3.1)
events = graph.request('/search?q=Poetry&type=event&limit=10000')

This code finds information on events for any search term say “Poetry” and limiting those events number to 10000

but when I run it I get the following error:

enter image description here

Tell me if it possible and what I should do to fix it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source