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.
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.
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.
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 sStep 4: Filter to top tier
Only pass scores >= 4 to the SDR queue.
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.
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
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
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
Per-commenter enriched row with score. Typical post with 80 comments yields 8-15 qualified leads in under 3 minutes.