CRM Search API doesn't return properties

Hello Team,

I am working on CRM search API. I am trying to search the companies that having domain name equals to a value and return their company id, company name and state. Here’s my code:

import hubspot
from pprint import pprint
from hubspot.crm.contacts import PublicObjectSearchRequest, ApiException

client = hubspot.Client.create(access_token="My API Key")

filter_groups = [{"filters":[{
 "value":"Domain Name Value",
 "propertyName":"domain",
 "operator":"EQ"}]}]

public_object_search_request = PublicObjectSearchRequest(filter_groups=filter_groups,
properties=["hs_object_id","name","state","domain"],
limit=0, after=0)

try:
 api_response = client.crm.companies.search_api.do_search(public_object_search_request=public_object_search_request)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling search_api->do_search: %s\n" % e)

And the return is like:

BLai_0-1658783182019.png

I have verified that the ‘total: 76’ is exactly the number of companies meeting the requirement. So I guess the search api is working. The only problem is that it doesn’t return the properties I wanted. What should I do to the properties?

Thanks

@BLai

Try removing/updating your limit. Looks like you are requesting 0 to be returned.

Default is 10. Max is 100

Is there any way to get past the 100 limit

No, but you can page through the results of the result is more than 100

How do I do that within the python-hubspot client. I’m having a lot of trouble finding in-depth documentation for using this instead of regular http reqs

https://community.hubspot.com/t5/APIs-Integrations/Python-API-do-search-only-allows-100/td-p/859074

I made this post aboutit