> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Count database company leads

> Count cached company-lead matches. Database count endpoints are free.

## Use Case:

Count cached company-lead matches before retrieving them.

## Pricing

This endpoint is free — it does not incur any charges.


## OpenAPI

````yaml post /api/v1/search/database/company-leads/count/
openapi: 3.0.3
info:
  title: Generect API
  description: >-
    Welcome to the Generect API documentation. Here we will help you integrate
    and use our API.


    API base url: `https://api.generect.com` — every path below is relative to
    this host. Newer endpoints live under `/api/v1/...`, legacy endpoints under
    `/api/...`; use each path exactly as documented.

    Protocol: `HTTPS`


    # Authentication


    Get your API token from the Generect app settings and send it in the
    `Authorization` header with the required `Token` prefix.


    Example: `Authorization: Token xxxxxxxxx`


    # Rate limits


    You can request data depending on your data plan and account balance
    (default: 10000/month). Pricing depends on the operation and the number of
    results returned, and may increase with additional data flags. For exact
    pricing, see each endpoint's Pricing section or your billing settings:
    https://beta.generect.com/settings/billing


    # Note


    _Every endpoint must include the trailing `/`. Requests without the trailing
    slash may fail._
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.generect.com
security:
  - apiKey: []
tags:
  - name: 1. Auth
    description: Login and get user info
  - name: 2. Transactions
    description: List of latest transactions in your account
  - name: 3. Leads
    description: Fetch information about leads by _link/name/ICP_.
  - name: 4. Companies
    description: Fetch information about companies by link/name/ICP.
  - name: 5. Preview
    description: Search masked database leads for preview and reveal workflows.
  - name: 6. Enrich
    description: Enrich leads and companies by internal or external identifiers.
  - name: 7. Email
    description: Find and validate email addresses.
  - name: 8. Accounts
    description: Account profile, usage, and transactions.
  - name: 9. Search
    description: Database and realtime lead, company, and company-lead search.
  - name: 10. Phone
    description: Find phone numbers for leads.
  - name: 11. Webhooks
    description: Register and manage async job notifications.
paths:
  /api/v1/search/database/company-leads/count/:
    post:
      tags:
        - 9. Search
      summary: Count database company leads
      description: Count cached company-lead matches. Database count endpoints are free.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyLeadSearchRequest'
      responses:
        '200':
          description: Matching company-lead count
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyLeadsCountResponse'
              example:
                data:
                  results_count: 320
                  companies_count: 45
                  leads_count: 320
                meta:
                  amount_charged: 0
        '400':
          description: Validation error or insufficient balance.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Validation error:
                  value:
                    status: error
                    status_code: 400
                    detail:
                      non_field_errors:
                        - >-
                          company_search_criteria or lead_search_criteria must
                          be specified
                Insufficient funds:
                  value:
                    status: error
                    status_code: 400
                    detail: Insufficient funds in the account.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    CompanyLeadSearchRequest:
      type: object
      properties:
        company_search_criteria:
          $ref: '#/components/schemas/CompanySearchRequest'
        lead_search_criteria:
          $ref: '#/components/schemas/LeadSearchRequest'
      example:
        company_search_criteria:
          industries:
            - Software Development
          headcounts:
            - 51-200
          locations:
            - United States
        lead_search_criteria:
          job_titles:
            - CEO
          seniorities:
            - c_suite
          locations:
            - United States
    CompanyLeadsCountResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            results_count:
              type: integer
            companies_count:
              type: integer
            leads_count:
              type: integer
        meta:
          $ref: '#/components/schemas/Meta'
    Error:
      type: object
      description: Standard error envelope returned for 4xx/5xx responses.
      properties:
        status:
          type: string
          example: error
        status_code:
          type: integer
          example: 400
        detail:
          description: >-
            Human-readable message (string) for most errors, or a field-level
            validation map ({ field: [messages] }) for 400 validation errors.
          example: Insufficient funds in the account.
    CompanySearchRequest:
      type: object
      properties:
        industries:
          type: array
          items:
            type: string
          description: >-
            Industries of the target companies; a company is included if it
            matches at least one. Values follow LinkedIn's industry taxonomy.
            Examples: "Software Development", "Financial Services", "Information
            Technology".
        exclude_industries:
          type: array
          items:
            type: string
          description: Industries to exclude.
        headcounts:
          type: array
          items:
            type: string
          description: >-
            Company size, as employee-count ranges; a company is included if it
            falls into at least one. Allowed values: "1-10", "11-50", "51-200",
            "201-500", "501-1000", "1001-5000", "5001-10000", "10 000+".
        locations:
          type: array
          items:
            type: string
          description: >-
            Company headquarters locations — matches across cities,
            states/regions and countries; a company is included if its HQ
            matches at least one. Examples: "United States", "San Francisco,
            California, United States", "Germany".
        exclude_locations:
          type: array
          items:
            type: string
          description: Locations to exclude.
        company_types:
          type: array
          items:
            type: string
          description: >-
            Company types: "Public Company", "Privately Held", "Non Profit",
            "Government Agency", "Educational", etc.
        num_of_followers:
          type: array
          items:
            type: string
          description: >-
            Follower count ranges: "1-50", "51-100", "101-1000", "1001-5000",
            "5001+".
        keywords:
          type: array
          items:
            type: string
          description: >-
            Free-text keywords matched across company profiles (name,
            description, specialties); a company is included if it contains at
            least one. OR logic, max 10 keywords, up to 40 characters each.
            Examples: "platform", "marketplace", "developer tools".
        technologies:
          type: array
          items:
            type: string
          description: Technologies used by the company.
        company_names:
          type: array
          items:
            type: string
          description: Search by specific company names.
        exclude_ids:
          type: array
          items:
            type: string
          description: Exclude companies by LinkedIn ID or URN.
        exclude_domains:
          type: array
          items:
            type: string
          description: Exclude companies by domain.
        limit_by:
          type: integer
          description: Maximum number of companies to return (1-1600).
        offset_by:
          type: integer
          description: Number of companies to skip (0-1599, for pagination).
        strict:
          type: array
          items:
            type: string
          description: Fields to apply strict matching on (e.g. "company_locations").
      example:
        industries:
          - Software Development
        headcounts:
          - 51-200
        locations:
          - United States
        limit_by: 50
    LeadSearchRequest:
      type: object
      properties:
        job_titles:
          type: array
          items:
            type: string
          description: >-
            Job titles held by the people you want to find. A lead only needs to
            match one of the titles you provide — adding more expands your
            search. Results may also include similar titles (e.g. "marketing
            manager" can return "content marketing manager"). Combine with
            seniorities to target both function and level. Examples: "sales
            development representative", "marketing manager", "software
            engineer".
        seniorities:
          type: array
          items:
            type: string
          description: >-
            Job seniority levels at the lead's current employer (current
            position only, not previous roles). A lead needs to match at least
            one; adding more values expands your search. Allowed values: owner,
            founder, c_suite, partner, vp, head, director, manager, senior,
            entry, intern. Combine with job_titles to narrow targeting.
        locations:
          type: array
          items:
            type: string
          description: >-
            Geographic locations where leads currently live — matches across
            cities, states/regions and countries. A lead needs to match at least
            one. To filter by the employer's HQ location, use company_locations.
            Examples: "San Francisco, California, United States", "Germany",
            "London".
        exclude_locations:
          type: array
          items:
            type: string
          description: Locations to exclude from results.
        company_locations:
          type: array
          items:
            type: string
          description: >-
            Headquarters location of the lead's current employer; a lead is
            included if their company's HQ matches at least one. Filters by
            where the company is based — distinct from locations, which is where
            the lead personally lives.
        exclude_company_locations:
          type: array
          items:
            type: string
          description: Company locations to exclude.
        company_industries:
          type: array
          items:
            type: string
          description: >-
            Industries of the lead's current employer; a lead is included if
            their company matches at least one. Values follow LinkedIn's
            industry taxonomy. Examples: "Software Development", "Financial
            Services", "Information Technology".
        exclude_company_industries:
          type: array
          items:
            type: string
          description: Company industries to exclude.
        company_headcounts:
          type: array
          items:
            type: string
          description: >-
            Size of the lead's current employer, as employee-count ranges; a
            lead is included if their company falls into at least one. Allowed
            values: "1-10", "11-50", "51-200", "201-500", "501-1000",
            "1001-5000", "5001-10000", "10 000+".
        exclude_company_headcounts:
          type: array
          items:
            type: string
          description: Company size ranges to exclude.
        company_types:
          type: array
          items:
            type: string
          description: >-
            Company types: "Public Company", "Privately Held", "Non Profit",
            "Government Agency", "Educational", "Self Employed", "Partnership",
            "Self Owned".
        company_name:
          type: string
          description: >-
            Target company name (mutually exclusive with company_link and
            company_id).
        company_link:
          type: string
          description: >-
            LinkedIn company URL (mutually exclusive with company_name and
            company_id).
        company_id:
          type: integer
          description: >-
            LinkedIn company numeric ID (mutually exclusive with company_name
            and company_link).
        personas:
          type: array
          description: >-
            List of persona tuples. Each persona: [name, functions, seniorities,
            prohibits, priority?].
          items:
            type: array
        exclude_names:
          type: array
          items:
            type: string
          description: Skip leads by full name.
        exclude_ids:
          type: array
          items:
            type: string
          description: Skip leads by Sales Navigator ID.
        filter_empty_vars:
          type: array
          items:
            type: string
          description: >-
            Skip leads where these fields are empty. Options: job_started_on,
            profile_photo, started_at_position, company_website.
        limit_by:
          type: integer
          description: Maximum number of leads to return.
        offset_by:
          type: integer
          description: Number of leads to skip (for pagination).
        strict:
          type: array
          items:
            type: string
          description: Fields to apply strict matching on (e.g. "company_locations").
      example:
        job_titles:
          - CEO
          - Founder
        seniorities:
          - c_suite
        locations:
          - United States
        company_industries:
          - Software Development
        company_headcounts:
          - 51-200
        limit_by: 50
    Meta:
      type: object
      description: Operation metadata returned in every data/meta response.
      required:
        - amount_charged
      properties:
        amount_charged:
          type: number
          description: >-
            Actual amount charged for this request in USD, computed from your
            pricing tier. 0 for free operations and for not-found results (No
            Data — No Charge).
        status:
          type: string
          description: Set to "error" when the operation finished with an error.
        error:
          type: string
          description: Error details; present only when the operation failed.
        time_cached:
          type: string
          format: date-time
          description: >-
            When the cached result set was originally collected (returned by
            database company search when results are served from a previous
            identical search).
  responses:
    Unauthorized:
      description: Missing or invalid API token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            status_code: 401
            detail: Authentication credentials were not provided.
    Forbidden:
      description: Authenticated, but the account/plan is not allowed to use this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            status_code: 403
            detail: You do not have permission to perform this action.
    TooManyRequests:
      description: Rate limit exceeded — retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            status_code: 429
            detail: Request was throttled.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use the required Token prefix. Example: Authorization: Token xxxxxxxxx'

````