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

# Search accounts by filters

> Search and extract company accounts based on industry, location, size, and keyword filters

Search and extract company accounts using powerful filters including industry, location, company size, and keywords. This endpoint processes results asynchronously and sends enriched account data to your webhook URL.

## Overview

This endpoint allows you to search for companies based on various criteria without needing to provide a LinkedIn Sales Navigator URL. The process is asynchronous - you'll receive an immediate response with the import job details and a preview of matching accounts, and the complete enriched results will be sent to your webhook URL when processing is complete.

## Rate Limits

* **1 request per second** per user/IP address

## Search Filters

### Industries

Target or exclude specific industries using industry IDs. Multiple industry IDs are combined with OR logic.

**Parameters:**

* `included_industries`: Array of industry IDs to target
* `excluded_industries`: Array of industry IDs to exclude from results

For the complete list of industry IDs, see the [LinkedIn Industry List](https://docs.google.com/spreadsheets/d/1qTFPVfcSHnL5PU1AcQlzD8mCmfSICKJ4WuU-OBGhkdI/edit?gid=0#gid=0).

Common industry IDs include:

* `4` - Automotive
* `6` - Technology, Information and Internet
* `12` - Education
* `43` - Financial Services
* `96` - Software Development

### Locations

Use the [Location IDs endpoint](/api-reference/endpoints/miscellaneous/location-ids) to find valid location IDs. You can include or exclude specific locations:

* `included_locations`: Target specific countries, states, or cities
* `excluded_locations`: Exclude specific locations from results

### Company Size

Filter by employee count ranges:

* `1-10` - Startup/Very Small
* `11-50` - Small
* `51-200` - Medium
* `201-500` - Medium-Large
* `501-1000` - Large
* `1001-5000` - Very Large
* `5001-10000` - Enterprise
* `10001+` - Mega Corporation

Multiple size ranges can be used

### Keyword

Search for companies by keyword in their name or description. This is useful for targeting specific niches or technologies (e.g., "saas", "fintech", "healthcare").

### Revenue

Filter companies by their annual revenue range. Revenue values are specified in millions and can be combined with a currency code.

**Parameters:**

* `min_revenue`: Minimum annual revenue (in millions). Valid values: `0`, `0.5`, `1`, `2.5`, `5`, `10`, `20`, `50`, `100`, `500`, `1000`
* `max_revenue`: Maximum annual revenue (in millions). Valid values: `0.5`, `1`, `2.5`, `5`, `10`, `20`, `50`, `100`, `500`, `1000`, `1001` (where `1001` represents \$1B+)
* `revenue_currency`: Currency code for revenue values. Defaults to `USD` if not specified.

**Supported currencies:**

`USD`, `EUR`, `GBP`, `CAD`, `AUD`, `JPY`, `CNY`, `INR`, `BRL`, `SEK`, `NOK`, `DKK`, `SGD`, `HKD`, `NZD`, `THB`, `IDR`, `TRY`, `TWD`, `ILS`, `AED`, `RUB`

**Example:** To find companies with revenue between $10M-$50M:

```json theme={null}
{
  "min_revenue": 10,
  "max_revenue": 50,
  "revenue_currency": "USD"
}
```

## Limits

By default, the endpoint will process up to 1,000 matching accounts. You can set a lower limit using the `limit` parameter. The minimum of your specified limit and 1,000 will be used.

## Streaming Mode

When `streaming` is set to `true`, results will be sent to your webhook in batches as they are processed, rather than all at once when complete. This is useful for large searches where you want to start processing results immediately.

## Response

The endpoint returns immediately with:

* A unique import job ID for tracking
* The total number of accounts that will be processed
* A preview of the first 10 matching accounts

The complete enriched results will be sent to your webhook URL when processing is complete.

## Example Use Cases

### Find SaaS companies in US tech hubs

```json theme={null}
{
  "webhook_url": "https://your-webhook.com/accounts",
  "name": "US Tech SaaS Companies",
  "included_industries": ["6", "96"],
  "included_locations": ["103644278"],
  "company_size": ["51-200", "201-500"],
  "keyword": "saas"
}
```

### Target European fintech startups

```json theme={null}
{
  "webhook_url": "https://your-webhook.com/accounts",
  "name": "European Fintech Startups",
  "included_industries": ["43"],
  "included_locations": ["100506914", "105015875", "101165590"],
  "company_size": ["11-50", "51-200"],
  "limit": 500
}
```

### Find large automotive companies excluding specific regions

```json theme={null}
{
  "webhook_url": "https://your-webhook.com/accounts",
  "name": "Global Automotive Giants",
  "included_industries": ["4"],
  "excluded_locations": ["102221843"],
  "company_size": ["5001-10000", "10001+"]
}
```

### Find high-revenue tech companies in Europe

```json theme={null}
{
  "webhook_url": "https://your-webhook.com/accounts",
  "name": "High Revenue European Tech",
  "included_industries": ["6", "96"],
  "included_locations": ["100506914", "105015875"],
  "min_revenue": 100,
  "max_revenue": 1001,
  "revenue_currency": "EUR"
}
```


## OpenAPI

````yaml POST /accounts/search
openapi: 3.0.1
info:
  title: Pipecorn Accounts API
  description: Pipecorn Accounts API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /accounts/search:
    post:
      summary: Search accounts by filters
      description: >-
        Search and extract company accounts based on industry, location, size,
        and keyword filters. This endpoint processes results asynchronously and
        sends them to your webhook.


        By default the search runs live through LinkedIn Sales Navigator (`live:
        true`), which requires a connected Sales Navigator integration. Set
        `live: false` to serve everything from Pipecorn's companies database
        (Elasticsearch) instead, with no integration required.


        **Rate limit:** 1 request per second
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook_url:
                  type: string
                  format: uri
                  description: Webhook URL to receive the processed results
                  example: https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8
                name:
                  type: string
                  description: Name for the import job
                  example: Tech Companies in US
                included_industries:
                  type: array
                  items:
                    type: string
                  description: List of industry IDs to include in the search
                  example:
                    - '4'
                    - '6'
                    - '96'
                excluded_industries:
                  type: array
                  items:
                    type: string
                  description: List of industry IDs to exclude from the search
                  example:
                    - '12'
                included_locations:
                  type: array
                  items:
                    type: string
                  description: >-
                    List of location IDs to include in the search. Use the
                    /locations endpoint to get valid location IDs
                  example:
                    - '103644278'
                    - '105015875'
                excluded_locations:
                  type: array
                  items:
                    type: string
                  description: List of location IDs to exclude from the search
                  example:
                    - '102221843'
                company_size:
                  type: array
                  items:
                    type: string
                    enum:
                      - 1-10
                      - 11-50
                      - 51-200
                      - 201-500
                      - 501-1000
                      - 1001-5000
                      - 5001-10000
                      - 10001+
                  description: Company size ranges to include
                  example:
                    - 11-50
                    - 51-200
                keyword:
                  type: string
                  description: Keyword to search for in company names or descriptions
                  example: saas
                min_revenue:
                  type: number
                  description: >-
                    Minimum annual revenue in millions. Valid values: 0, 0.5, 1,
                    2.5, 5, 10, 20, 50, 100, 500, 1000
                  enum:
                    - 0
                    - 0.5
                    - 1
                    - 2.5
                    - 5
                    - 10
                    - 20
                    - 50
                    - 100
                    - 500
                    - 1000
                  example: 10
                max_revenue:
                  type: number
                  description: >-
                    Maximum annual revenue in millions. Valid values: 0.5, 1,
                    2.5, 5, 10, 20, 50, 100, 500, 1000, 1001 (where 1001
                    represents $1B+)
                  enum:
                    - 0.5
                    - 1
                    - 2.5
                    - 5
                    - 10
                    - 20
                    - 50
                    - 100
                    - 500
                    - 1000
                    - 1001
                  example: 50
                revenue_currency:
                  type: string
                  description: >-
                    Currency code for revenue values. Defaults to USD if not
                    specified
                  enum:
                    - USD
                    - EUR
                    - GBP
                    - CAD
                    - AUD
                    - JPY
                    - CNY
                    - INR
                    - BRL
                    - SEK
                    - NOK
                    - DKK
                    - SGD
                    - HKD
                    - NZD
                    - THB
                    - IDR
                    - TRY
                    - TWD
                    - ILS
                    - AED
                    - RUB
                  default: USD
                  example: USD
                limit:
                  type: integer
                  description: 'Maximum number of accounts to extract (default: 1000)'
                  example: 100
                streaming:
                  type: boolean
                  description: Enable streaming mode for real-time results
                  default: false
                  example: false
                live:
                  type: boolean
                  description: >-
                    Data source toggle. `true` (default) searches live through
                    LinkedIn Sales Navigator and requires a connected Sales
                    Navigator integration. `false` serves the count, preview,
                    and extracted accounts from Pipecorn's companies database
                    (Elasticsearch) instead, with no integration required. A
                    non-boolean value returns `422`.
                  default: true
                  example: true
              required:
                - webhook_url
            example:
              webhook_url: https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8
              name: Tech Companies in US
              included_industries:
                - '6'
              excluded_industries:
                - '12'
              included_locations:
                - '103644278'
              company_size:
                - 51-200
                - 201-500
              keyword: saas
              min_revenue: 10
              max_revenue: 100
              revenue_currency: USD
              limit: 500
              streaming: false
      responses:
        '201':
          description: Account search started successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      Account search started successfully. You will receive the
                      results on your webhook shortly.
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier for the import job
                    example: 8e1dcba0-f0bb-4071-99fc-f18ba6559ccc
                  total:
                    type: integer
                    description: Total number of accounts that will be processed
                    example: 342
                  preview:
                    type: array
                    description: Preview of the first 10 matching accounts
                    items:
                      type: object
                      properties:
                        company_name:
                          type: string
                          example: Pipecorn
                        industry:
                          type: string
                          example: Technology, Information and Internet
                        linkedin_id:
                          type: string
                          example: '104885158'
                        linkedin_url:
                          type: string
                          format: uri
                          example: https://www.linkedin.com/company/104885158
              example:
                message: >-
                  Account search started successfully. You will receive the
                  results on your webhook shortly.
                id: 8e1dcba0-f0bb-4071-99fc-f18ba6559ccc
                total: 342
                preview:
                  - company_name: Pipecorn
                    industry: Technology, Information and Internet
                    linkedin_id: '104885158'
                    linkedin_url: https://www.linkedin.com/company/104885158
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_webhook:
                  summary: Missing webhook URL
                  value:
                    error: 400
                    message: Webhook URL is required
                invalid_company_size:
                  summary: Invalid company size
                  value:
                    error: 400
                    message: Invalid company size values
                invalid_location:
                  summary: Invalid location ID
                  value:
                    error: 400
                    message: Invalid location ID
                invalid_min_revenue:
                  summary: Invalid min_revenue value
                  value:
                    error: 422
                    message: >-
                      min_revenue must be one of: 0, 0.5, 1, 2.5, 5, 10, 20, 50,
                      100, 500, 1000
                invalid_max_revenue:
                  summary: Invalid max_revenue value
                  value:
                    error: 422
                    message: >-
                      max_revenue must be one of: 0.5, 1, 2.5, 5, 10, 20, 50,
                      100, 500, 1000, 1001
                invalid_revenue_currency:
                  summary: Invalid revenue_currency
                  value:
                    error: 422
                    message: >-
                      revenue_currency must be one of: USD, EUR, GBP, CAD, AUD,
                      JPY, CNY, INR, BRL, SEK, NOK, DKK, SGD, HKD, NZD, THB,
                      IDR, TRY, TWD, ILS, AED, RUB
        '401':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 401
                message: Insufficient credits
        '429':
          description: Rate limit exceeded (1 request per second)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 429
                message: Too many requests
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 500
                message: Internal server error
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````