Posts

post fetch

Fetch a LinkedIn post with optional comments and reactions.

bash
linkedin post fetch <url> [flags]
FlagTypeDescription
--commentsbooleanInclude comments
--reactionsbooleanInclude reactions
--comments-limitintegerMax comments to retrieve
--comments-sortstringSort order: mostRelevant or mostRecent
--comments-repliesbooleanInclude replies to comments
--reactions-limitintegerMax reactions to retrieve

With --comments, each returned comment includes commentUrn and commentUrl. Pass a commentUrl to comment react / comment reply to engage with that comment.

bash
linkedin post fetch https://www.linkedin.com/posts/vprudnikoff_activity-123

# With comments sorted by most recent, including replies
linkedin post fetch https://www.linkedin.com/posts/vprudnikoff_activity-123 \
  --comments --comments-sort mostRecent --comments-replies --json

# With reactions
linkedin post fetch https://www.linkedin.com/posts/vprudnikoff_activity-123 \
  --comments --reactions --json

post search

Search for posts on LinkedIn with filters.

bash
linkedin post search [flags]
FlagTypeDescription
--termstringSearch keyword or phrase, up to 50 characters
--limitintegerMax results to return, up to 100
--sortstringOne of topMatch, latest
--date-postedstringOne of past24Hours, pastWeek, pastMonth
--content-typestringOne of videos, images, jobPosts, liveVideos, documents
--posted-bystringComma-separated: me, firstConnections, peopleYouFollow
--from-membersstringComma-separated names of people whose posts to keep
--from-companiesstringComma-separated names of companies whose posts to keep
--mentioning-membersstringComma-separated names of people the post must mention
--mentioning-companiesstringComma-separated names of companies the post must mention
--author-companiesstringComma-separated names of companies the author works at
--author-industriesstringComma-separated industries the author works in

The member and company flags take typed names, which is all LinkedIn's filter panel accepts, so the entry that gets picked is whichever suggestion LinkedIn ranked first for that name – it may be a namesake rather than the person or company you meant. To pin an exact one, run the search as a workflow with an urn on the filter entry; an identifier that no suggestion matches fails the action with filterIdentityMismatch instead of filtering by a namesake.

A search may return fewer posts than --limit, because how many results come back depends on what LinkedIn loads for that account on that search. LinkedIn also widens a narrow query on its own, so a non-empty result does not mean your term matched. See searching for posts.

Search results carry no urn on their author and reposter – run post fetch on a result's url when you need one.

bash
linkedin post search --term "climate tech" --date-posted pastWeek --json
linkedin post search --term "product launch" --content-type images --sort latest --limit 20 --json
linkedin post search --term "hiring" --from-companies "Linked API" --posted-by "peopleYouFollow" --json

post create

Create a LinkedIn post with optional media attachments.

bash
linkedin post create <text> [flags]
ArgRequiredDescription
textyesPost text (up to 3000 characters)
FlagTypeDescription
--company-urlstringPost on behalf of a company page (requires admin access)
--attachmentsstringAttachments 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.

bash
linkedin post create "Excited to share our latest update!"

# With an image
linkedin post create "Check this out" \
  --attachments "https://example.com/photo.jpg:image"

# With a document
linkedin post create "Our Q4 report" \
  --attachments "https://example.com/report.pdf:document:Q4 Report"

# Post as a company
linkedin post create "Company announcement" \
  --company-url https://www.linkedin.com/company/flutterwtf

post react

React to a LinkedIn post.

bash
linkedin post react <url> --type <reaction> [flags]
FlagTypeRequiredDescription
--typestringyesReaction type: like, love, support, celebrate, insightful, funny
--company-urlstringnoReact on behalf of a company page
bash
linkedin post react https://www.linkedin.com/posts/vprudnikoff_activity-123 --type like
linkedin post react https://www.linkedin.com/posts/vprudnikoff_activity-123 --type celebrate \
  --company-url https://www.linkedin.com/company/flutterwtf

post comment

Comment on a LinkedIn post.

bash
linkedin post comment <url> <text> [flags]
ArgRequiredDescription
urlyesLinkedIn post URL
textyesComment text (up to 1000 characters)
FlagTypeDescription
--company-urlstringComment on behalf of a company page
bash
linkedin post comment https://www.linkedin.com/posts/vprudnikoff_activity-123 "Great insights!"
linkedin post comment https://www.linkedin.com/posts/vprudnikoff_activity-123 "Well said!" \
  --company-url https://www.linkedin.com/company/flutterwtf

comment react

React to a comment on a LinkedIn post.

bash
linkedin comment react <commentUrl> --type <reaction>
ArgRequiredDescription
commentUrlyesDeep-link URL of the comment, from post fetch --comments or a comment reply result
FlagTypeRequiredDescription
--typestringyesReaction type: like, love, support, celebrate, insightful, funny
bash
linkedin comment react "https://www.linkedin.com/feed/update/urn:li:activity:123/?dashCommentUrn=urn:li:fsd_comment:(456,urn:li:activity:123)" --type like

comment reply

Reply to a comment on a LinkedIn post.

bash
linkedin comment reply <commentUrl> <text> [flags]
ArgRequiredDescription
commentUrlyesDeep-link URL of the comment to reply to
textyesReply text

The reply's commentUrn and commentUrl are printed on success (use --json for the full object).

bash
linkedin comment reply "https://www.linkedin.com/feed/update/urn:li:activity:123/?dashCommentUrn=urn:li:fsd_comment:(456,urn:li:activity:123)" "Great point, thanks for sharing!" --json