API details.
hapikey = os.environ.get('HUBSPOT_API_KEY','demo')
#hapikey = 'demo'

hubspot_search(value, property='email', operator='EQ', hapikey=None, properties=None)

Search hubspot based on one filter condition.

# example
results = hubspot_search('andrewm4894@gmail.com', hapikey=hapikey)
results
{'total': 1,
 'results': [{'id': '4501051',
   'properties': {'createdate': '2019-09-09T21:11:35.717Z',
    'email': 'andrewm4894@gmail.com',
    'firstname': 'Andrew',
    'hs_object_id': '4501051',
    'lastmodifieddate': '2020-11-12T16:34:42.713Z',
    'lastname': 'Maguire'},
   'createdAt': '2019-09-09T21:11:35.717Z',
   'updatedAt': '2020-11-12T16:34:42.713Z',
   'archived': False}]}
# example with extra properties
results = hubspot_search('andrewm4894@gmail.com', hapikey=hapikey, properties=["firstname","city"])
results
{'total': 1,
 'results': [{'id': '4501051',
   'properties': {'city': 'Dublin',
    'createdate': '2019-09-09T21:11:35.717Z',
    'firstname': 'Andrew',
    'hs_object_id': '4501051',
    'lastmodifieddate': '2020-11-12T16:34:42.713Z'},
   'createdAt': '2019-09-09T21:11:35.717Z',
   'updatedAt': '2020-11-12T16:34:42.713Z',
   'archived': False}]}
# tests

results = hubspot_search('andrewm4894@gmail.com', hapikey=hapikey)
results_email = results['results'][0]['properties']['email']
assert results_email == 'andrewm4894@gmail.com'

results = hubspot_search('andrewm4894@gmail.com', hapikey=hapikey, properties=["city"])
results_city = results['results'][0]['properties']['city']
assert results_city == 'Dublin'