How to use the HG API in Clay

Prev Next

With Clay's native API enrichment, you can call the HG API directly, using your HG API credits at no additional Clay credit cost.

Why use HG data in Clay?

You can enrich your account lists with HG data to:

  • Build precise target account lists by filtering on firmographics, tech installs, and IT spend

  • Score and prioritize your accounts based on technology fit and buying signals

  • Create ABM segments using category spend and technographic profiles

  • Personalize your outreach with context on a company's tech stack and buying center

Available data points: firmographics, technology installs, category spend, buying center intelligence, and more. The data points available to you depend on your HG plan. See the HG API documentation for full details.

Prerequisite: You need an HG API key.

In this guide, you will learn how to:

  1. Match companies in your Clay table to HG company IDs

  2. Fetch firmographics and technographics data for your accounts

Step 1: Connect your HG API key to Clay

Every API call to HG requires authentication. Instead of entering your credentials each time you set up an enrichment, Clay lets you save them as a reusable authorization header. You create it once, and then select it whenever you add a new HG API enrichment column.

  1. Go to Settings → Connections → HTTP API (Headers)

  2. Click + Add connection

  3. Add you API key like in the example below

Step 2: Match your companies to HG

Before you can pull any HG data, you need to match the companies in your Clay table to their corresponding records in the HG database. This step gives you an HG company ID for each row, which you'll use in subsequent enrichment calls.

  1. Add an enrichment column and choose the HTTP API action.

  1. Go to Configure, then in the Account section, select the authorization header you created in Step 1.

  1. Enter the company match endpoint. In this example, we're matching on domain name:

https://api.hginsights.com/data-api/v1/company/match?domain_name=&limit=1

See the company match documentation for other match types (company name, HG ID, etc.).

  1. Set the request headers as shown below.

  1. Test on a few rows to confirm the match is working.

Step 3: Enrich with HG Data Points

Once your companies are matched, you can add enrichment columns to pull the data you need.

Firmographics:

  1. Duplicate the company match column from Step 2.

  2. Update the endpoint to: https://api.hginsights.com/data-api/v1/company/firmographic (see company info documentation)

  3. Change the method to POST and set the body to:

{
  "company_id": "[[HG ID]]",
  "fields": [
    "company_id",
    "company_name",
    "domain_name",
    "domain_name_normalized",
    "company_level",
    "city_name",
    "state_name",
    "postal_code",
    "country_name",
    "country_code",
    "continent_name",
    "subcontinent_name",
    "geopolitical_name",
    "industry_id",
    "industry_name",
    "naics_code",
    "naics_name",
    "sic_codes",
    "sic_names",
    "revenue_total",
    "revenue_band",
    "employees_total",
    "employees_band",
    "it_spend",
    "forbes_2000_rank",
    "fortune_500_rank",
    "global_hq_company_name",
    "global_hq_domain_name",
    "global_hq_domain_name_normalized",
    "global_hq_hg_id",
    "global_hq_city_name",
    "global_hq_state_name",
    "global_hq_postal_code",
    "global_hq_country_name",
    "global_hq_country_code",
    "global_hq_subcontinent_name",
    "global_hq_continent_name",
    "global_hq_geopolitical_name",
    "global_hq_employees_band",
    "global_hq_revenue_band",
    "global_hq_industry_id",
    "global_hq_industry_name",
    "global_hq_naics_code",
    "global_hq_naics_name",
    "global_hq_sic_codes",
    "global_hq_sic_names",
    "global_hq_forbes_2000_rank",
    "global_hq_fortune_500_rank"
  ]
}

Technographics:

  1. Duplicate the company match column from Step 2.

  2. Update the endpoint to: https://api.hginsights.com/data-api/v1/company/installs

  3. Change the method to POST and set the body. Here's an example that returns installs for specific products:

{
  "fields": [
    "product_id",
    "product_name",
    "vendor_name",
    "product_last_verified_date",
    "product_intensity",
    "country_code"
  ],
  "filters": {
    "company_id": "[[HG ID]]",
    "products": {
      "ids": [814, 1023],
      "inclusion_method": "ANY_PRESENT"
    }
  },
  "limit": 10,
  "offset": 0,
  "sorts": [
    {
      "direction": "DESC",
      "field": "product_intensity"
    }
  ]
}

To find the ID of the products you want to detect, use the product search in the HG platform (aka Product Catalog) and look for the id in the URL.

You can narrow results by adding filters for specific products, vendors, categories, or countries. See the full company installs documentation for all available filter options.

Step 4: Present results in different columns

  1. Create columns like “Product Names” with the list of products detected for this company

    Add a column “Formula” named “Product Names” and paste the following formula

    {{HG Techno}}?.data?.map(x => x?.product_name)?.filter(Boolean)?.join(", ") || ""

  1. Create a column “Has {Product Name}” like “Has Salesforce”

    Add a column “Formula” named “Has Salesforce” and paste the following formula
    MAKE SURE TO REPLACE THE NAME OF THE PRODUCT IN THE FORMULA

    ({{Product Names}}?.toLowerCase()?.includes("salesforce crm")) || false

  2. Create a column “{Product Name} Last Verified Date” like “Salesforce Last Verified Date”
    Add a column “Formula” named “Salesforce Last Verified Date” and paste the following formula
    MAKE SURE TO REPLACE THE NAME OF THE PRODUCT IN THE FORMULA

    ({{HG Techno}}?.data?.find(i => i?.product_name?.toLowerCase() === "salesforce crm")?.product_last_verified_date)?.split("T")[0] || ""