import http.client import json connection = http.client.HTTPSConnection('rest-api.lobbyview.org') headers = { 'token': 'Please login to use LobbyView's REST API!' } connection.request('GET', '/api/legislators?legislator_first_name=eq.John&legislator_last_name=eq.McCain', None, headers) response = connection.getresponse() data_string = response.read().decode('utf-8') data = json.loads(data_string) print(data)