Tutorial

How to Scrape LinkedIn Posts in n8n

Discover LinkedIn posts without login by combining Google SERP site operator with n8n HTTP Request nodes and Scavio.

LinkedIn blocks direct scraping. The safe 2026 pattern uses Google's site:linkedin.com operator to surface public posts and fetches them through Scavio in n8n HTTP Request nodes. No LinkedIn cookies, no account risk.

Prerequisites

  • n8n Cloud or self-hosted
  • A Scavio API key
  • A target keyword or competitor name

Walkthrough

Step 1: Add an n8n Schedule trigger

Run every 30 minutes for fresh signal.

Text
// Schedule Trigger
Interval: 30 minutes

Step 2: Add an HTTP Request node to Scavio

Call Scavio with a site:linkedin.com/posts query.

Text
// HTTP Request node
Method: POST
URL: https://api.scavio.dev/api/v1/search
Headers: x-api-key: {{$env.SCAVIO_API_KEY}}
Body: {
  "query": "site:linkedin.com/posts {{$json.keyword}}",
  "num_results": 20
}

Step 3: Parse organic_results

Each post returns with title (author + snippet) and URL.

JavaScript
// n8n Code node
return items[0].json.organic_results.map(r => ({
  json: { author: r.title.split('|')[0], url: r.link, snippet: r.snippet }
}));

Step 4: Deduplicate against prior runs

Store seen URLs in an n8n Data Table to skip duplicates.

Text
// Data Table node
Action: Upsert
Key: url
Table: linkedin_posts_seen

Step 5: Route new posts downstream

Pipe to Slack, Airtable, or a second workflow for enrichment.

Text
// Slack node
Message: New LinkedIn post by {{$json.author}}: {{$json.url}}

Python Example

Python
import os, requests
API_KEY = os.environ['SCAVIO_API_KEY']

def linkedin_posts(keyword):
    r = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'site:linkedin.com/posts {keyword}', 'num_results': 20})
    return r.json().get('organic_results', [])

for p in linkedin_posts('AI agents gtm'):
    print(p['link'])

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
export async function linkedinPosts(keyword) {
  const r = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ query: `site:linkedin.com/posts ${keyword}`, num_results: 20 })
  });
  return (await r.json()).organic_results || [];
}

Expected Output

JSON
List of public LinkedIn posts matching the keyword with author, URL, and snippet. Runs every 30 minutes, new posts only.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

n8n Cloud or self-hosted. A Scavio API key. A target keyword or competitor name. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Discover LinkedIn posts without login by combining Google SERP site operator with n8n HTTP Request nodes and Scavio.