General-purpose LinkedIn automation โ fetch profiles, search people and companies, send messages, manage connections, create posts, and more. Use when the user wants to interact with LinkedIn.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
General-purpose LinkedIn automation โ fetch profiles, search people and companies, send messages, manage connections, create posts, and more. Use when the user wants to interact with LinkedIn.
zh_description
้่ฟ Linked API ๆ็ดข้ข่ฑ่ตๆใ็ฎก็่ฟๆฅใๆถๆฏไธๅ ๅฎนๅๅธใ
You have access to linkedin โ a CLI tool for LinkedIn automation. Use it to fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and more.
Each command sends a request to Linked API, which runs a real cloud browser to perform the action on LinkedIn. Operations are not instant โ expect 30 seconds to several minutes depending on complexity.
If linkedin is not available, install it:
npm install -g @linkedapi/linkedin-cli
Authentication
If a command fails with exit code 2 (authentication error), ask the user to set up their account:
When using this skill, run every linkedin ... example below with the
LINKEDAPI_CLIENT=skill:linkedin prefix so Linked API can attribute usage to the skill.
Flag
Description
--json
Structured JSON output
--quiet / -q
Suppress stderr progress messages
--fields name,url,...
Select specific fields in output
--no-color
Disable colors
--account "Name"
Use a specific account for this command
Output Format
Success:
{"success":
true
,
"data"
:
{
"name"
:
"John Doe"
,
"headline"
:
"Engineer"
}
}
Error:
{"success":false,"error":{"type":"personNotFound","message":"Person not found"}}
Exit code 0 means the API call succeeded โ always check the success field for the action outcome. Non-zero exit codes indicate infrastructure errors:
Exit Code
Meaning
0
Success (check success field โ action may have returned an error like "person not found")
1
General/unexpected error
2
Missing or invalid tokens
3
Subscription/plan required
4
LinkedIn account issue
5
Invalid arguments
6
Rate limited
7
Network error
8
Workflow timeout (workflowId returned for recovery)
Commands
Fetch a Person Profile
linkedin person fetch <url> [flags] --json -q
Optional flags to include additional data:
--experience โ work history
--education โ education history
--skills โ skills list
--languages โ languages
--posts โ recent posts (with --posts-limit N, --posts-since TIMESTAMP)
--comments โ recent comments (with --comments-limit N, --comments-since TIMESTAMP)
--reactions โ recent reactions (with --reactions-limit N, --reactions-since TIMESTAMP)
Only request additional data when needed โ each flag increases execution time.
# Basic profile
linkedin person fetch https://www.linkedin.com/in/username --json -q
# With experience and education
linkedin person fetch https://www.linkedin.com/in/username --experience --education --json -q
# With last 5 posts
linkedin person fetch https://www.linkedin.com/in/username --posts --posts-limit 5 --json -q
# Basic company info
linkedin company fetch https://www.linkedin.com/company/name --json -q
# With employees filtered by position
linkedin company fetch https://www.linkedin.com/company/name --employees --employees-position "Engineer" --json -q
# With decision makers and posts
linkedin company fetch https://www.linkedin.com/company/name --dms --posts --posts-limit 10 --json -q
By default, withdrawing also unfollows the person. Use --no-unfollow to keep following.
Remove a connection
linkedin connection remove <url> --json -q
Posts
Fetch a post
linkedin post fetch <url> [flags] --json -q
Flag
Description
--comments
Include comments
--reactions
Include reactions
--comments-limit
Max comments to retrieve (requires --comments)
--comments-sort
Sort order: mostRelevant or mostRecent (requires --comments)
--comments-replies
Include replies to comments (requires --comments)
--reactions-limit
Max reactions to retrieve (requires --reactions)
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 --json -q
# With comments sorted by most recent, including replies
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 \
--comments --comments-sort mostRecent --comments-replies --json -q
Create a post
linkedin post create '<text>' [flags] --json -q
Flag
Description
--company-url
Post on behalf of a company page (requires admin access)
--attachments
Attachment as url:type or url:type:name. Types: image, video, document. Can be specified multiple times.
Attachment limits: up to 9 images, or 1 video, or 1 document. Cannot mix types.
linkedin post create 'Excited to share our latest update!' --json -q
# With a document
linkedin post create 'Our Q4 report' \
--attachments "https://example.com/report.pdf:document:Q4 Report" --json -q
# Post as a company
linkedin post create 'Company announcement' \
--company-url https://www.linkedin.com/company/name --json -q
React to a post
linkedin post react <url> --type <reaction> [--company-url <url>] --json -q
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type like --json -q
# React on behalf of a company
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type celebrate \
--company-url https://www.linkedin.com/company/name --json -q
Comment on a post
linkedin post comment <url> '<text>' [--company-url <url>] --json -q
Text up to 1000 characters.
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Great insights!' --json -q
# Comment on behalf of a company
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Well said!' \
--company-url https://www.linkedin.com/company/name --json -q
Statistics
# Social Selling Index
linkedin stats ssi --json -q
# Performance analytics (profile views, post impressions, search appearances)
linkedin stats performance --json -q
# API usage for a date range
linkedin stats usage --start 2024-01-01T00:00:00Z --end 2024-01-31T00:00:00Z --json -q
Sales Navigator
Requires a LinkedIn Sales Navigator subscription. Uses hashed URLs for person/company lookups.
Fetch person
linkedin navigator person fetch <hashed-url> --json -q
Search people
linkedin navigator person search [flags] --json -q
Text up to 1900 characters. Subject up to 80 characters.
linkedin navigator message send https://www.linkedin.com/in/username \
'Would love to chat about API integrations' --subject 'Partnership Opportunity' --json -q
Get Sales Navigator conversation
linkedin navigator message get <person-url> [--since TIMESTAMP] --json -q
Custom Workflows
Execute a custom workflow definition from a file, stdin, or inline:
# From file
linkedin workflow run --file workflow.json --json -q
# From stdincat workflow.json | linkedin workflow run --json -q
# Inlineecho'{"actions":[...]}' | linkedin workflow run --json -q
Check workflow status or wait for completion:
linkedin workflow status <id> --json -q
linkedin workflow status <id> --wait --json -q
linkedin account list # List accounts (* = active)
linkedin account switch "Name"# Switch active account
linkedin account rename "Name" --name "New Name"# Rename account
linkedin reset # Remove active account
linkedin reset --all # Remove all accounts
Boundaries and Safe Authorization
Use only LinkedIn accounts that the user owns or is explicitly authorized to operate.
Treat invitations, messages, posts, reactions, comments, connection changes, account
changes, and workflows containing any of those steps as external writes. Run them only
when the user has explicitly requested the specific action. For bulk writes, confirm the
account, audience, approximate count, content, and timing before execution unless those
details were already approved in the current request.
Prefer a preview or a small sample before a bulk operation. Never manufacture consent,
impersonate another person, or use this skill for deceptive, discriminatory, harassing,
or indiscriminate outreach.
Respect LinkedIn controls, applicable law, and organizational policy. Never bypass rate
limits, CAPTCHAs, account warnings, or access restrictions; stop and report them instead.
Minimize collection of personal data. Do not expose tokens in chat output, logs, shell
history, or committed files, and do not retain profile data longer than the task requires.
If the requested authority, target set, or effect is ambiguous, pause before the first
write and ask the user to clarify it.
Important Behavior
Sequential execution. All operations for an account run one at a time. Multiple requests queue up.
Not instant. A real browser navigates LinkedIn โ expect 30 seconds to several minutes per operation.
Timestamps in UTC. All dates and times are in UTC.
Single quotes for text arguments. Use single quotes around message text, post text, and comments to avoid shell interpretation issues with special characters.
Action limits. Per-account limits are configurable on the platform. A limitExceeded error means the limit was reached.
URL normalization. All LinkedIn URLs in responses are normalized to https://www.linkedin.com/... format without trailing slashes.
Null fields. Fields that are unavailable are returned as null or [], not omitted.