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

# Prospects search

## POST /api/v1/public/prospects/search/

Search and filter prospects or companies using flexible filters. This endpoint allows you to find leads based on various criteria before adding them to a lead list.

* Auth: `X-API-Key`
* Method: `POST`

### Request Body

```json theme={null}
{
  "search_type": "PEOPLE",
  "page": 1,
  "page_size": 25,
  "filters": {
    "job_title": "VP",
    "industry": "Technology",
    "company_size": "51-200",
    "prospect_location": "United States"
  }
}
```

**Note:** Filter values can be strings, arrays, or objects with include/exclude logic. See Filter Options below for details.

### Parameters

| Parameter     | Type    | Required | Default  | Description                                                              |
| ------------- | ------- | -------- | -------- | ------------------------------------------------------------------------ |
| `search_type` | string  | No       | `PEOPLE` | Either `PEOPLE` or `COMPANY` to specify what type of leads to search for |
| `page`        | integer | No       | `1`      | Page number for pagination                                               |
| `page_size`   | integer | No       | `25`     | Number of results per page (max 100)                                     |
| `filters`     | object  | No       | `{}`     | Filter criteria (see below)                                              |

### Filter Options

Filters can be passed as:

* **Strings**: `"VP"` - Will search for this single value
* **Arrays**: `["VP", "Director"]` - Will search for any of these values
* **Objects**: `{"must": ["VP"], "doesnt": ["Intern"]}` - For include/exclude logic

#### For People Search (`search_type: "PEOPLE"`)

| Filter                      | Type                | Description                              | Example Values                                                                 |
| --------------------------- | ------------------- | ---------------------------------------- | ------------------------------------------------------------------------------ |
| `job_title`                 | string/array        | Job title(s) to search for               | `"VP"`, `["CEO", "Founder"]`                                                   |
| `seniority`                 | string/array        | Seniority/management level               | `"VP"`, `["Director", "C-Level", "VP"]`                                        |
| `department`                | string/array        | Department/function                      | `"Sales"`, `["Sales", "Marketing"]`                                            |
| `company_name`              | string/array/object | Company name(s)                          | `"Microsoft"`, `["Google", "Apple"]`, `{"must": ["Tech"], "doesnt": ["Corp"]}` |
| `company_size`              | string/array        | Company size range                       | `"51-200"`, `["51-200", "201-500"]`                                            |
| `industry`                  | string/array        | Industry sector                          | `"Technology"`, `["Technology", "Software"]`                                   |
| `prospect_location`         | string/array        | Geographic location                      | `"San Francisco, CA, United States"`, `["New York", "Los Angeles"]`            |
| `location_radius`           | integer             | Radius for location search (in km or mi) | `25`, `50`                                                                     |
| `location_radius_unit`      | string              | Unit for radius (`"km"` or `"mi"`)       | `"km"`, `"mi"`                                                                 |
| `years_experience`          | string/object       | Years of experience range                | `"5-10"`, `{"min": 5, "max": 10}`                                              |
| `job_change_range_days`     | integer             | Recently changed jobs (within X days)    | `90`, `180`                                                                    |
| `keywords`                  | string/array/object | Keywords in profile                      | `"SaaS"`, `["AI", "Machine Learning"]`                                         |
| `company_domains`           | string/array        | Company website domain(s)                | `"microsoft.com"`, `["google.com", "apple.com"]`                               |
| `company_industry_keywords` | string/array        | Keywords in company description          | `"AI"`, `["SaaS", "Cloud"]`                                                    |

#### Common Company Size Values

* `"1-10"` - 1-10 employees
* `"11-50"` - 11-50 employees
* `"51-200"` - 51-200 employees
* `"201-500"` - 201-500 employees
* `"501-1000"` - 501-1000 employees
* `"1001-5000"` - 1001-5000 employees
* `"5001-10000"` - 5001-10000 employees
* `"10000+"` - 10000+ employees

#### Common Seniority Levels

* `"Entry"`
* `"Senior"`
* `"Manager"`
* `"Director"`
* `"VP"`
* `"C-Level"`
* `"Owner"`

#### For Company Search (`search_type: "COMPANY"`)

| Filter                      | Type         | Description                     | Example Values                                  |
| --------------------------- | ------------ | ------------------------------- | ----------------------------------------------- |
| `company_name`              | string/array | Company name                    | `"Microsoft"`, `["Google", "Apple"]`            |
| `location`                  | string/array | Geographic location             | `"San Francisco, CA"`, `["New York", "Boston"]` |
| `industry`                  | string/array | Industry sector                 | `"Technology"`, `["Software", "SaaS"]`          |
| `company_size`              | string/array | Number of employees             | `"51-200"`, `["51-200", "201-500"]`             |
| `revenue`                   | string/array | Annual revenue range            | `"$10M-$50M"`, `["$10M-$50M", "$50M-$100M"]`    |
| `company_industry_keywords` | string/array | Keywords in company description | `"AI"`, `["SaaS", "Cloud"]`                     |

### Response (People)

```json theme={null}
{
  "success": true,
  "search_type": "PEOPLE",
  "total_count": 1247,
  "page": 1,
  "page_size": 25,
  "prospects": [
    {
      "id": 12345,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john.doe@company.com",
      "phone_number": "+1234567890",
      "linkedin_profile_url": "https://linkedin.com/in/johndoe",
      "job_title": "CEO",
      "location": "San Francisco, CA",
      "headline": "CEO at Tech Company",
      "company": {
        "id": 678,
        "name": "Tech Company",
        "website_url": "https://techcompany.com",
        "linkedin_url": "https://linkedin.com/company/techcompany",
        "industry": "Technology",
        "location": "San Francisco, CA",
        "amount_of_employees": "51-200"
      }
    }
  ]
}
```

### Response (Companies)

```json theme={null}
{
  "success": true,
  "search_type": "COMPANY",
  "total_count": 543,
  "page": 1,
  "page_size": 25,
  "companies": [
    {
      "id": 678,
      "name": "Tech Company",
      "website_url": "https://techcompany.com",
      "linkedin_url": "https://linkedin.com/company/techcompany",
      "logo_url": "https://logo.clearbit.com/techcompany.com",
      "industry": "Technology",
      "location": "San Francisco, CA",
      "amount_of_employees": "51-200",
      "revenue": "$10M-$50M"
    }
  ]
}
```

### Error Responses

#### 400 Bad Request

```json theme={null}
{
  "error": "search_type must be either 'PEOPLE' or 'COMPANY'"
}
```

#### 403 Forbidden

```json theme={null}
{
  "success": false,
  "error": "search_limit",
  "message": "You have reached the maximum number of searches per month"
}
```

### Example Usage

#### Example 1: Simple String Filters

```bash theme={null}
curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "search_type": "PEOPLE",
    "page": 1,
    "page_size": 25,
    "filters": {
      "job_title": "VP",
      "industry": "Technology",
      "company_size": "51-200"
    }
  }'
```

#### Example 2: Array Filters (Multiple Options)

```bash theme={null}
curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "search_type": "PEOPLE",
    "filters": {
      "job_title": ["CEO", "Founder", "Co-Founder"],
      "seniority": ["C-Level", "VP"],
      "department": ["Sales", "Marketing"],
      "prospect_location": ["San Francisco, CA, United States", "New York, NY, United States"],
      "company_size": ["51-200", "201-500"]
    }
  }'
```

#### Example 3: Include/Exclude Logic

```bash theme={null}
curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "search_type": "PEOPLE",
    "filters": {
      "job_title": {
        "must": ["VP", "Director"],
        "doesnt": ["Intern", "Associate"]
      },
      "keywords": {
        "must": ["SaaS", "B2B"],
        "doesnt": ["Retail"]
      }
    }
  }'
```

#### Example 4: Location with Radius

```bash theme={null}
curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "search_type": "PEOPLE",
    "filters": {
      "prospect_location": "San Francisco, CA, United States",
      "location_radius": 50,
      "location_radius_unit": "km"
    }
  }'
```

#### Example 5: Python SDK

```python theme={null}
import requests

# Simple search
response = requests.post(
    "https://api.seleqt.ai/api/v1/public/prospects/search/",
    headers={"X-API-Key": "<your-api-key>"},
    json={
        "search_type": "PEOPLE",
        "page": 1,
        "page_size": 50,
        "filters": {
            "job_title": "VP",
            "industry": "Technology",
            "company_size": "51-200"
        }
    }
)

data = response.json()
if data["success"]:
    prospects = data["prospects"]
    print(f"Found {data['total_count']} total prospects")
    for prospect in prospects:
        print(f"{prospect['first_name']} {prospect['last_name']} - {prospect['job_title']}")

# Advanced search with multiple filters
response = requests.post(
    "https://api.seleqt.ai/api/v1/public/prospects/search/",
    headers={"X-API-Key": "<your-api-key>"},
    json={
        "search_type": "PEOPLE",
        "filters": {
            "job_title": ["CEO", "Founder"],
            "seniority": ["C-Level"],
            "department": ["Sales", "Marketing"],
            "years_experience": {"min": 10, "max": 20},
            "prospect_location": ["United States"],
            "company_size": ["51-200", "201-500"]
        }
    }
)
```

#### Example 6: Company Search

```bash theme={null}
curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "search_type": "COMPANY",
    "filters": {
      "industry": "Technology",
      "company_size": "51-200",
      "location": "United States"
    }
  }'
```
