# Similar Domains

Companies similar to a domain (one row per similar company). Grow a target account list with companies similar to your best customers (lookalikes).

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

## Inputs and options

Input: `domain` (Company domain)

This tool has no options.

## Try one value

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

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

```json
{
    "status": "found",
    "credits": 1,
    "results": [
        {
            "SIMILAR_DOMAIN": "initech.com",
            "NAME": "Initech",
            "INDUSTRIES": "Software Development"
        },
        {
            "SIMILAR_DOMAIN": "globex.com",
            "NAME": "Globex",
            "INDUSTRIES": "Software Development"
        }
    ]
}
```

`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](../installation#3-let-the-app-read-your-tables)):

```sql
CREATE OR REPLACE TABLE my_db.public.best_customers (WEBSITE STRING);
INSERT INTO my_db.public.best_customers VALUES
    ('acme.com');
GRANT SELECT ON TABLE my_db.public.best_customers TO APPLICATION TOMBA;
```

Run the tool, then read the results:

```sql
CALL TOMBA.core.find_similar_domains('MY_DB.PUBLIC.BEST_CUSTOMERS', 'WEBSITE', 'BEST_CUSTOMERS_SIMILAR_FINDER', 100);

SELECT INPUT_DOMAIN, SIMILAR_DOMAIN, NAME, INDUSTRIES
  FROM TOMBA.results.BEST_CUSTOMERS_SIMILAR_FINDER
 WHERE lookup_status = 'found';
```

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

<Callout type="tip">
    Start with a small `max_rows` (like 100) to check the match rate on your
    data, then run the whole table, in the [background](../background-runs) if
    it is large.
</Callout>

## Output columns

Each row starts with `INPUT_<name>` columns (your values, unchanged) and then has:

`SIMILAR_DOMAIN`, `NAME`, `INDUSTRIES`, followed by the [common columns](../reference/output-columns)
(`LOOKUP_STATUS`, `CREDITS`, `DATA`, `SOURCE`, …).

## Tips

- The output has **one row per similar company**.
- Chain it: enrich the lookalikes with Company Enrichment, then find people with Domain Search.

## Related

- [Company Enrichment](./company-enrichment)
- [Companies Search](./companies-search)
- [Domain Search](./domain-search)
