How Can I Find a Company Based on a Secondary Domain in HubSpot?

I’m using the HubSpot CRM API to search for companies by domain, which works fine for the primary domain. However, I need to find companies based on their secondary or additional domains.

Is there a way to search for a company using a secondary domain via the HubSpot API? If not, what are the best practices or workarounds for finding companies by these secondary domains?

Any help would be appreciated!

My API request looks like this:

{
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "domain",
 "operator": "EQ",
 "value": "example.com"
 }
 ]
 }
 ],
 "limit": 100
}

@newera - Have your tried “hs_additional_domains” in your code?

Hi @newera

HubSpot’s API primarily supports searching companies by their primary domain, and there isn’t a direct way to search by secondary or additional domains via the standard API endpoints. However, you can employ some workarounds to achieve your goal:
1. Store Secondary Domains in a Custom Property
2. Retrieve All Companies and Filter Locally

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!

Hi @GRajput
you can search by hs_additional_domains with https://api.hubapi.com/crm/v3/objects/companies/search

@HFisher7 Thanks this was what I was looking for :+1: