feat(linkedin): add salesnav-search command for Sales Navigator lead search#1640
Closed
hanzili wants to merge 1 commit into
Closed
feat(linkedin): add salesnav-search command for Sales Navigator lead search#1640hanzili wants to merge 1 commit into
hanzili wants to merge 1 commit into
Conversation
…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>
Contributor
Author
|
Superseded by consolidated canonical PR #1647. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a new
linkedin salesnav-searchcommand: searches LinkedIn Sales Navigator for people (leads) by keyword and returns structured rows —rank, name, title, company, location, degree, profile_url.The existing
linkedin searchcommand covers jobs only; there was no people/lead search. This fills that gap for lead-generation workflows.How it works
Replays the Sales Navigator
salesApiLeadSearchAPI directly rather than scraping the UI:GET sales-api/salesApiLeadSearchwith the keyword query andstart/countpagination (25 per request).csrf-token(from the JSESSIONID cookie) +x-restli-protocol-version./in/vanity URL, soprofile_urlis derived from the obfuscated member token in each lead'sfs_salesProfileentityUrn —linkedin.com/in/<token>is a valid profile URL.pastPositionswhen a lead has no current position.Requires an account with Sales Navigator; surfaces a typed
AuthRequiredErrorif the API rejects with 401/403.Type of Change
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
Note
decorationId(the response-shape version, currentlyLeadSearchResult-14) is pinned. If Sales Navigator bumps it the constant needs refreshing; this is flagged in a code comment.