It’s not currently possible to search by custom property via the HubSpot APIs. The closest you could come is to use the batch contacts APIs and filter the results based on your custom property.
This is an inefficient way to do it having knowing that for example if I have more than 10K contacts, and the result I expect to get are just 2 contacts.
Is this still unavailable? is there anyway to do this a little easier?