@todoforai/linkedin-api
v1.0.0
Published
LinkedIn Voyager API CLI — raw wrapper for LinkedIn's internal Voyager API via cookie auth.
Readme
linkedin-api
LinkedIn Voyager API CLI — raw wrapper for LinkedIn's internal Voyager API via cookie auth.
Status
Working commands:
auth— save/show credentialswhoami— current authenticated userprofile— fetch profile by public ID or URLmessages— list conversationsmessage-read— read one conversation by URN, thread ID, profile ID, or URLmessage-send— send a DM to a person
TODO:
search-people,connections,connectfeed,post,comment,reactinvitations,invitation-reply,company,school
Auth
Cookie-based auth. Credentials stored in ~/.config/linkedin-api/credentials.json.
# Extract cookies from browser DevTools → Application → Cookies → linkedin.com
linkedin-api auth <li_at> <jsessionid>
linkedin-api whoamiReference Projects
Projects we draw from when building this CLI:
Core — Voyager API knowledge
| Project | Lang | ⭐ | What we take |
|---------|------|----|-------------|
| nsandman/linkedin-api | Python | 143 | Primary Voyager API reference. Endpoints for profiles, search, messaging (send_message), connections (add_connection), invitations. Fork of original tomquirk/linkedin-api. 7 years of endpoint mapping. |
| frizynn/linkedin-cli | Python | 28 | CLI UX + read/write patterns. Feed, profile, search, post, react, comment, save. Cookie auth + browser extraction. JSON output. No messaging. |
| ggfevans/endorse | Go | 12 | Messaging implementation. Real-time messaging TUI via SSE. Read+write DMs. Uses mautrix-linkedin bridge approach. |
Secondary — additional patterns
| Project | Lang | ⭐ | What we take |
|---------|------|----|-------------|
| Linked-API/linkedin-cli | TS | 8 | Command structure reference (person fetch, message send, connection invite). SaaS-dependent — won't use their infra. |
| peggyrayzis/li | TS | 4 | Bird-inspired CLI design. Cookie extraction via @steipete/sweet-cookie. Connections, search, messages read. |
| adunne09/suit | TS | 1 | Minimal Voyager CLI — feed, search, profile, messages. Clean TypeScript patterns. |
| trieb-work/linkedin-voyager-sdk | TS | 17 | TypeScript Voyager SDK — profile/company scraping with cookie auth. |
| swiftlysingh/lnk | Go | 2 | Go Voyager CLI — post, read, search, messaging. |
Key Voyager API details
- Base:
https://www.linkedin.com/voyager/api - Auth:
li_atcookie +JSESSIONIDcookie (used ascsrf-tokenheader) - Endpoints: REST-style, returns JSON with LinkedIn-specific URN identifiers
- Rate limiting: LinkedIn throttles aggressively — need delays between requests
Dev
cd linkedin-api && bun install && bun link
linkedin-api --help