import json
import urllib.request
API_KEY = 'YOUR_API_KEY'
API_ENDPOINT = "https://api.newsfilter.io/public/actions?token={}".format(API_KEY)
queryString = "symbols:NFLX AND publishedAt:[2020-02-01 TO 2020-05-20]"
payload = {
"type": "filterArticles",
"queryString": queryString,
"from": 0,
"size": 200
}
jsondata = json.dumps(payload)
jsondataasbytes = jsondata.encode('utf-8')
req = urllib.request.Request(API_ENDPOINT)
req.add_header('Content-Type', 'application/json; charset=utf-8')
req.add_header('Content-Length', len(jsondataasbytes))
response = urllib.request.urlopen(req, jsondataasbytes)
res_body = response.read()
articles = json.loads(res_body.decode("utf-8"))
print(articles)