> ## 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

> Search LinkedIn profiles with Sales Navigator-style filters (current company, job title, location, seniority), including listing employees of one or more.

Search LinkedIn profiles with Sales Navigator-style filters (current company, job title, location, seniority), including listing employees of one or more.

> [!NOTE]
>
> Tool ID: `harvestapi_search_leads`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
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={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute harvestapi_search_leads --input '{
  "search": "software companies hiring engineers",
  "currentCompanies": "example",
  "pastCompanies": "example"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

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

Use `deepline describe 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. maximum 50. |
| `payload.locations` | `string` | No | — | Comma-separated location filters. maximum 70. |
| `payload.geoIds` | `string` | No | — | Comma-separated LinkedIn geography IDs. |
| `payload.schools` | `string` | No | — | Comma-separated school filters. maximum 50. |
| `payload.currentJobTitles` | `string` | No | — | Comma-separated current job-title filters. maximum 70. Split longer title lists across separate searches. |
| `payload.pastJobTitles` | `string` | No | — | Comma-separated past job-title filters. maximum 70. |
| `payload.firstNames` | `string` | No | — | Comma-separated first names. maximum 70. |
| `payload.lastNames` | `string` | No | — | Comma-separated last names. maximum 70. |
| `payload.industryIds` | `string` | No | — | Comma-separated LinkedIn industry IDs. maximum 70. |
| `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. maximum 70. |
| `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. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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; maximum 50."
      },
      "locations": {
        "type": "string",
        "description": "Comma-separated location filters; maximum 70."
      },
      "geoIds": {
        "type": "string",
        "description": "Comma-separated LinkedIn geography IDs."
      },
      "schools": {
        "type": "string",
        "description": "Comma-separated school filters; maximum 50."
      },
      "currentJobTitles": {
        "type": "string",
        "description": "Comma-separated current job-title filters; maximum 70. Split longer title lists across separate searches."
      },
      "pastJobTitles": {
        "type": "string",
        "description": "Comma-separated past job-title filters; maximum 70."
      },
      "firstNames": {
        "type": "string",
        "description": "Comma-separated first names; maximum 70."
      },
      "lastNames": {
        "type": "string",
        "description": "Comma-separated last names; maximum 70."
      },
      "industryIds": {
        "type": "string",
        "description": "Comma-separated LinkedIn industry IDs; maximum 70."
      },
      "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; maximum 70."
      },
      "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."
      }
    },
    "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={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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](https://deepline.com/docs/providers/harvestapi/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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