# Company Enrichment

Firmographics (size, revenue, founding year, location) for a company domain. Add them to your accounts for segmentation and routing.

**Credits:** 1 search credit when found. Lookups that find nothing cost nothing. See [Pricing and limits](/snowflake/pricing-and-limits).

## Inputs and options

Input: `domain` (Company domain)

This tool has no options.

## Try one value

```sql
CALL TOMBA.core.company_enrichment('acme.com');
```

The call returns the result as a `VARIANT` (example values, shortened):

```json
{
    "status": "found",
    "credits": 1,
    "results": [
        {
            "NAME": "Acme",
            "EMPLOYEES": "51-200",
            "FOUNDED_YEAR": "2012",
            "COUNTRY": "United States"
        }
    ]
}
```

`status` is `found`, `not_found`, `invalid` or `error`; `results` holds the output columns and `data` the complete
Tomba record.

## Run it over a table

Create a small table to try it (or use one of yours, after [granting the app access](/snowflake/installation#3-let-the-app-read-your-tables)):

```sql
CREATE OR REPLACE TABLE my_db.public.accounts (WEBSITE STRING);
INSERT INTO my_db.public.accounts VALUES
    ('acme.com'),
    ('globex.com');
GRANT USAGE ON DATABASE my_db TO APPLICATION TOMBA;
GRANT USAGE ON SCHEMA my_db.public TO APPLICATION TOMBA;
GRANT SELECT ON TABLE my_db.public.accounts TO APPLICATION TOMBA;
```

Run the tool, then read the results:

```sql
CALL TOMBA.core.enrich_companies('MY_DB.PUBLIC.ACCOUNTS', 'WEBSITE', 'ACCOUNTS_COMPANY_ENRICHMENT', 100);

SELECT INPUT_DOMAIN, NAME, EMPLOYEES, ANNUAL_REVENUE, FOUNDED_YEAR, COMPANY_TYPE, CITY, COUNTRY
  FROM TOMBA.results.ACCOUNTS_COMPANY_ENRICHMENT
 WHERE lookup_status = 'found';
```

Signature: `enrich_companies(input_table STRING, domain_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`

## Output columns

Each row has your `INPUT_<name>` columns, the tool's columns, and the common columns (`LOOKUP_STATUS`,
`CREDITS`, `DATA`, …). Every column, with its type and values: [Output columns](/snowflake/reference/output-columns#company-enrichment).

## Tips

- The domain column can hold full URLs (`https://www.acme.com/about`): the app keeps only the domain.
- To find new companies rather than enrich known ones, use Companies Search.

## Related

- [Companies Search](/snowflake/tools/companies-search)
- [Similar Domains](/snowflake/tools/similar-domains)
- [Domain Search](/snowflake/tools/domain-search)
