Skip to main content
Human guide: task steps and agent prompt →
Query a bounded free-company result and preserve its source identity before further enrichment.
Use the free company search contract for columns, limits, and snapshot semantics. These procedures query the shared company snapshot. They do not perform live web discovery.

Start from the CLI

Inspect free_simple_company_search for the live fields. Use a bounded exact-domain query when your CRM or CSV already contains normalized domains:
The direct command returns matching rows. --out writes row-shaped results to CSV. It does not modify the Database or the shared snapshot.

Practical SQL patterns

Resolve and normalize a target list

Use lowercase hostnames matching normalized_domain in the IN list. Preserve meaningful subdomains rather than collapsing them to another entity. The output gives you the snapshot’s company name and LinkedIn URL for review. It does not automatically overwrite CRM values.
For a small list that already has LinkedIn company URLs, use exact equality or IN as well:

Find candidates after an exact miss

Use a prefix only after an exact domain, LinkedIn URL, or company-name lookup misses. Inspect the returned domain before using a candidate downstream:

Build a bounded pilot segment

Count the segment, then request a small page with the same filters. Employee count is the upper bound of a source size bucket, not a live headcount.

Check coverage and source duplicates

Compare matched_domains with the number of unique normalized domains in your input file. Unmatched domains do not appear in the result, so this tool cannot label them as missing for you.
This query checks duplicate source records for the requested domains. It does not detect duplicate rows in your CRM or CSV.

Query from the API

Use the normal tool execution endpoint:
The response wraps the SQL result in data:

Use inside a Play

Save this as free-company-search.play.ts. Read the declared rows list, then store it with deepline.dataset so the result can be exported as a run dataset.
The result contains companies, a dataset with the four selected SQL columns, and count, its row count.Follow Build a Play to check this source, then Run Plays to execute it and retain its run ID. Export the returned dataset with deepline runs export <run-id> --dataset result.companies --out companies.csv.

Save matching companies to your workspace database

To save query results in your Database, use materialize_free_customer_companies. It runs the SQL query and upserts rows into enrichments.companies. domain and company_name are required. The query can return only these columns; the remaining fields are optional:
Saving replaces the fields of an existing row with the same domain. Omitted optional fields become null and can overwrite existing values. Review the projected columns before saving. Example:
Then query the saved rows with query_customer_db:

Review a TAM sample before expanding it

Define the market’s inclusion, exclusion, geography, and company entity before querying. Count operating companies or parents consistently; duplicate source records and subsidiaries can change a total without changing the market. Retain the query, source scope, snapshot context, source IDs, and unresolved domains with your export. The SQL counts describe this snapshot under your filters, not the entire market. Enrich only fields needed by your inclusion rule, using company-field acceptance for entity and headcount checks. Reconcile unique input domains against returned, excluded, and unresolved accounts before saving or expanding the sample.

Choose another source when a required field is absent

For TAM work, use this source when the ICP fits its documented fields:
  • Exact domains or company names
  • LinkedIn company URLs
  • Industry or location
  • Employee count or founding year
When the required signal is absent, inspect another supported source. Apollo requires an explicitly selected customer-credential route. Do not assume managed Apollo access.

Verify this task

Check source identity, returned columns, duplicate scope, unmatched input domains, and inclusion decisions. Keep source queries separate from materialization writes.