# coding: utf-8 # In[21]: import requests import json import string base_url = 'http://www.fairdomhub.org/' # In[22]: headers = {"Content-type": "application/vnd.api+json", "Accept": "application/vnd.api+json"} # In[23]: term = input("Enter the search term: ") # In[24]: print (term) # In[25]: url = "{0}search?q={1}".format(base_url, term) # In[26]: print (url) # In[27]: r = requests.get(url, headers=headers) # In[28]: print (r.text) # In[29]: json_r = json.loads(r.text) # In[30]: print (json_r) # In[31]: for entry in json_r['data']: print ("Type: {0} Title: {1}".format(entry['type'], entry['attributes']['title']))