agentleFS
rdoser13rdoser13/free-claude-skills/linkedin-profile-scraper/SKILL.md

linkedin-profile-scraper

Skill3 starsChanged 3 months agoMITView on GitHub

Scrape LinkedIn profile post data using the Apify LinkedIn Profile Post Scraper and export it as a structured CSV. Use this skill when the user wants to pull LinkedIn post metrics, analyze LinkedIn content performance, scrape a LinkedIn profile's posts, or export LinkedIn engagement data. Also trigger when the user mentions Apify and LinkedIn together, or asks about post-level LinkedIn analytics.

  • Sends data out

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask how many posts to scrape if not specified.

    line 21
  2. Very specific:

    Use the Apify REST API to trigger the LinkedIn Profile Post Scraper actor (curious_coder/linkedin-profile-post-scraper).

    line 25
  3. Distinctive:

    Wait for the run to complete by polling the run status endpoint.

    line 36
  4. Distinctive:

    Use a weighted formula normalized to a 0–10 scale:

    line 57
  5. Distinctive:

    After computing raw scores for all posts, normalize to 0–10:

    line 67
  6. Distinctive:

    Edge case: If all posts have zero engagement, set all scores to 0.

    line 75
  7. Very specific:

    Write the CSV to the current working directory as linkedin-posts-YYYY-MM-DD.csv (using today's date).

    line 79
  8. Distinctive:

    Rate limiting: If scraping a large number of posts (200+), the actor run may take several minutes.

    line 93

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

LinkedIn Profile Post Scraper

Scrape a LinkedIn profile's posts via the Apify LinkedIn Profile Post Scraper actor and export the results as a clean, analysis-ready CSV.

Prerequisites

  • An Apify API token. The user must provide this or have it set as an environment variable (APIFY_API_TOKEN). If neither exists, ask for it before proceeding. The free Apify tier works for small runs.
  • The target LinkedIn profile URL (e.g., https://www.linkedin.com/in/username/)

Step 1: Validate inputs

  1. Confirm the Apify API token is available — check $APIFY_API_TOKEN env var first, then ask the user.
  2. Confirm a valid LinkedIn profile URL was provided as the argument ($ARGUMENTS). It should match the pattern https://www.linkedin.com/in/....
  3. Ask how many posts to scrape if not specified. Default to 50.

Step 2: Run the Apify actor

Use the Apify REST API to trigger the LinkedIn Profile Post Scraper actor (curious_coder/linkedin-profile-post-scraper).

curl -X POST "https://api.apify.com/v2/acts/curious_coder~linkedin-profile-post-scraper/runs?token=$APIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "profileUrls": ["<LINKEDIN_PROFILE_URL>"],
    "maxPosts": <NUMBER_OF_POSTS>
  }'

Wait for the run to complete by polling the run status endpoint. Then fetch the dataset items from the default dataset.

Step 3: Transform into CSV

Parse the raw JSON output and map it to these columns:

ColumnSourceNotes
DatepostedAt or postedDateFormat as YYYY-MM-DD
Post URLpostUrl or urlFull LinkedIn post URL
Post TypetypeNormalize to: text, image, linkedinVideo, article, document, poll
LikeslikeCount or numLikesInteger, default 0 if missing
CommentscommentCount or numCommentsInteger, default 0 if missing
SharesshareCount or numSharesInteger, default 0 if missing
Engagement ScoreCalculatedSee formula below
Post Text (First 300 chars)text or postTextTruncate to 300 characters. Escape commas and newlines for CSV safety

Field name flexibility: Apify actor output schemas change over time. The field names above are common variants — inspect the actual JSON keys returned and map accordingly. If a field is missing entirely, log a warning and default to 0 for numeric fields or "N/A" for text fields.

Step 4: Calculate Engagement Score

Use a weighted formula normalized to a 0–10 scale:

Raw Score = Likes × 1 + Comments × 3 + Shares × 2
  • Comments are weighted 3x because they require the most effort and signal genuine interest.
  • Shares are weighted 2x because they extend reach and imply endorsement.
  • Likes are weighted 1x as baseline engagement.

After computing raw scores for all posts, normalize to 0–10:

Engagement Score = (Raw Score / Max Raw Score in Dataset) × 10

Round to one decimal place. The highest-performing post always scores 10.0 and everything else is relative to it.

Edge case: If all posts have zero engagement, set all scores to 0.

Step 5: Export and deliver

  1. Write the CSV to the current working directory as linkedin-posts-YYYY-MM-DD.csv (using today's date).
  2. Sort rows by date descending (newest first).
  3. Print a summary to the terminal:
    • Total posts scraped
    • Date range covered
    • Average engagement score
    • Top 3 posts by engagement score (show date, type, score, and first 80 chars of text)
  4. Tell the user where the file was saved.

Troubleshooting

  • 401 or 403 from Apify: The API token is invalid or expired. Ask the user to verify it.
  • Empty dataset: The actor may have failed silently. Check the Apify run log URL (returned in the run response) and share it with the user.
  • Missing fields in output: Apify actors update their schemas. Inspect the raw JSON first and adapt the field mapping. Don't fail hard — default missing values and warn the user.
  • Rate limiting: If scraping a large number of posts (200+), the actor run may take several minutes. Poll with a 10-second interval and let the user know it's running.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.