LinkedIn Post Research
Search LinkedIn posts by one or more keywords using the Apify apimaestro/linkedin-posts-search-scraper-no-cookies actor. The runbook returns author details, post text, engagement metrics, dates, hashtags, activity IDs, and direct LinkedIn URLs without…
7 steps · start to finish.
- 1Step 1
Environment Setup
▶- Create the results directory and verify required inputs are present.
- Verify
APIFY_API_TOKENis set without printing its value. - Install Python dependencies if needed.
mkdir -p /app/results python3 -m pip install requests python3 - <<'PY' import os, sys if not os.environ.get("APIFY_API_TOKEN"): sys.exit("ERROR: APIFY_API_TOKEN is not set") PYIf setup fails, write
validation_report.jsonwith thesetupstage markedpassed=false, then stop. - 2Step 2
Run LinkedIn Post Searches
▶For each keyword, submit an Apify actor run with keyword, maxItems, and sortBy. Poll until the run reaches SUCCEEDED, FAILED, ABORTED, or the configured timeout. Retry a failed or timed-out actor run…
- 3Step 3
Fetch and Normalize Results
▶Fetch the actor dataset items for each successful run. Normalize each item to this schema: author, author_headline, author_profile_url, keyword, reactions, comments, shares, reactions_by_type, date…
- 4Step 4
Sort and Export Outputs
▶Sort the final post list by total reactions descending when sort_by=relevance, or by post date descending when sort_by=date_posted. Write JSON and CSV outputs to /app/results/linkedin_posts.json and…
- 5Step 5
Summarize Findings
▶Write /app/results/summary.md with:
- 6Step 6
Validate Outputs
▶Validate that every required output file exists and is non-empty. Parse linkedin_posts.json as JSON, verify it is an array, and check that each object has author, keyword, url, and activity_id fields…
- 7Step 7
Iterate on Errors (max 3 rounds)
▶If validation fails or the actor returns zero results for all keywords, run up to max 3 rounds of targeted fixes: