For some endpoints, you might want to use your personal LinkedIn account to get better results. For example, to get better results from the Profile Search endpoint. HarvestAPI can use user-supplier LinkedIn accounts. All API endpoints support these query parameters:
  • cookie : your LinkedIn cookie base64 encoded. You can export your cookie via the browser extension Cookie-Editor. After installing it, navigate to Sales Navigator page -> open extension popup -> click “Export” -> JSON. Use any base64 encoder (for example) to encode the JSON and pass it as the cookie parameter.
  • proxy (optionally): We recommend you to find a clean residential/mobile proxy. Proxy location should ideally match your login location. When it’s not provided, the scraper will use our proxy pool.
  • userAgent (optionally): We also recommend to provide your User Agent, otherwise LinkedIn may log you out after scraping a few pages. If you keep getting logged out, copy your user agent from the same browser where you exported your cookie, for example via a tool.

Side notes on using custom accounts

  • Ideally proxy external IP address shouldn’t change. Use static proxies, or proxies with long sticky sessions.
  • Don’t forget to check IP quality of your proxy, for example ipqualityscore.com Proxy Detection Test should ideally show all green checks, for example

Example

const params = new URLSearchParams({
  search: 'Director',
  location: 'US',
  cookie: btoa(JSON.stringify([{ domain: '.linkedin.com', expirationDate: 'etc...' }])), // `btoa` helper to base64 encode the cookie
  // cookie: btoa('_guid=e67a3e9e-1234-1234-1234-12345678; lang=v=2&lang=en-us; liap=true; ... ') // copying the cookie from the devtool will also work
  proxy: 'http://user:password@example.com:8080',
  userAgent:
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36',
});
fetch(`https://api.harvest-api.com/linkedin/profile-search?${params.toString()}`, {
  headers: { 'X-API-Key': '<api-key>' },
})
  .then((response) => response.json())
  .then((data) => console.log(data));

Next Steps

Check out the API Reference for detailed information on each API endpoint.