How to Scrape LinkedIn Profiles With Claude Code (Free)
If you want to pull post analytics from LinkedIn without paying for expensive tools, you can scrape LinkedIn profiles with Claude Code using a free Apify account and a simple skill file.How to Scrape LinkedIn Profiles With Claude Code
Most AI chatbots will flat-out refuse this request. Ask ChatGPT, Claude's web app, or Google Gemini to scrape a LinkedIn profile, and you'll get the same response: "I'm not able to scrape LinkedIn directly." LinkedIn blocks automated scraping and requires authentication to access profile data. That means you need a workaround. The solution is pairing Claude Code with Apify, a marketplace of pre-built scrapers for LinkedIn, Instagram, TikTok, Google Maps, and more. If you want to go deeper on building AI-powered marketing workflows, I put together a guide with everything I use daily. Get my free AI Marketing Essentials Guide
Setting Up Apify for LinkedIn Scraping
You only need two things to get started: a free Apify account and your API key saved in Claude Code. The specific scraper I use is the LinkedIn Profile Posts Scraper from Harvest API. It costs $2 per 1,000 posts, requires no cookies, and works without a paid Apify subscription. Apify's free tier gives you $5 of usage every month, which covers roughly 2,500 posts. Here is how to connect it:- Create a free account on Apify
- Go to Settings, then API and Integrations
- Copy your API token
- In Claude Code, tell it to save your Apify API key in your environment file
Running the LinkedIn Profile Scraper Skill
Once your API key is saved, open a fresh Claude Code chat and tell it to use your LinkedIn profile scraper skill. Point it at any public LinkedIn profile URL and specify how many posts you want scraped. In my test, I scraped my last 50 LinkedIn posts and asked Claude Code to export everything as a CSV file. The fields included post date, URL, post type, likes, comments, shares, and a custom engagement score that ranks posts against each other.
Analyzing Your LinkedIn Post Data
Reading a CSV in VS Code is not ideal for analysis. I dragged the file into Google Drive and opened it with Google Sheets. That gives you sorting, filtering, and a much cleaner view of your post performance. The engagement score column stood out immediately. My highest-scoring post (a 10 out of 10) was a personal update about expecting my first child. Personal posts consistently outperform promotional content on LinkedIn, and the data confirmed that pattern across all 50 posts.
