LinkedIn Profile Scraper - Real Data Extractor
Pricing
Pay per event
LinkedIn Profile Scraper - Real Data Extractor
Extract 100% real data from LinkedIn profiles and company pages - followers, connections, posts, engagement metrics, and intelligent analysis. Cookie-based authentication.
0.0 (0)
Pricing
Pay per event
0
2
2
Last modified
6 hours ago
LinkedIn Profile Scraper - Complete Guide
A production-ready Apify actor that scrapes REAL, ACCURATE data from LinkedIn profiles and company pages using cookie authentication. Every single metric is scraped directly from the profile - no estimates, no AI generation.
β What This Actor Scrapes (100% Real Data)
For Personal Profiles:
- Profile Information
- Full name
- Headline
- Location
- About section (complete text)
- Exact follower count
- Exact connection count (e.g., 500+ or actual number if visible)
- Professional Experience
- Job titles
- Companies
- Duration for each position
- Education
- Schools attended
- Degrees obtained
- Years attended
- Skills
- All listed skills
- Endorsement counts for each skill
For Company Pages:
- Company name
- Tagline
- Complete description
- Website URL
- Industry
- Company size
- Headquarters location
- Founded year
- Specialties
- Exact follower count
- Number of employees on LinkedIn
For All Profiles (Posts & Engagement):
-
Total counts (scraped, not estimated):
- Total number of posts
- Total likes across all posts
- Total comments across all posts
- Total reposts/shares
-
Averages (calculated from real data):
- Average likes per post
- Average comments per post
- Average reposts per post
-
Top 3 Posts (by engagement):
- Post content (first 300 characters)
- Timestamp
- Exact like count
- Exact comment count
- Exact repost count
- Whether post has media
- Engagement score
Analysis (Based on Real Data):
- Account type (Company/Personal)
- Strengths (data-driven)
- Weaknesses (data-driven)
- Collaboration opportunities
- Engagement quality assessment
- Content strategy recommendations
- Overall score (0-100)
- Performance rating
π Step-by-Step Deployment to Apify
Step 1: Prepare Your Files
-
Download all the files from this project:
src/main.jssrc/profileScraper.jssrc/postScraper.jssrc/activityScraper.jssrc/analyzer.jspackage.jsonDockerfile.actor/actor.json.actor/input_schema.json
-
Create this folder structure:
linkedin-scraper/βββ src/β βββ main.jsβ βββ profileScraper.jsβ βββ postScraper.jsβ βββ activityScraper.jsβ βββ analyzer.jsβββ .actor/β βββ actor.jsonβ βββ input_schema.jsonβββ package.jsonβββ Dockerfileβββ README.md
Step 2: Create Apify Account
- Go to https://apify.com/
- Sign up for a free account
- Verify your email
Step 3: Create New Actor
- Log into Apify Console
- Click "Actors" in the left sidebar
- Click "Create new" button (top right)
- Choose "From scratch"
- Enter actor name:
linkedin-profile-scraper - Click "Create"
Step 4: Upload Files
Option A: Using Git (Recommended)
- Initialize git in your project folder:
git initgit add .git commit -m "Initial commit"
- In Apify Console, go to your actor's "Source" tab
- Click "Connect GitHub" or "Connect GitLab"
- Push your code to the repository
- The actor will auto-build
Option B: Using Apify CLI
- Install Apify CLI:
$npm install -g apify-cli
- Login to Apify:
$apify login
- Navigate to your project folder:
$cd linkedin-scraper
- Push to Apify:
$apify push
Option C: Manual Upload
- In Apify Console, go to your actor's "Source" tab
- Select "Source files" tab
- Manually create each file and copy/paste the content
- Make sure to maintain the folder structure
Step 5: Build the Actor
- After uploading files, click "Build" button (top right)
- Wait for build to complete (usually 2-3 minutes)
- Check the build log for any errors
- If successful, you'll see "Build succeeded"
π How to Get LinkedIn Cookies
LinkedIn requires authentication to view profile data. Here's how to get your cookies:
Method 1: Using Browser DevTools (Chrome)
-
Login to LinkedIn in Chrome
-
Press
F12to open DevTools -
Go to "Application" tab
-
In the left sidebar, expand "Cookies"
-
Click on
https://www.linkedin.com -
You'll see all cookies - you need to export these important ones:
li_at(most important - session token)JSESSIONIDli_a- Any other cookies you see
-
For each cookie, note down:
- Name
- Value
- Domain
- Path
Method 2: Using Cookie Export Extension
- Install "Cookie-Editor" extension for Chrome/Firefox
- Login to LinkedIn
- Click the Cookie-Editor icon
- Click "Export" β "JSON"
- Copy the JSON array
Example Cookie Format:
[{"name": "li_at","value": "AQEDATEqwer...(long string)","domain": ".linkedin.com","path": "/","secure": true,"httpOnly": true},{"name": "JSESSIONID","value": "ajax:1234567890","domain": ".linkedin.com","path": "/","secure": true}]
β οΈ IMPORTANT:
- Keep these cookies PRIVATE - they give access to your account
- Cookies expire after some time (usually weeks) - you'll need to refresh them
- Never share your cookies publicly
π How to Run the Actor
Step 1: Prepare Input
- Go to your actor in Apify Console
- Click "Console" tab (or "Run" tab)
- You'll see an input form
Step 2: Fill in the Input
Example Input for Personal Profile:
{"profileUrl": "https://www.linkedin.com/in/williamhgates/","cookies": [{"name": "li_at","value": "YOUR_LI_AT_COOKIE_VALUE_HERE","domain": ".linkedin.com","path": "/"},{"name": "JSESSIONID","value": "YOUR_JSESSIONID_VALUE_HERE","domain": ".linkedin.com","path": "/"}]}
Example Input for Company Page:
{"profileUrl": "https://www.linkedin.com/company/microsoft/","cookies": [{"name": "li_at","value": "YOUR_LI_AT_COOKIE_VALUE_HERE","domain": ".linkedin.com","path": "/"}]}
Step 3: Run the Actor
- Click "Start" button (bottom right)
- The actor will start running
- You can monitor progress in the "Log" tab
- Wait for completion (usually 1-3 minutes)
Step 4: View Results
- Once completed, go to "Dataset" tab
- Click on the first item to see full results
- You can download as:
- JSON
- CSV
- Excel
- RSS
π Understanding the Output
The actor returns a comprehensive JSON object with all scraped data:
{"profile": {"accountType": "Personal","name": "Bill Gates","headline": "Co-chair, Bill & Melinda Gates Foundation","location": "Seattle, Washington","about": "Full about text...","connections": 500,"followers": 35287456,"experience": [...],"education": [...],"skills": [...]},"activity": {"profileViews": 12345,"searchAppearances": 5678},"posts": {"totalPosts": 47,"totalLikes": 125000,"totalComments": 3500,"totalReposts": 850,"averageLikesPerPost": 2659,"averageCommentsPerPost": 74,"averageRepostsPerPost": 18,"top3Posts": [{"content": "Post content here...","timestamp": "1w ago","likes": 15000,"comments": 450,"reposts": 120,"hasMedia": true,"engagementScore": 2370}]},"analysis": {"accountType": "Personal","strengths": ["Extensive network: 500+ connections","Strong thought leadership: 35,287,456 followers","Active content creator: 47 recent posts"],"weaknesses": [],"collaborationOpportunities": ["Consulting opportunities in...","Thought leadership partnerships"],"engagementQuality": "Excellent - Posts generate meaningful discussions","contentStrategy": "Visual content performs well...","overallScore": 95,"performanceRating": "Excellent"},"metadata": {"scrapedAt": "2025-10-28T10:30:00.000Z","profileUrl": "https://www.linkedin.com/in/williamhgates/","accountType": "Personal"}}
π§ Troubleshooting
"Authentication failed" Error
Problem: Cookies are invalid or expired
Solution:
- Get fresh cookies from LinkedIn (follow the guide above)
- Make sure you're logged into LinkedIn when exporting cookies
- Include the
li_atcookie - this is the most important one - Try adding more cookies (JSESSIONID, li_a, etc.)
"Cannot read profile" Error
Problem: Profile URL is incorrect or inaccessible
Solution:
- Verify the URL format:
- Personal:
https://www.linkedin.com/in/username/ - Company:
https://www.linkedin.com/company/companyname/
- Personal:
- Make sure the profile is public or you have access
- Try accessing the URL in your browser while logged in
No Posts Data
Problem: Profile has no recent posts or posts aren't loading
Solution:
- This is expected if the profile hasn't posted recently
- Some profiles have restricted post visibility
- The actor will still return other profile data
Build Fails
Problem: Actor doesn't build successfully
Solution:
- Check all files are uploaded correctly
- Verify folder structure matches the guide
- Check the build log for specific errors
- Make sure
package.jsonhas correct dependencies
π― Use Cases
This actor is perfect for:
-
Competitive Analysis
- Track competitor engagement metrics
- Analyze content strategy
- Monitor follower growth
-
Lead Generation
- Qualify leads based on profile completeness
- Identify collaboration opportunities
- Find high-engagement profiles
-
Recruitment
- Verify candidate information
- Assess professional presence
- Check engagement quality
-
Market Research
- Company analysis
- Industry insights
- Trend identification
-
Personal Branding
- Audit your own profile
- Identify improvement areas
- Track growth over time
β‘ Performance
- Speed: 1-3 minutes per profile
- Accuracy: 100% - all data scraped directly
- Cost: ~$0.02-0.05 per run (Apify pricing)
- Rate Limit: Recommended 1 profile every 30 seconds
π Privacy & Ethics
Please use responsibly:
- Only scrape publicly available information
- Respect LinkedIn's Terms of Service
- Don't use for spam or harassment
- Keep your cookies secure
- Don't scrape at high volume (rate limiting exists for a reason)
- Use this for legitimate business purposes only
π Support
If you encounter issues:
- Check the troubleshooting section above
- Review the Apify actor logs for detailed error messages
- Verify your cookies are fresh and valid
- Test with a simple profile first (like a public figure)
π License
Apache-2.0
π You're Ready!
Follow the steps above and you'll have a working LinkedIn scraper in under 30 minutes. Every number, every metric, every piece of data is scraped directly from LinkedIn - no estimates, no AI generation, just real data.
Happy scraping! π
