数字营销机构需要稳定的合格销售线索:需要网站、搜索引擎优化或数字营销服务的本地企业。在 Google 地图上手动寻找 30-40 个潜在客户每次需要 4-6 小时。本教程自动化了管道:搜索目标利基市场和城市中的企业,评估其在线形象,按机会对其进行评分,并导出合格的潜在客户以进行外展。
前置条件
- 已安装 Python 3.8+
- 请求已安装库
- 来自 scavio.dev 的 Scavio API 密钥
- 目标利基市场和城市列表
操作指南
步骤 1: 定义您的目标利基和城市
设置搜索矩阵:哪些业务类型在哪些位置。
Python
NICHES = ['plumber', 'electrician', 'dentist', 'restaurant', 'auto repair']
CITIES = ['Austin TX', 'Denver CO', 'Portland OR', 'Nashville TN']
API_KEY = os.environ['SCAVIO_API_KEY']步骤 2: 搜索企业
向 Google 查询每个利基城市组合,以找到当地企业。
Python
import requests, os
H = {'x-api-key': API_KEY}
def find_businesses(niche: str, city: str) -> list:
resp = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': f'{niche} {city}'}, timeout=10)
return [{'name': r['title'], 'url': r.get('link', ''), 'snippet': r.get('snippet', '')}
for r in resp.json().get('organic', [])[:10]]步骤 3: 通过机会对每个潜在客户进行评分
评估潜在客户的在线状态,以估计他们对您的服务的需求程度。
Python
def score_lead(lead: dict) -> dict:
url = lead.get('url', '')
score = 5 # baseline
# No website or directory listing only
if 'yelp.com' in url or 'yellowpages' in url:
score += 3 # high opportunity, no owned website
# Check for reviews mention in snippet
snippet = lead.get('snippet', '').lower()
if 'no reviews' in snippet or 'be the first' in snippet:
score += 2 # low online presence
lead['opportunity_score'] = min(score, 10)
return lead
# Score all leads
scored = [score_lead(l) for l in leads]步骤 4: 运行完整管道并导出
迭代所有利基城市组合,获得领先优势,并导出排名靠前的组合。
Python
import csv, time
def run_pipeline() -> list:
all_leads = []
for niche in NICHES:
for city in CITIES:
businesses = find_businesses(niche, city)
for b in businesses:
b['niche'] = niche
b['city'] = city
score_lead(b)
all_leads.append(b)
time.sleep(0.5)
all_leads.sort(key=lambda x: x['opportunity_score'], reverse=True)
with open('qualified_leads.csv', 'w', newline='') as f:
w = csv.DictWriter(f, fieldnames=['name', 'niche', 'city', 'url', 'opportunity_score'])
w.writeheader()
w.writerows([{k: l[k] for k in ['name', 'niche', 'city', 'url', 'opportunity_score']} for l in all_leads[:50]])
print(f'Exported top 50 of {len(all_leads)} leads')
return all_leads
run_pipeline()Python 示例
Python
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def prospect(niche, city):
data = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': f'{niche} {city}'}, timeout=10).json()
return [{'name': r['title'], 'url': r.get('link', ''), 'directory_only': 'yelp' in r.get('link', '')}
for r in data.get('organic', [])[:10]]JavaScript 示例
JavaScript
async function prospect(niche, city) {
const data = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
body: JSON.stringify({platform: 'google', query: `${niche} ${city}`})
}).then(r => r.json());
return (data.organic || []).slice(0, 10).map(r => ({name: r.title, url: r.link}));
}预期输出
JSON
A CSV of qualified local business leads scored by opportunity, ready for import into outreach tools like Instantly or Smartlead.