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

# Estimate people search

> Pre-flight conservative credit estimate for POST /api/v1/people/search. Includes contact enrichment assumptions when includeContacts is true.

# POST /api/v1/people/search/estimate

> Estimate credits for async people search before queueing paid enrichment work.

Use this endpoint before `POST /api/v1/people/search` when you want to set
`maxCredits` or show users the credit risk of requesting contact enrichment.
The estimate is a conservative preflight ceiling. Actual settled credits are
based on measured usage and can be lower. Discovery risk scales with requested
result pages, so higher `limit` values can require a larger preflight ceiling
even when `includeContacts` is false.

## Example

```bash theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://developer.thehog.ai/api/v1/people/search/estimate \
  -H "X-Access-Key: ak_xxxxxxxxxxxxxxxx" \
  -H "X-Secret-Key: sk_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "VP Engineering at B2B SaaS companies",
    "limit": 10,
    "includeContacts": true,
    "contactFields": ["email"]
  }'
```

The response includes the standard estimate fields plus a breakdown. The base
people-search portion assumes one discovery charge per provider-result page
currently modeled as up to 25 people. When `includeContacts` is true, omitted
`contactFields` means both email and phone, matching the search endpoint.


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/people/search/estimate
openapi: 3.0.0
info:
  title: The Hog API
  description: Public API reference for The Hog.
  version: '1.0'
  contact: {}
servers:
  - url: https://developer.thehog.ai
security: []
tags: []
paths:
  /api/v1/people/search/estimate:
    post:
      tags:
        - People Search
      summary: Estimate people search
      description: >-
        Pre-flight conservative credit estimate for POST /api/v1/people/search.
        Includes contact enrichment assumptions when includeContacts is true.
      operationId: estimatePeopleSearch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostPeopleSearchDto'
      responses:
        '200':
          description: >-
            Conservative people search preflight estimate and contact enrichment
            breakdown.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeopleSearchEstimateDto'
        '400':
          description: The request body or parameters are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 400
                error: Bad Request
                message: Validation failed
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
                errors:
                  - property: body.query
                    message: query must be a string
                    constraints:
                      isString: query must be a string
        '401':
          description: Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 401
                error: Unauthorized
                message: Authentication is required.
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 500
                error: Internal Server Error
                message: An unexpected error occurred.
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
      security:
        - AccessKey: []
          SecretKey: []
components:
  schemas:
    PostPeopleSearchDto:
      type: object
      properties:
        query:
          type: string
          example: VP Engineering at hiring B2B SaaS companies in SF
          maxLength: 500
        limit:
          type: number
          default: 25
          minimum: 1
          maximum: 100
        includeSignals:
          type: boolean
          default: false
        includeContacts:
          type: boolean
          default: false
        contactFields:
          type: array
          minItems: 1
          maxItems: 2
          uniqueItems: true
          description: >-
            Contact fields to enrich when includeContacts is true. Omit to
            preserve legacy includeContacts=true behavior, which requests both
            email and phone.
          example:
            - email
          items:
            type: string
            enum:
              - email
              - phone
        maxCredits:
          type: number
          minimum: 0
          description: >-
            Maximum credits the people search operation may charge. When
            omitted, normal account limits apply.
          example: 2500
        filters:
          $ref: '#/components/schemas/EntitySearchFiltersDto'
        confirm:
          type: boolean
      required:
        - query
    PeopleSearchEstimateDto:
      type: object
      properties:
        estimatedCredits:
          type: number
          description: Estimated credits to be consumed
        likelySyncOrAsync:
          type: string
          enum:
            - sync
            - async
          description: Whether the real request will return 200 or 202
        expectedLatencyRange:
          type: string
          example: 30s-5m
        withinPlanLimits:
          type: boolean
        breakdown:
          $ref: '#/components/schemas/PeopleSearchEstimateBreakdownDto'
        assumptions:
          $ref: '#/components/schemas/PeopleSearchEstimateAssumptionsDto'
      required:
        - estimatedCredits
        - likelySyncOrAsync
        - withinPlanLimits
        - breakdown
        - assumptions
    PublicErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Validation failed
        path:
          type: string
          example: /api/v1/search
        requestId:
          type: string
          example: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
        timestamp:
          type: string
          example: '2026-05-21T09:08:10.000Z'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicValidationErrorItemDto'
      required:
        - statusCode
        - error
        - message
        - path
        - timestamp
    EntitySearchFiltersDto:
      type: object
      properties:
        titles:
          type: array
          items:
            type: string
        titleMatch:
          type: string
          enum:
            - exact
            - similar
        locations:
          type: array
          items:
            type: string
        industries:
          type: array
          items:
            type: string
        employeeCount:
          $ref: '#/components/schemas/EntityEmployeeCountFilterDto'
        signals:
          type: array
          items:
            type: string
        company:
          $ref: '#/components/schemas/EntityCompanyNestedFilterDto'
    PeopleSearchEstimateBreakdownDto:
      type: object
      properties:
        baseSearchCredits:
          type: number
          description: Conservative base estimate for the people discovery work.
        contactEnrichment:
          $ref: '#/components/schemas/PeopleSearchEstimateContactBreakdownDto'
      required:
        - baseSearchCredits
        - contactEnrichment
    PeopleSearchEstimateAssumptionsDto:
      type: object
      properties:
        mode:
          type: string
          example: conservative_preflight_ceiling
        description:
          type: string
          description: Human-readable explanation of the conservative estimate assumptions.
      required:
        - mode
        - description
    PublicValidationErrorItemDto:
      type: object
      properties:
        property:
          type: string
          example: body.query
        message:
          type: string
          example: query must be a string
        constraints:
          type: object
          additionalProperties:
            type: string
          example:
            isString: query must be a string
      required:
        - property
        - message
    EntityEmployeeCountFilterDto:
      type: object
      properties:
        min:
          type: number
          minimum: 0
        max:
          type: number
          minimum: 0
    EntityCompanyNestedFilterDto:
      type: object
      properties:
        names:
          type: array
          items:
            type: string
        domains:
          type: array
          items:
            type: string
        linkedinUrls:
          type: array
          items:
            type: string
        industries:
          type: array
          items:
            type: string
        employeeCount:
          $ref: '#/components/schemas/EntityEmployeeCountFilterDto'
        signals:
          type: array
          items:
            type: string
    PeopleSearchEstimateContactBreakdownDto:
      type: object
      properties:
        includeContacts:
          type: boolean
        fields:
          type: array
          description: >-
            Requested contact fields included in the estimate. Empty when
            includeContacts is false.
          items:
            type: string
            enum:
              - email
              - phone
        maxPeople:
          type: number
          description: >-
            Maximum people count used for contact enrichment cost risk. This is
            the request limit after defaults are applied.
        contactAttemptsPerFieldPerPerson:
          type: number
          description: >-
            Worst-case contact enrichment attempts assumed for each requested
            contact field on each returned person.
        estimatedCredits:
          type: number
          description: Estimated contact enrichment credits included in estimatedCredits.
      required:
        - includeContacts
        - fields
        - maxPeople
        - contactAttemptsPerFieldPerPerson
        - estimatedCredits
  securitySchemes:
    AccessKey:
      type: apiKey
      in: header
      name: X-Access-Key
      description: The public API key from the Credentials page.
    SecretKey:
      type: apiKey
      in: header
      name: X-Secret-Key
      description: The API secret shown when the credential is created.

````