Tutorial

How to Enrich LinkedIn Post Comments for Buyer Intent

Turn LinkedIn post comments into qualified leads by enriching commenters with Scavio SERP lookups for company, role, and recent signal.

LinkedIn post comments on niche industry posts are the highest-intent signal most SDRs ignore. This tutorial scrapes commenters off a target post, enriches each with Scavio SERP lookups for company, role, and recent activity, then scores for buyer-intent.

Prerequisites

  • Python 3.10+
  • A Scavio API key
  • A LinkedIn post URL with target commenters
  • The Scavio LinkedIn comments endpoint

Walkthrough

Step 1: Pull comments from the target post

Scavio's LinkedIn endpoint returns commenters with names and headlines.

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

def comments(post_url):
    r = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'platform': 'linkedin', 'query': post_url})
    return r.json().get('comments', [])

Step 2: Enrich each commenter via SERP

Look up LinkedIn profile + recent company news.

Python
def enrich(person):
    serp = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'"{person["name"]}" "{person.get("company", "")}"', 'num_results': 5})
    return serp.json().get('organic_results', [])

Step 3: Score buyer intent

Points for commenter role (VP+), company size (fits ICP), recent hiring signal.

Python
def score(person, enrichment):
    s = 0
    if any(kw in person.get('headline', '').lower() for kw in ['ceo', 'founder', 'vp', 'head']): s += 3
    if any('hiring' in r.get('snippet', '').lower() for r in enrichment): s += 2
    return s

Step 4: Filter to top tier

Only pass scores >= 4 to the SDR queue.

Python
def qualified(people, threshold=4):
    return [p for p in people if p['score'] >= threshold]

Step 5: Write to HubSpot or CSV

Push each qualified commenter.

Python
import csv
def export(people):
    with open('linkedin_intent.csv', 'w') as f:
        w = csv.DictWriter(f, fieldnames=['name', 'company', 'headline', 'score'])
        w.writeheader(); w.writerows(people)

Python Example

Python
import os, requests

API_KEY = os.environ['SCAVIO_API_KEY']
POST = 'https://linkedin.com/posts/example_post'

r = requests.post('https://api.scavio.dev/api/v1/search',
    headers={'x-api-key': API_KEY},
    json={'platform': 'linkedin', 'query': POST})
for c in r.json().get('comments', [])[:10]:
    e = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'"{c["name"]}"'}).json()
    print(c['name'], '-', e.get('organic_results', [{}])[0].get('title', ''))

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
const POST = 'https://linkedin.com/posts/example_post';

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({ platform: 'linkedin', query: POST })
});
const { comments } = await r.json();
for (const c of comments.slice(0, 10)) {
  const e = 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: `"${c.name}"` })
  });
  console.log(c.name, (await e.json()).organic_results?.[0]?.title);
}

Expected Output

JSON
Per-commenter enriched row with score. Typical post with 80 comments yields 8-15 qualified leads in under 3 minutes.

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.

Python 3.10+. A Scavio API key. A LinkedIn post URL with target commenters. The Scavio LinkedIn comments endpoint. 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

Turn LinkedIn post comments into qualified leads by enriching commenters with Scavio SERP lookups for company, role, and recent signal.