Count matching leads (free)
count_leadsGet a free lead count for an ICP and preview per-row costs before pulling records. Sizes an audience without spending credits, so run it first to plan and budget searches.
Instructions
How many leads match an ICP, and what pulling them would cost at this account's prices. Free: this call never spends credits. It is the only way to size an audience without paying per row, which makes it the first step before search_leads. A realtime count is not free ($0.04 flat at the Tier 0 list price); it runs only when mode:"realtime" is passed explicitly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Data mode. "database" = Generect's own index: sub-second, free counts, free thin rows (see detail) or cheaper full rows; it accepts a subset of the filters today and names any it rejects. "realtime" = live LinkedIn lookup, 5–60s, billed per row, accepts every realtime filter. "auto" (default) tries database first and escalates to realtime only if a filter you passed is rejected there (the escalation is reported, and is refused above the per-call spend ceiling). Pick "database" explicitly when you only need a size estimate and cost matters more than freshness. | |
| strict | No | Fields to match strictly, e.g. ["company_locations"]. | |
| keywords | No | Free-text keywords across headline/summary/skills — realtime only: using it forces the pricier live mode. | |
| personas | No | Advanced raw persona tuples [name, functions, seniorities, prohibits, priority?] — realtime only: using it forces the pricier live mode. | |
| functions | No | Job functions, e.g. ["Sales","Marketing","Engineering"] — realtime only: using it forces the pricier live mode. | |
| job_title | No | DEPRECATED alias for job_titles. Still honoured: it is merged into job_titles. | |
| locations | No | Where the lead lives — matches cities, states and countries, e.g. ["United States","Berlin"]. | |
| company_id | No | Anchor to one company by LinkedIn numeric id. | |
| job_titles | No | Target job titles, OR-matched (e.g. ["CEO","Founder","Owner"]). A lead needs to match only one. | |
| timeout_ms | No | Request timeout in milliseconds. | |
| exclude_ids | No | Skip leads by Generect/Sales-Navigator id. Pass the ids you already received to paginate without duplicates — ordering is not stable, so this is more reliable than offset. | |
| seniorities | No | Seniority at the current employer, e.g. ["Owner","CXO","VP","Director","Manager"]. Current position only. | |
| changed_jobs | No | Only leads who recently changed jobs — realtime only: using it forces the pricier live mode. | |
| company_link | No | Anchor to one company by LinkedIn URL. | |
| company_name | No | Anchor to one company by name (exclusive with company_link/company_id). | |
| company_types | No | Employer types: "Public Company","Privately Held","Non Profit","Government Agency","Educational","Self Employed","Self Owned","Partnership". | |
| exclude_names | No | Skip leads by full name. Works in both modes (the database-mode bug that returned 0 rows was fixed in the API on 2026-08-13, PRO-1333). exclude_ids is still the more reliable way to paginate. | |
| get_max_leads | No | DEPRECATED — accepted but ignored. Always on now: search responses include results_count without asking. | |
| company_filters | No | Optional: count leads only at companies matching these company filters (a two-level ICP). Still free in database mode. | |
| lead_industries | No | DEPRECATED — accepted but ignored. Removed: v1 filters on the employer's industry. Use company_industries. | |
| without_company | No | DEPRECATED — accepted but ignored. No longer needed — v1 filter-only search is the default when no company anchor is set. | |
| years_in_company | No | Time at current company, same buckets as years_in_position — realtime only: using it forces the pricier live mode. | |
| company_locations | No | HQ location of the lead's current employer. | |
| exclude_locations | No | Lead locations to exclude. | |
| filter_empty_vars | No | Drop leads where these fields are empty, e.g. ["profile_photo","job_started_on"]. Useful to raise data quality before paying. | |
| years_in_position | No | Time in current role: 1=<1y, 2=1-2y, 3=3-5y, 4=6-10y, 5=10y+ — realtime only: using it forces the pricier live mode. | |
| company_headcounts | No | Employer size buckets. Allowed ONLY: "1-10","11-50","51-200","201-500","501-1000","1001-5000","5001-10000","10 000+" (note the space in "10 000+"). | |
| company_industries | No | Industry of the current employer. Must match Generect industry names exactly (e.g. "Software Development", "Financial Services"); names are hierarchical and unknown names are rejected with HTTP 400 naming the field. | |
| past_company_names | No | Companies the lead previously worked at (alumni targeting) — realtime only: using it forces the pricier live mode. | |
| posted_on_linkedin | No | Only leads who recently posted on LinkedIn — realtime only: using it forces the pricier live mode. | |
| linkedin_filter_link | No | A LinkedIn / Sales Navigator search URL to lift filters from — realtime only: using it forces the pricier live mode. | |
| allow_unlisted_values | No | Escape hatch. This server checks industry / seniority / headcount / company-type values against the LinkedIn vocabularies before sending, because the API silently returns 0 results for an unknown industry or seniority instead of rejecting it. Set true only when you are sure a value is valid and this server is out of date. | |
| exclude_title_keywords | No | DEPRECATED — accepted but ignored. No v1 equivalent. Narrow job_titles instead, or filter the returned rows yourself. | |
| exclude_company_locations | No | Employer HQ locations to exclude. | |
| exclude_company_headcounts | No | Employer size buckets to exclude. | |
| exclude_company_industries | No | Employer industries to exclude. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fix | No | ||
| why | No | ||
| cost | No | ||
| mode | No | ||
| advice | No | ||
| status | No | ||
| options | No | ||
| test_mode | No | ||
| results_count | No | ||
| needs_realtime | No | ||
| test_mode_notice | No | ||
| next_step_estimate | No | ||
| vocabulary_warnings | No | ||
| blocked_by_vocabulary | No | ||
| deprecated_params_ignored | No |