Registry / http-networking / linkedin-private-api

linkedin-private-api

JSON →
library1.1.2jsnpmunverified

This `linkedin-private-api` package offers an unofficial, TypeScript-written wrapper for interacting with the LinkedIn platform programmatically. It operates by simulating browser requests, allowing automation of tasks without requiring official OAuth tokens; instead, it authenticates using direct user credentials (username and password). The current stable version is 1.1.2, with recent minor updates (v1.1.1, for example, introduced job searching and invitation notes). Its release cadence appears infrequent, suggesting a more conservative development or maintenance-oriented approach. A key differentiator is its ability to bypass official API restrictions, enabling direct automation of tasks such as searching profiles and jobs, sending connection invitations, and managing messages. This functionality is well-suited for specialized automation not covered by the public LinkedIn API, though users must be aware of the inherent risks associated with using unofficial access methods, including potential account action by LinkedIn.

npm install linkedin-private-api
INSTALL
IMPORT
SIG · LINKEDIN-PRIVATE-A
L
linkedin-private-api
http-networkingjavascriptv1.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
import { Client } from 'linkedin-private-api'
const Client = require('linkedin-private-api')
The primary entry point for the API client. Prefer `import` for modern Node.js and TypeScript projects.
Scroller
import { Scroller } from 'linkedin-private-api'
import Scroller from 'linkedin-private-api'
Used for paginating results from methods that return multiple entities (e.g., search results, invitations).
JobSearchHit
import type { JobSearchHit } from 'linkedin-private-api'
import { JobSearchHit } from 'linkedin-private-api'
A type definition for individual job search result objects. Use `import type` for clarity and optimal bundling in modern TypeScript environments.

Demonstrates logging in, searching for jobs and people, sending connection invitations, and exchanging messages.

import { Client } from 'linkedin-private-api'; const username = process.env.USERNAME as string; const password = process.env.PASSWORD as string; (async () => { // Login const client = new Client(); await client.login.userPass({ username, password }); // Search for React development jobs in Israel const jobsScroller = await client.search.searchJobs({ keywords: 'React', filters: { location: 'Israel' }, limit: 20, skip: 5, }); const [someReactJobHit] = await jobsScroller.scrollNext(); const jobCompanyName = someReactJobHit.hitInfo.jobPosting.companyDetails.company.name; // Fetch the job's company const companiesScroller = await client.search.searchCompanies({ keywords: jobCompanyName }); const [{ company: jobCompany }] = await companiesScroller.scrollNext(); // Search for profiles and send an invitation const peopleScroller = await client.search.searchPeople({ keywords: 'Bill Gates' }); const [{ profile: billGates }] = await peopleScroller.scrollNext(); await client.invitation.sendInvitation({ profileId: billGates.profileId, trackingId: billGates.trackingId, }); // Search in my connections const ownConnectionsScroller = await client.search.searchOwnConnections({ keywords: 'Bill Gates', limit: 1 }); const connections = await ownConnectionsScroller.scrollNext(); // Get conversation const [billConversation] = await client.conversation.getConversations({ recipients: billGates.profileId }).scrollNext(); const conversationMessages = await client.message.getMessages({ conversationId: billConversation.conversationId }).scrollNext(); // Send a message const sentMessage = await client.message.sendMessage({ profileId: billGates.profileId, text: 'Hey Bill!', }); })();
Debug
Known issues
breakingUse of this unofficial API violates LinkedIn's Terms of Service and may lead to account suspension or termination. LinkedIn frequently updates its website, which can cause this library to break without notice.
fix
Proceed with extreme caution and be aware of the risks. Monitor library updates for compatibility fixes, and implement robust error handling.
affects: >=1.0.0
gotchaThis library performs actions through simulated browser requests. Aggressive usage (high request rates) can trigger LinkedIn's rate limiting or bot detection mechanisms, leading to temporary blocks or CAPTCHAs.
fix
Implement significant delays between requests and use sensible rate limiting strategies. Consider using proxies to distribute traffic if operating at scale, and handle CAPTCHA challenges gracefully if encountered.
affects: >=1.0.0
gotchaAuthentication relies on direct username/password submission, which is inherently less secure than OAuth tokens. Storing these credentials, even in environment variables, requires robust security practices to prevent leakage.
fix
Utilize secure environment variable management (e.g., Docker secrets, Kubernetes secrets, cloud secrets managers) and avoid hardcoding credentials. For production, consider a secure vault solution and ensure restricted access to any system using these credentials.
affects: >=1.0.0
Errors
Common errors & fixes
Login failed: Invalid credentials
The provided username or password was incorrect, or LinkedIn may have flagged the login attempt due to unusual activity or location.
fix
Double-check credentials. Try logging in manually via a browser to ensure the account is active and not locked. Verify `process.env.USERNAME` and `process.env.PASSWORD` are correctly set.
Cannot read properties of undefined (reading 'jobPosting') (or similar for other entity properties)
A scroller returned no results, or the internal structure of LinkedIn's API response for a specific entity changed, leading to incorrect parsing by the library.
fix
Always check if scroller results or specific properties exist before accessing them (e.g., `if (someReactJobHit?.hitInfo?.jobPosting)`). Update the library to the latest version, or check the GitHub issues for known breaking changes if LinkedIn's API structure has been modified.
Too many requests (HTTP 429) / You have been temporarily blocked
LinkedIn's rate limiting system detected excessive requests from your IP address or account within a short period.
fix
Implement asynchronous delays (e.g., `await new Promise(resolve => setTimeout(resolve, delayMs))`) between API calls, increasing `delayMs` gradually if errors persist. Use a proxy rotation service for high-volume operations.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
53 hits · last 30 days
node
45
OpenAI (training)
1
Resources
linkedin-private-api — npm install linkedin-private-api · libregistry