Skip to content

feat(linkedin): add salesnav-search command for Sales Navigator lead search#1640

Closed
hanzili wants to merge 1 commit into
jackwener:mainfrom
hanzili:feat/linkedin-salesnav-search
Closed

feat(linkedin): add salesnav-search command for Sales Navigator lead search#1640
hanzili wants to merge 1 commit into
jackwener:mainfrom
hanzili:feat/linkedin-salesnav-search

Conversation

@hanzili
Copy link
Copy Markdown
Contributor

@hanzili hanzili commented May 17, 2026

What does this PR do?

Adds a new linkedin salesnav-search command: searches LinkedIn Sales Navigator for people (leads) by keyword and returns structured rows — rank, name, title, company, location, degree, profile_url.

The existing linkedin search command covers jobs only; there was no people/lead search. This fills that gap for lead-generation workflows.

How it works

Replays the Sales Navigator salesApiLeadSearch API directly rather than scraping the UI:

  • GET sales-api/salesApiLeadSearch with the keyword query and start/count pagination (25 per request).
  • Headers: csrf-token (from the JSESSIONID cookie) + x-restli-protocol-version.
  • Sales Navigator returns no /in/ vanity URL, so profile_url is derived from the obfuscated member token in each lead's fs_salesProfile entityUrn — linkedin.com/in/<token> is a valid profile URL.
  • Falls back to pastPositions when a lead has no current position.

Requires an account with Sales Navigator; surfaces a typed AuthRequiredError if the API rejects with 401/403.

Type of Change

  • New feature

Changes Made

  • clis/linkedin/salesnav-search.js — the command (read-only, browser).
  • clis/linkedin/salesnav-search.test.js — 4 unit tests (URL building, entityUrn parsing, limit validation, lead parsing + pastPositions fallback).
  • cli-manifest.json — regenerated.

Testing

  • Unit tests pass; full suite green; typed-error-lint and silent-column-drop gates clean.
  • Verified e2e against a live Sales Navigator session — single-page and multi-page pagination (40 results across 2 pages: distinct, contiguous, no boundary duplicates).

Note

decorationId (the response-shape version, currently LeadSearchResult-14) is pinned. If Sales Navigator bumps it the constant needs refreshing; this is flagged in a code comment.

…search

Searches LinkedIn Sales Navigator for people (leads) by keyword and
returns structured rows: rank, name, title, company, location, degree,
profile_url. The existing linkedin search command covers jobs only;
there was no people/lead search.

Replays the salesApiLeadSearch API directly (csrf + restli headers,
start/count pagination, 25 per request) rather than scraping the UI.
Sales Navigator returns no /in/ vanity URL, so profile_url is derived
from the obfuscated member token in each lead's fs_salesProfile
entityUrn, which linkedin.com/in/<token> resolves. Falls back to
pastPositions when a lead has no current position.

Verified e2e against a live Sales Navigator session, single-page and
multi-page (40 results across 2 pages, distinct and contiguous).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hanzili
Copy link
Copy Markdown
Contributor Author

hanzili commented May 18, 2026

Superseded by consolidated canonical PR #1647.

@hanzili hanzili closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant