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

# Count companies matching a query — free

> **Requires `x-api-key` header.**

Rate limit: 5 requests/second per API key.

Returns `total` matching companies without returning profiles. Same `query` filters and validation as POST /company-search — use this to test filters (especially `industry` labels) before paying per result.

**Price:** Free.



## OpenAPI

````yaml /openapi.json post /company-search-count
openapi: 3.0.3
info:
  title: Huntr — The GTM Intelligence API
  description: >-
    Give AI agents company, people, contact, and web intelligence through one
    API. Search accounts, build targeted lists, enrich leads, find contacts, and
    uncover buying signals.


    **Authentication:** Authenticated endpoints require an `x-api-key` header
    with your Huntr API key. Get a key by signing up via `POST /keys/create`.
    Public endpoints (pricing, sign-up, health) work without a key.


    **Rate limit:** 5 requests/second per API key on authenticated endpoints.
  version: 2.0.0
servers:
  - url: https://api.tryhuntr.com
security: []
tags:
  - name: Research
    description: >-
      Research one company, person, team, or focused business question and
      return a sales-ready answer. Lite, standard, and deep tiers.
  - name: Companies
    description: >-
      Search companies and enrich firmographics. Per-result pricing on search;
      count endpoints are free.
  - name: People
    description: >-
      Search people and enrich contacts — work email, phone, and related lookup
      endpoints.
  - name: LinkedIn
    description: >-
      LinkedIn URL discovery, company and profile pages, posts, reactions, and
      comments.
  - name: X
    description: X profiles, posts, search results, and thread context.
  - name: Web
    description: >-
      Find and analyze pages on a domain, plus tech stack, domain contacts, and
      job postings.
  - name: Account
    description: >-
      Sign up, verify email, recover keys, check balance, view usage, add
      credits, and read the public pricing matrix.
  - name: System
    description: Health check.
paths:
  /company-search-count:
    post:
      tags:
        - Companies
      summary: Count companies matching a query — free
      description: >-
        **Requires `x-api-key` header.**


        Rate limit: 5 requests/second per API key.


        Returns `total` matching companies without returning profiles. Same
        `query` filters and validation as POST /company-search — use this to
        test filters (especially `industry` labels) before paying per result.


        **Price:** Free.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: object
                  description: >-
                    At least one filter required. Combine multiple filters — all
                    must match (AND). See each field for match rules. Invalid
                    `industry` or `type` values return HTTP 400 with
                    `accepted_values`. Use POST /company-search-count to preview
                    `total` for free.
                  properties:
                    name:
                      type: object
                      description: >-
                        **Company legal/display name.** Open text — substring
                        match (not exact). Use when you do not know the domain.
                        Prefer `domain` when you have stripe.com-style
                        identifiers for exact company matching. Example: `{
                        "include": ["Stripe", "Bell Security Solutions Inc."]
                        }`.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    lid:
                      type: object
                      description: >-
                        **LinkedIn company vanity ID** — the slug at the end of
                        `linkedin.com/company/{lid}`. Example: `google` from
                        `https://www.linkedin.com/company/google/`. Exact match
                        on that ID. Best for looking up one known company page.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    urn:
                      type: object
                      description: >-
                        **LinkedIn company URN (numeric ID only).** Example:
                        `"1527"`. Do not pass the full
                        `urn:li:fs_salesCompany:…` string — numeric ID only.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    companyId:
                      type: object
                      description: >-
                        **Flexible company identifier.** Accepts any of: website
                        domain (`stripe.com`), numeric URN (`5678`), full
                        LinkedIn company URL, or vanity name (`stripe` from
                        `linkedin.com/company/stripe`). Use when you have a URL
                        or mixed ID formats. Prefer `domain` for bulk domain
                        lists.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    type:
                      type: object
                      description: >-
                        **LinkedIn company type (legal structure).** Must be
                        exact labels. Allowed: `Privately Held`, `Sole
                        Proprietorship`, `Self-Employed`, `Partnership`, `Public
                        Company`, `Nonprofit`, `Educational Institution`,
                        `Government Agency`. This is **not** funding stage — use
                        `keyword` for terms like "Series A" or "seed". Huntr
                        returns 400 with full `accepted_values` if a label is
                        wrong.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    industry:
                      type: object
                      description: >-
                        **LinkedIn industry label (exact match).** Must match
                        LinkedIn's industry taxonomy exactly (e.g. `Software
                        Development`, not `Software` or `SaaS`). Huntr validates
                        on request and returns HTTP 400 with `invalid_values`
                        and the full `accepted_values` list when a label is
                        wrong. Example: `{ "include": ["Software Development"]
                        }`.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    location:
                      type: object
                      description: >-
                        **Company headquarters location.** City, state, or
                        country name works; **alpha-2 country codes** (`US`,
                        `FR`, `GB`) give the best results. Example: `{
                        "include": ["US"] }`.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    domain:
                      type: object
                      description: >-
                        **Company website domain (exact).** Use bare domains
                        (`stripe.com`), not full URLs
                        (`https://www.stripe.com`). Strongly preferred over
                        `name` when you know the domain — avoids fuzzy name
                        collisions. Do not use `linkedin.com`.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    keyword:
                      type: object
                      description: >-
                        **Full-text search across the company profile** — name,
                        description, specialties, etc. Open text. Use for
                        concepts with no dedicated filter (e.g. "AI startup",
                        "higher education"). Not a substitute for exact
                        `industry` labels.
                      properties:
                        include:
                          type: array
                          items:
                            type: string
                          description: >-
                            Match companies where this field matches any listed
                            value.
                        exclude:
                          type: array
                          items:
                            type: string
                          description: Exclude companies matching any listed value.
                    headcount:
                      type: object
                      description: >-
                        **Employee count range (integer).** Use comparison
                        operators only: `>`, `<`, `>=`, `<=` — not `min`/`max`.
                        Multiple operators on one object are AND'd. Example: `{
                        ">": 10, "<": 500 }` matches 11–499 employees.
                      additionalProperties:
                        type: number
                      example:
                        '>': 10
                        <: 500
                    headcountGrowth:
                      type: object
                      description: >-
                        **Headcount growth rate (% over a period).** Required
                        shape: `{ "timespan": "6months"|"12months"|"24months",
                        "min": number, "max": number }`. Percent scale: `0` =
                        flat, positive = growth, negative = shrinkage, `-100` =
                        no employees left. `min`/`max` range: -100 to 10000.
                        Huntr validates `timespan` and returns 400 with allowed
                        values if invalid.
                      properties:
                        timespan:
                          type: string
                          enum:
                            - 6months
                            - 12months
                            - 24months
                          description: Measurement window.
                        min:
                          type: number
                          description: Minimum growth % (inclusive).
                        max:
                          type: number
                          description: Maximum growth % (inclusive).
                      example:
                        timespan: 6months
                        min: -10
                        max: 50
                    revenue:
                      type: object
                      description: >-
                        **Annual revenue range in USD (integer).** Same
                        operators as `headcount`: `>`, `<`, `>=`, `<=`. Example:
                        `{ ">": 1000000 }` for revenue above $1M.
                      additionalProperties:
                        type: number
                      example:
                        '>': 1000000
            example:
              query:
                industry:
                  include:
                    - Software Development
                headcount:
                  '>': 50
                location:
                  include:
                    - US
      responses:
        '200':
          description: Count result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  request_id:
                    type: string
                  total:
                    type: integer
                    description: Number of companies matching the query.
                  price:
                    type: number
                    description: Always 0 — this endpoint is free.
                  credits_remaining:
                    type: number
              example:
                success: true
                request_id: req_1746123456_cc2x3y
                total: 142
                price: 0
                credits_remaining: 5
        '400':
          description: >-
            Same validation as /company-search — invalid `industry`, `type`, or
            malformed query.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryValidationError'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Query failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    QueryValidationError:
      type: object
      description: >-
        Returned when a company-search query filter fails validation (invalid
        enum, unknown key, empty query).
      properties:
        error:
          type: string
          description: What went wrong.
        field:
          type: string
          description: >-
            JSON path to the bad filter, e.g. query.industry or
            query.headcountGrowth.timespan.
        invalid_values:
          type: array
          items:
            type: string
          description: Values you sent that were rejected.
        accepted_values:
          type: array
          items:
            type: string
          description: >-
            Full list of allowed values for that field (industry, type, or
            timespan).
      required:
        - error
        - field
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Huntr API key. Get one at tryhuntr.com. Pass as x-api-key header on
        all authenticated requests.

````