Vexaloom Labs

Use LinkedIn Profile Feed Scraper with Likers & Commenters with Python

Pull posts from a LinkedIn profile's activity feed or a direct post URL, with engagement counts, hashtags, media, and optionally the people who liked or commented on each post. Requires a LinkedIn session cookie.

1. Choose the data you need

Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.

2. Prepare a source-based input

This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.

{
  "includeReposts": true,
  "includeVideoTranscript": false,
  "language": "en",
  "maxComments": 10,
  "maxInteractors": 50,
  "maxPosts": 1,
  "minComments": 0,
  "minReactions": 0,
  "mode": "postUrls",
  "postUrl": "https://www.linkedin.com/posts/nvidia_ai-is-technology-that-is-built-and-improved-activity-7508569677040893954-sffp",
  "postedLimit": "",
  "profileUrl": "https://www.linkedin.com/in/satyanadella",
  "scrapeInteractors": false,
  "scrapeReactions": false
}

Download input.example.json and save your reviewed copy as input.json.

FieldTypeRequiredDescription
modestringoptionalWhat to scrape. "Auto" uses the URLs you provide; the actor picks the right pipeline automatically.
profileUrlstringoptional(mode=profilePosts or auto) LinkedIn profile URL, e.g. https://www.linkedin.com/in/williamhgates, or just the username.
postUrlstringoptional(mode=postUrls or auto) A LinkedIn post link, feed-update link, activity URN or bare activity ID. No login needed.
postUrlsarrayoptional(mode=postUrls) A list of LinkedIn post links, feed-update links, activity URNs or bare activity IDs. Combined with Post URL if both are set.
maxPostsintegeroptionalMaximum number of posts to return. Cookieless profile feeds are capped by LinkedIn at the newest ~8 public posts; with the optional cookie the feed paginates up to this limit.
postedLimitstringoptionalKeep only posts published within this window. "Any time" keeps everything.
postedAfterstringoptionalOptional. Keep posts published on or after this date. Format: 2026-01-31 or full ISO 8601.
postedBeforestringoptionalOptional. Keep posts published on or before this date. Format: 2026-01-31 or full ISO 8601.
maxCommentsintegeroptionalHow many top comments to include per post. LinkedIn shows ~10 comments to logged-out visitors and the cookie path adds commenter profile URLs to those same first ~10 - a documented source ceiling either way.
includeVideoTranscriptbooleanoptionalWhen on, video posts include the full spoken transcript (can make rows large).
scrapeInteractorsbooleanoptionalOptional extra. Requires the LinkedIn Cookie field and adds the first page of commenters with profile URLs/headlines. Cookieless runs always include engagement counts and the top comments.
scrapeReactionsbooleanoptionalWith Scrape Likers & Commenters on, also include the first page of likers (name/headline/profile URL). Requires the optional cookie. LinkedIn's liker pagination endpoint is not available to visitors, so this is the visible first page only.
maxInteractorsintegeroptionalCap applied separately to the likers list and the commenters list of each post when interactor scraping is enabled.
cookiestringoptionalOptional and never required - the actor works without any login. If supplied, it unlocks extra data: profile feeds paginate past the ~10-post cookieless ceiling up to Max Posts, and every post gains reaction-type breakdowns, reposts/views counts and the first page of likers/commenters. Accepts the li_at value, a raw cookie header, or a full cookies JSON array.
cookiesarrayoptionalFull browser cookie export for linkedin.com as a JSON array of {name, value} objects (Cookie-Editor extension -> Export -> JSON). Same effect as the Cookie field - merged with it when both are set. Optional and never required.
languagestringoptionalLanguage hint sent to LinkedIn. Affects localized content where available.
includeRepostsbooleanoptionalWhen off, reposts/reshared posts are excluded from the output.
minReactionsintegeroptionalSkip posts that received fewer than this many reactions. 0 keeps everything.
minCommentsintegeroptionalSkip posts that received fewer than this many comments. 0 keeps everything.
mediaTypesarrayoptionalRestrict output to specific post media types. Leave empty to keep all. Cookieless runs detect text, image, video and repost posts.

3. Start an Actor run

Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.

Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.

import json
import os
import urllib.request

# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
    actor_input = json.load(stream)

token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
    "https://api.apify.com/v2/acts/I4oTw7vyuPTBhJ8UF/runs?timeout=120&maxTotalChargeUsd=0.50",
    data=json.dumps(actor_input).encode("utf-8"),
    headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
    method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
    run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.

4. Inspect the actual results

Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.

One record per public LinkedIn post: text, author and follower count, engagement counts, top comments, media and video metadata, hashed from logged-out pages.

Questions before you run

Which inputs are required?

No top-level fields are marked required in the published schema. Conditional requirements can still apply; check the README.

What does this guide verify?

The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.

What if the run request times out?

Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.

Generated from source build PMjjgrE6QguMnaiyI and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.