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

# Search local businesses

> PAT uses the active workspace. Defaults to a strict 5 km circle; integer radiusKm 1–100 is explicit. Preserve location, keywords, center, place ID and radius on pagination. Empty filtered pages can still have nextPageToken. Only new searches consume daily quota; pagination does not. Increasing radius starts a new search. Provider failures refund reservations; cancelling an accepted search does not. For NDJSON, parse each line as progress/complete with data, or error with error text. The complete event is authoritative and includes quota and any retry token. Progress snapshots may omit those fields.



## OpenAPI

````yaml /openapi.json post /api/v1/map-leads/search
openapi: 3.1.0
info:
  title: Nudgen Developer API
  version: 1.0.0
  description: >-
    REST API for contacts, campaigns, Lifetime triggers, sending domains, brand
    settings, AI drafts, and local Map Leads search/import. Most endpoints use a
    Personal Access Token; Lifetime triggers require a scoped team API key.
servers:
  - url: https://app.nudgen.net
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Map Leads
  - name: Identity
  - name: Contacts
  - name: Campaigns
  - name: Brand settings
  - name: AI
  - name: Team API keys
  - name: Sending domains
paths:
  /api/v1/map-leads/search:
    post:
      tags:
        - Map Leads
      summary: Search local businesses
      description: >-
        PAT uses the active workspace. Defaults to a strict 5 km circle; integer
        radiusKm 1–100 is explicit. Preserve location, keywords, center, place
        ID and radius on pagination. Empty filtered pages can still have
        nextPageToken. Only new searches consume daily quota; pagination does
        not. Increasing radius starts a new search. Provider failures refund
        reservations; cancelling an accepted search does not. For NDJSON, parse
        each line as progress/complete with data, or error with error text. The
        complete event is authoritative and includes quota and any retry token.
        Progress snapshots may omit those fields.
      operationId: searchMapLeads
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          description: >-
            Set application/x-ndjson for streamed progress; otherwise
            application/json.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MapLeadsSearchInput'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapLeadsSearchResult'
            application/x-ndjson:
              schema:
                type: string
              example: |
                {"type":"progress","data":{"leads":[]}}
                {"type":"complete","data":{"leads":[]}}
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapLeadsError'
        '401':
          description: Unauthorized or no active workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapLeadsError'
        '403':
          description: Daily search quota or contact plan limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapLeadsError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapLeadsError'
        '500':
          description: Provider failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapLeadsError'
components:
  schemas:
    MapLeadsSearchInput:
      type: object
      properties:
        location:
          type: string
          minLength: 1
          maxLength: 300
        keywords:
          type: string
          minLength: 1
          maxLength: 200
        radiusKm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 100
          default: 5
        pageToken:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 8192
        locationPlaceId:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 512
        lat:
          type:
            - number
            - 'null'
          minimum: -90
          maximum: 90
        lng:
          type:
            - number
            - 'null'
          minimum: -180
          maximum: 180
      required:
        - location
        - keywords
    MapLeadsSearchResult:
      type: object
      properties:
        center:
          type: object
          properties:
            lat:
              type: number
              minimum: -90
              maximum: 90
            lng:
              type: number
              minimum: -180
              maximum: 180
          required:
            - lat
            - lng
        leads:
          type: array
          items:
            $ref: '#/components/schemas/MapLead'
        nextPageToken:
          type:
            - string
            - 'null'
        quota:
          $ref: '#/components/schemas/MapLeadsQuota'
        enrichmentRetryToken:
          type:
            - string
            - 'null'
          format: uuid
      required:
        - center
        - leads
        - nextPageToken
    MapLeadsError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        quota:
          $ref: '#/components/schemas/MapLeadsQuota'
      required:
        - error
    MapLead:
      type: object
      properties:
        placeId:
          type: string
          minLength: 1
          maxLength: 512
        name:
          type: string
          minLength: 1
          maxLength: 300
        address:
          type: string
          minLength: 1
          maxLength: 500
        lat:
          type: number
          minimum: -90
          maximum: 90
        lng:
          type: number
          minimum: -180
          maximum: 180
        website:
          type:
            - string
            - 'null'
          maxLength: 2048
        domain:
          type:
            - string
            - 'null'
          maxLength: 253
        phone:
          type:
            - string
            - 'null'
          maxLength: 64
        rating:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 5
        categories:
          type: array
          maxItems: 30
          items:
            type: string
            minLength: 1
            maxLength: 80
        email:
          type:
            - string
            - 'null'
          maxLength: 254
        socials:
          type:
            - object
            - 'null'
          properties:
            linkedin:
              type: string
              maxLength: 2048
            facebook:
              type: string
              maxLength: 2048
            twitter:
              type: string
              maxLength: 2048
            instagram:
              type: string
              maxLength: 2048
        businessSummary:
          type: string
          maxLength: 1200
        businessSources:
          type: array
          maxItems: 4
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
                maxLength: 2048
                pattern: ^https?://
              title:
                type: string
                maxLength: 300
            required:
              - url
              - title
        enrichmentPending:
          type: boolean
          description: >-
            Website enrichment did not finish during the initial search; false
            after retry does not guarantee an email was found.
      required:
        - placeId
        - name
        - address
        - lat
        - lng
        - website
        - domain
        - phone
        - rating
        - categories
        - email
        - socials
    MapLeadsQuota:
      type: object
      properties:
        plan:
          type: string
        limit:
          type:
            - integer
            - 'null'
        used:
          type: integer
        remaining:
          type:
            - integer
            - 'null'
        resetAt:
          type: string
          format: date-time
          description: Next midnight UTC.
      required:
        - plan
        - limit
        - used
        - remaining
        - resetAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: Personal Access Token created from Settings -> API Keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.