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

# HarvestAPI: Search Leads

> Find LinkedIn profiles with HarvestAPI filters, including employees of one or more companies. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Find LinkedIn profiles with HarvestAPI filters, including employees of one or more companies.

<Info>
  Tool ID: `harvestapi_search_leads`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'harvestapi_search_leads',
  {
    "search": "software companies hiring engineers",
    "currentCompanies": "example",
    "pastCompanies": "example"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute harvestapi_search_leads --input '{
  "search": "software companies hiring engineers",
  "currentCompanies": "example",
  "pastCompanies": "example"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "elements": [
      {
        "linkedinUrl": "https://www.linkedin.com/in/jane-doe"
      }
    ],
    "status": "OK"
  }
}
```

Use `deepline tools get harvestapi_search_leads --json` for the latest machine-readable contract.

## Input reference

Searches LinkedIn profiles with Sales Navigator-style filters. Use currentCompanies for company employee discovery and preserve sessionId across pages. Known provider behavior: currentCompanies is matched by company name even when a LinkedIn company ID or URL is provided, so similarly named companies can appear. Verify each result's currentPositions.companyId against the intended company ID.

| Name                                         | Type      | Required | Default | Details                                                                                                                                                                                                                            |
| -------------------------------------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.search`                             | `string`  | No       | —       | Free-text profile search.                                                                                                                                                                                                          |
| `payload.currentCompanies`                   | `string`  | No       | —       | Comma-separated current company names, LinkedIn company URLs, or identifiers; maximum 50. HarvestAPI matches this filter by company name even when an ID or URL is provided, so verify returned currentPositions.companyId values. |
| `payload.pastCompanies`                      | `string`  | No       | —       | Comma-separated past company filters.                                                                                                                                                                                              |
| `payload.locations`                          | `string`  | No       | —       | Comma-separated location filters.                                                                                                                                                                                                  |
| `payload.geoIds`                             | `string`  | No       | —       | Comma-separated LinkedIn geography IDs.                                                                                                                                                                                            |
| `payload.schools`                            | `string`  | No       | —       | Comma-separated school filters.                                                                                                                                                                                                    |
| `payload.currentJobTitles`                   | `string`  | No       | —       | Comma-separated current job-title filters.                                                                                                                                                                                         |
| `payload.pastJobTitles`                      | `string`  | No       | —       | Comma-separated past job-title filters.                                                                                                                                                                                            |
| `payload.firstNames`                         | `string`  | No       | —       | Comma-separated first names.                                                                                                                                                                                                       |
| `payload.lastNames`                          | `string`  | No       | —       | Comma-separated last names.                                                                                                                                                                                                        |
| `payload.industryIds`                        | `string`  | No       | —       | Comma-separated LinkedIn industry IDs.                                                                                                                                                                                             |
| `payload.yearsAtCurrentCompanyIds`           | `string`  | No       | —       | Comma-separated years-at-current-company filter IDs.                                                                                                                                                                               |
| `payload.yearsOfExperienceIds`               | `string`  | No       | —       | Comma-separated years-of-experience filter IDs.                                                                                                                                                                                    |
| `payload.seniorityLevelIds`                  | `string`  | No       | —       | Comma-separated seniority-level IDs.                                                                                                                                                                                               |
| `payload.functionIds`                        | `string`  | No       | —       | Comma-separated job-function IDs.                                                                                                                                                                                                  |
| `payload.recentlyChangedJobs`                | `boolean` | No       | —       | Filter to profiles that recently changed jobs.                                                                                                                                                                                     |
| `payload.postedOnLinkedin`                   | `boolean` | No       | —       | Filter to profiles that posted on LinkedIn.                                                                                                                                                                                        |
| `payload.profileLanguages`                   | `string`  | No       | —       | Comma-separated profile languages.                                                                                                                                                                                                 |
| `payload.companyHeadcount`                   | `string`  | No       | —       | Comma-separated current-company headcount ranges.                                                                                                                                                                                  |
| `payload.companyHeadquarterLocations`        | `string`  | No       | —       | Comma-separated current-company headquarters locations.                                                                                                                                                                            |
| `payload.excludeLocations`                   | `string`  | No       | —       | Comma-separated locations to exclude; maximum 70.                                                                                                                                                                                  |
| `payload.excludeGeoIds`                      | `string`  | No       | —       | Comma-separated geography IDs to exclude; maximum 70.                                                                                                                                                                              |
| `payload.excludeCurrentCompanies`            | `string`  | No       | —       | Comma-separated current companies to exclude; maximum 50.                                                                                                                                                                          |
| `payload.excludePastCompanies`               | `string`  | No       | —       | Comma-separated past companies to exclude; maximum 50.                                                                                                                                                                             |
| `payload.excludeSchools`                     | `string`  | No       | —       | Comma-separated schools to exclude; maximum 50.                                                                                                                                                                                    |
| `payload.excludeCurrentJobTitles`            | `string`  | No       | —       | Comma-separated current job titles to exclude; maximum 70.                                                                                                                                                                         |
| `payload.excludePastJobTitles`               | `string`  | No       | —       | Comma-separated past job titles to exclude; maximum 70.                                                                                                                                                                            |
| `payload.excludeIndustryIds`                 | `string`  | No       | —       | Comma-separated industry IDs to exclude; maximum 70.                                                                                                                                                                               |
| `payload.excludeSeniorityLevelIds`           | `string`  | No       | —       | Comma-separated seniority-level IDs to exclude; maximum 20.                                                                                                                                                                        |
| `payload.excludeFunctionIds`                 | `string`  | No       | —       | Comma-separated function IDs to exclude; maximum 30.                                                                                                                                                                               |
| `payload.excludeCompanyHeadquarterLocations` | `string`  | No       | —       | Comma-separated company headquarters locations to exclude; maximum 70.                                                                                                                                                             |
| `payload.salesNavUrl`                        | `string`  | No       | —       | Sales Navigator search URL whose filters should be reproduced. Format: `uri`.                                                                                                                                                      |
| `payload.page`                               | `integer` | No       | `1`     | Result page, from 1 through 100. Minimum: 1. Maximum: 100.                                                                                                                                                                         |
| `payload.sessionId`                          | `string`  | No       | —       | Search session identifier to preserve across later pages.                                                                                                                                                                          |
| `payload.usePrivatePool`                     | `string`  | No       | —       | Set to true to use the caller's private LinkedIn account pool.                                                                                                                                                                     |
| `payload.requiredAccountId`                  | `string`  | No       | —       | Require one specific private LinkedIn account.                                                                                                                                                                                     |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Searches LinkedIn profiles with Sales Navigator-style filters. Use currentCompanies for company employee discovery and preserve sessionId across pages. Known provider behavior: currentCompanies is matched by company name even when a LinkedIn company ID or URL is provided, so similarly named companies can appear. Verify each result's currentPositions.companyId against the intended company ID.",
    "properties": {
      "search": {
        "type": "string",
        "description": "Free-text profile search."
      },
      "currentCompanies": {
        "type": "string",
        "description": "Comma-separated current company names, LinkedIn company URLs, or identifiers; maximum 50. HarvestAPI matches this filter by company name even when an ID or URL is provided, so verify returned currentPositions.companyId values."
      },
      "pastCompanies": {
        "type": "string",
        "description": "Comma-separated past company filters."
      },
      "locations": {
        "type": "string",
        "description": "Comma-separated location filters."
      },
      "geoIds": {
        "type": "string",
        "description": "Comma-separated LinkedIn geography IDs."
      },
      "schools": {
        "type": "string",
        "description": "Comma-separated school filters."
      },
      "currentJobTitles": {
        "type": "string",
        "description": "Comma-separated current job-title filters."
      },
      "pastJobTitles": {
        "type": "string",
        "description": "Comma-separated past job-title filters."
      },
      "firstNames": {
        "type": "string",
        "description": "Comma-separated first names."
      },
      "lastNames": {
        "type": "string",
        "description": "Comma-separated last names."
      },
      "industryIds": {
        "type": "string",
        "description": "Comma-separated LinkedIn industry IDs."
      },
      "yearsAtCurrentCompanyIds": {
        "type": "string",
        "description": "Comma-separated years-at-current-company filter IDs."
      },
      "yearsOfExperienceIds": {
        "type": "string",
        "description": "Comma-separated years-of-experience filter IDs."
      },
      "seniorityLevelIds": {
        "type": "string",
        "description": "Comma-separated seniority-level IDs."
      },
      "functionIds": {
        "type": "string",
        "description": "Comma-separated job-function IDs."
      },
      "recentlyChangedJobs": {
        "type": "boolean",
        "description": "Filter to profiles that recently changed jobs."
      },
      "postedOnLinkedin": {
        "type": "boolean",
        "description": "Filter to profiles that posted on LinkedIn."
      },
      "profileLanguages": {
        "type": "string",
        "description": "Comma-separated profile languages."
      },
      "companyHeadcount": {
        "type": "string",
        "description": "Comma-separated current-company headcount ranges."
      },
      "companyHeadquarterLocations": {
        "type": "string",
        "description": "Comma-separated current-company headquarters locations."
      },
      "excludeLocations": {
        "type": "string",
        "description": "Comma-separated locations to exclude; maximum 70."
      },
      "excludeGeoIds": {
        "type": "string",
        "description": "Comma-separated geography IDs to exclude; maximum 70."
      },
      "excludeCurrentCompanies": {
        "type": "string",
        "description": "Comma-separated current companies to exclude; maximum 50."
      },
      "excludePastCompanies": {
        "type": "string",
        "description": "Comma-separated past companies to exclude; maximum 50."
      },
      "excludeSchools": {
        "type": "string",
        "description": "Comma-separated schools to exclude; maximum 50."
      },
      "excludeCurrentJobTitles": {
        "type": "string",
        "description": "Comma-separated current job titles to exclude; maximum 70."
      },
      "excludePastJobTitles": {
        "type": "string",
        "description": "Comma-separated past job titles to exclude; maximum 70."
      },
      "excludeIndustryIds": {
        "type": "string",
        "description": "Comma-separated industry IDs to exclude; maximum 70."
      },
      "excludeSeniorityLevelIds": {
        "type": "string",
        "description": "Comma-separated seniority-level IDs to exclude; maximum 20."
      },
      "excludeFunctionIds": {
        "type": "string",
        "description": "Comma-separated function IDs to exclude; maximum 30."
      },
      "excludeCompanyHeadquarterLocations": {
        "type": "string",
        "description": "Comma-separated company headquarters locations to exclude; maximum 70."
      },
      "salesNavUrl": {
        "type": "string",
        "description": "Sales Navigator search URL whose filters should be reproduced.",
        "format": "uri"
      },
      "page": {
        "type": "integer",
        "description": "Result page, from 1 through 100.",
        "default": 1,
        "minimum": 1,
        "maximum": 100
      },
      "sessionId": {
        "type": "string",
        "description": "Search session identifier to preserve across later pages."
      },
      "usePrivatePool": {
        "type": "string",
        "description": "Set to true to use the caller's private LinkedIn account pool."
      },
      "requiredAccountId": {
        "type": "string",
        "description": "Require one specific private LinkedIn account."
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                                                                   | Type                        | Required | Default | Details                                        |
| ---------------------------------------------------------------------- | --------------------------- | -------- | ------- | ---------------------------------------------- |
| `result.data`                                                          | `object`                    | Yes      | —       | Provider response payload.                     |
| `result.data.elements`                                                 | `array`                     | Yes      | —       | —                                              |
| `result.data.elements[].id`                                            | `string`                    | No       | —       | —                                              |
| `result.data.elements[].linkedinUrl`                                   | `string`                    | Yes      | —       | —                                              |
| `result.data.elements[].firstName`                                     | `string`                    | No       | —       | —                                              |
| `result.data.elements[].lastName`                                      | `string`                    | No       | —       | —                                              |
| `result.data.elements[].summary`                                       | `string`                    | No       | —       | —                                              |
| `result.data.elements[].openProfile`                                   | `boolean`                   | No       | —       | —                                              |
| `result.data.elements[].premium`                                       | `boolean`                   | No       | —       | —                                              |
| `result.data.elements[].location`                                      | `object`                    | No       | —       | —                                              |
| `result.data.elements[].location.linkedinText`                         | `string`                    | No       | —       | —                                              |
| `result.data.elements[].pictureUrl`                                    | `string`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions`                              | `array`                     | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].companyName`                | `string`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].title`                      | `string`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].description`                | `string`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].current`                    | `boolean`                   | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].startedOn`                  | `object`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].startedOn.month`            | `integer \| string \| null` | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].startedOn.year`             | `integer`                   | No       | —       | Format: `int32`.                               |
| `result.data.elements[].currentPositions[].companyId`                  | `string`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].companyLinkedinUrl`         | `string`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].tenureAtPosition`           | `object`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].tenureAtPosition.numYears`  | `integer \| string`         | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].tenureAtPosition.numMonths` | `integer \| string`         | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].tenureAtCompany`            | `object`                    | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].tenureAtCompany.numYears`   | `integer \| string`         | No       | —       | —                                              |
| `result.data.elements[].currentPositions[].tenureAtCompany.numMonths`  | `integer \| string`         | No       | —       | —                                              |
| `result.data.pagination`                                               | `object`                    | No       | —       | —                                              |
| `result.data.pagination.totalPages`                                    | `integer`                   | No       | —       | Format: `int32`.                               |
| `result.data.pagination.totalElements`                                 | `integer`                   | No       | —       | Format: `int32`.                               |
| `result.data.pagination.pageNumber`                                    | `integer`                   | No       | —       | Format: `int32`.                               |
| `result.data.pagination.previousElements`                              | `integer`                   | No       | —       | Format: `int32`.                               |
| `result.data.pagination.pageSize`                                      | `integer`                   | No       | —       | Format: `int32`.                               |
| `result.data.pagination.paginationToken`                               | `string \| null`            | No       | —       | —                                              |
| `result.data.status`                                                   | `"OK" \| 200`               | Yes      | —       | —                                              |
| `result.data.error`                                                    | `""`                        | No       | —       | —                                              |
| `result.meta`                                                          | `object`                    | No       | —       | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "elements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "linkedinUrl": {
                  "type": "string"
                },
                "firstName": {
                  "type": "string"
                },
                "lastName": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "openProfile": {
                  "type": "boolean"
                },
                "premium": {
                  "type": "boolean"
                },
                "location": {
                  "type": "object",
                  "properties": {
                    "linkedinText": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "pictureUrl": {
                  "type": "string"
                },
                "currentPositions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "companyName": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "current": {
                        "type": "boolean"
                      },
                      "startedOn": {
                        "type": "object",
                        "properties": {
                          "month": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "format": "int32"
                              },
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "year": {
                            "type": "integer",
                            "format": "int32"
                          }
                        },
                        "additionalProperties": false
                      },
                      "companyId": {
                        "type": "string"
                      },
                      "companyLinkedinUrl": {
                        "type": "string"
                      },
                      "tenureAtPosition": {
                        "type": "object",
                        "properties": {
                          "numYears": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "format": "int32"
                              },
                              {
                                "type": "string"
                              }
                            ]
                          },
                          "numMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "format": "int32"
                              },
                              {
                                "type": "string"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "tenureAtCompany": {
                        "type": "object",
                        "properties": {
                          "numYears": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "format": "int32"
                              },
                              {
                                "type": "string"
                              }
                            ]
                          },
                          "numMonths": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "format": "int32"
                              },
                              {
                                "type": "string"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "linkedinUrl"
              ],
              "additionalProperties": false
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "totalPages": {
                "type": "integer",
                "format": "int32"
              },
              "totalElements": {
                "type": "integer",
                "format": "int32"
              },
              "pageNumber": {
                "type": "integer",
                "format": "int32"
              },
              "previousElements": {
                "type": "integer",
                "format": "int32"
              },
              "pageSize": {
                "type": "integer",
                "format": "int32"
              },
              "paginationToken": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "const": "OK"
              },
              {
                "type": "integer",
                "const": 200
              }
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "const": ""
          }
        },
        "required": [
          "elements",
          "status"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0.7` per pricing unit.

## Related documentation

* [HarvestAPI provider guide](/docs/providers/harvestapi/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
