Skip to main content
GET
/
linkedin
/
lead-search
Search LinkedIn leads
curl --request GET \
  --url https://api.harvest-api.com/linkedin/lead-search \
  --header 'X-API-Key: <api-key>'
{
  "elements": [
    {
      "linkedinUrl": "<string>",
      "id": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "openProfile": true,
      "premium": true,
      "location": {
        "linkedinText": "<string>"
      },
      "pictureUrl": "<string>",
      "currentPositions": [
        {
          "companyName": "<string>",
          "title": "<string>",
          "description": "<string>",
          "startedOn": {
            "month": "<string>",
            "year": 123
          },
          "companyId": "<string>",
          "companyLinkedinUrl": "<string>",
          "tenureAtPosition": {
            "numYears": "<string>",
            "numMonths": "<string>"
          },
          "tenureAtCompany": {
            "numYears": "<string>",
            "numMonths": "<string>"
          }
        }
      ]
    }
  ],
  "pagination": {
    "totalPages": 123,
    "totalElements": 123,
    "pageNumber": 123,
    "previousElements": 123,
    "pageSize": 123,
    "paginationToken": "<string>"
  },
  "status": "<string>",
  "error": "<string>"
}

Examples

const params = new URLSearchParams({
  page: '1',
  search: 'Machine Learning Engineer',
  currentCompany: 'https://www.linkedin.com/company/google',
  location: 'US',
  seniorityLevelIds: '120,210',
  profileLanguages: 'en',
  excludeSeniorityLevelIds: '220,300,310',
});
fetch(`https://api.harvest-api.com/linkedin/lead-search?${params.toString()}`, {
  headers: { 'X-API-Key': '<api-key>' },
})
  .then((response) => response.json())
  .then((data) => console.log(data));

Session ID

  • LinkedIn applies search personalization, so the results may vary based on resources used for scraping.
  • When iterating over multiple pages, different pages might be scraped by different resources, which can lead to inconsistent results.
To mitigate this, you can use the sessionId parameter to request our backend to use the same resource.
To create a sessionId, you can generate a random string (e.g., using UUID) and pass it as a query parameter in your API request.
This sessionId will not be passed to LinkedIn, it is used only internally in our backend to identify which requests should be processed by the same resource. Our backend tracks LinkedIn’s sessionId independently.
In case if the initially assigned resource becomes unavailable (rate-limited, proxy offline, etc.), our backend will reassign the session to a different resource. Using sessionId slows requests down, as multiple users (or even different sessions) can be acquiring the same resource. Since our resources can process only one request at a time, requests with sessionId will be queued until the resource is available to take a new request.

Authorizations

X-API-Key
string
header
required

Query Parameters

Search query. Fuzzy search, supports LinkedIn's search operators

currentCompanies
string

Filter by current company IDs or URLs. Comma-separated (max 50)

pastCompanies
string

Filter by past company IDs or URLs. Comma-separated (max 50)

locations
string

Filter by location text. Comma-separated (max 70)

geoIds
string

Filter by LinkedIn Geo ID. Comma-separated. Overrides location param. Use /linkedin/geo-id-search to find IDs

schools
string

Filter by school IDs or URLs. Comma-separated (max 50)

currentJobTitles
string

Filter by current job titles. Comma-separated (max 70)

pastJobTitles
string

Filter by past job titles. Comma-separated (max 70)

firstNames
string

Filter by first names. Comma-separated (max 70)

lastNames
string

Filter by last names. Comma-separated (max 70)

yearsAtCurrentCompanyIds
string
yearsOfExperienceIds
string
seniorityLevelIds
string
recentlyChangedJobs
boolean

Filter leads who recently changed jobs

profileLanguages
string
companyHeadcount
string
companyHeadquarterLocations
string

Filter by company headquarter location text. Comma-separated (max 70)

excludeLocations
string

Locations to exclude from search. Comma-separated (max 70)

excludeGeoIds
string

Geo IDs to exclude from search. Comma-separated (max 70)

excludeCurrentCompanies
string

Current companies to exclude. Comma-separated (max 50)

excludePastCompanies
string

Past companies to exclude. Comma-separated (max 50)

excludeSchools
string

Schools to exclude. Comma-separated (max 50)

excludeCurrentJobTitles
string

Current job titles to exclude. Comma-separated (max 70)

excludePastJobTitles
string

Past job titles to exclude. Comma-separated (max 70)

excludeIndustryIds
string

Industry IDs to exclude. Comma-separated (max 70)

excludeSeniorityLevelIds
string

Seniority level IDs to exclude. Comma-separated (max 20)

excludeFunctionIds
string

Function IDs to exclude. Comma-separated (max 30)

excludeCompanyHeadquarterLocations
string

Company headquarter locations to exclude from search. Comma-separated (max 70)

salesNavUrl
string

LinkedIn Sales Navigator search URL to use for the search. This will override all other search parameters, except the page parameter. For pagination, please pass the page query parameter separately. Note: the scraper doesn't scrape the URL directly, it will parse the URL, sanitize and validate params. It supports all parameters currently, but if LinkedIn adds new parameters in the future, they might not be supported until we update the API. Please contact us in this case.

page
integer
default:1

Page number for pagination (clamped at 100)

sessionId
string
usePrivatePool
string

Set to true to use your private pool of resources (if available)

requiredAccountId
string

If we provide you a private pool of accounts, you can use this parameter to specify which account should be used for this request.

Response

Lead search response

elements
object[]
pagination
object
status
string
error
string