数以百万计的当地企业仍然在没有网站的情况下运营,仅依靠 Google Business Profile、Yelp 或 Facebook。这些是网页设计机构、本地搜索引擎优化服务和数字营销的主要前景。本教程使用 SERP 数据来识别仅出现在目录列表中但缺少自己的域的企业。每次搜索的费用为 0.005 美元,每次查询通常会显示 3-5 个无网站的企业。
前置条件
- 已安装 Python 3.9+
- 请求已安装库
- 来自 scavio.dev 的 Scavio API 密钥
操作指南
步骤 1: 搜索本地企业并对结果进行分类
搜索业务类别和位置,然后将每个结果分类为拥有自己的网站或仅出现在目录中。
Python
import requests, os, re
SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
DIRECTORY_DOMAINS = {
'yelp.com', 'yellowpages.com', 'facebook.com', 'bbb.org',
'angi.com', 'homeadvisor.com', 'thumbtack.com', 'mapquest.com',
'manta.com', 'chamberofcommerce.com', 'google.com',
'nextdoor.com', 'bark.com', 'expertise.com'
}
def classify_result(result: dict) -> str:
link = result.get('link', '')
domain = link.split('/')[2] if '/' in link else ''
base = '.'.join(domain.split('.')[-2:]) # e.g., yelp.com
if base in DIRECTORY_DOMAINS:
return 'directory'
return 'own_website'
def find_no_website(category: str, location: str) -> list:
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'},
json={'query': f'{category} in {location}', 'country_code': 'us', 'num_results': 10})
results = resp.json().get('organic_results', [])
directory_only = []
for r in results:
if classify_result(r) == 'directory':
# Extract business name from directory listing title
name = r['title'].split(' - ')[0].split(' | ')[0].strip()
directory_only.append({
'name': name, 'listing_url': r['link'],
'directory': r['link'].split('/')[2],
'snippet': r.get('snippet', ''),
'category': category, 'location': location
})
return directory_only
prospects = find_no_website('plumber', 'Austin TX')
print(f'Found {len(prospects)} businesses without websites')
for p in prospects[:5]:
print(f' {p["name"]} (via {p["directory"]})')步骤 2: 验证企业确实缺乏网站
通过直接搜索每个企业名称进行仔细检查。如果结果中没有出现自有域名,则他们可能没有网站。
Python
import time
def verify_no_website(business_name: str, location: str) -> dict:
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'},
json={'query': f'{business_name} {location}',
'country_code': 'us', 'num_results': 5})
results = resp.json().get('organic_results', [])
for r in results:
if classify_result(r) == 'own_website':
return {'has_website': True, 'website': r['link']}
return {'has_website': False, 'website': None}
# Verify top prospects
verified_prospects = []
for p in prospects[:5]:
check = verify_no_website(p['name'], p['location'])
p['verified_no_website'] = not check['has_website']
p['found_website'] = check['website']
if not check['has_website']:
verified_prospects.append(p)
status = 'NO WEBSITE' if not check['has_website'] else f'Has: {check["website"]}'
print(f' {p["name"]}: {status}')
time.sleep(0.3)
print(f'\nVerified {len(verified_prospects)} businesses without websites')步骤 3: 跨多个位置扩展并导出
跨多个位置类别对运行管道并导出经过验证的潜在客户。
Python
import csv
def pipeline(categories: list, locations: list) -> list:
all_prospects = []
queries = 0
for loc in locations:
for cat in categories:
prospects = find_no_website(cat, loc)
queries += 1
for p in prospects[:3]: # verify top 3 per query
check = verify_no_website(p['name'], p['location'])
queries += 1
if not check['has_website']:
all_prospects.append(p)
time.sleep(0.3)
print(f'Queries used: {queries} (${queries * 0.005:.3f})')
return all_prospects
categories = ['plumber', 'electrician']
locations = ['Austin TX', 'Denver CO']
prospects = pipeline(categories, locations)
if prospects:
with open('no_website_leads.csv', 'w', newline='') as f:
writer = csv.DictWriter(f, fieldnames=['name', 'directory', 'listing_url',
'category', 'location'])
writer.writeheader()
for p in prospects:
writer.writerow({k: p[k] for k in writer.fieldnames})
print(f'Exported {len(prospects)} leads to no_website_leads.csv')Python 示例
Python
import requests, os
SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
DIRS = {'yelp.com', 'yellowpages.com', 'facebook.com', 'bbb.org', 'angi.com'}
def find_no_website(category, location):
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'},
json={'query': f'{category} in {location}', 'country_code': 'us', 'num_results': 10})
prospects = []
for r in resp.json().get('organic_results', []):
domain = r['link'].split('/')[2] if '/' in r['link'] else ''
base = '.'.join(domain.split('.')[-2:])
if base in DIRS:
prospects.append({'name': r['title'].split(' - ')[0], 'directory': base})
return prospects
for p in find_no_website('plumber', 'Austin TX'):
print(f'{p["name"]} (via {p["directory"]})')JavaScript 示例
JavaScript
const SCAVIO_KEY = process.env.SCAVIO_API_KEY;
const DIRS = new Set(['yelp.com', 'yellowpages.com', 'facebook.com', 'bbb.org', 'angi.com']);
async function findNoWebsite(category, location) {
const resp = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: `${category} in ${location}`, country_code: 'us', num_results: 10 })
});
const data = await resp.json();
return (data.organic_results || []).filter(r => {
const domain = new URL(r.link).hostname.split('.').slice(-2).join('.');
return DIRS.has(domain);
}).map(r => ({ name: r.title.split(' - ')[0], directory: new URL(r.link).hostname }));
}
findNoWebsite('plumber', 'Austin TX').then(p => p.forEach(x => console.log(`${x.name} (${x.directory})`)));预期输出
JSON
Found 5 businesses without websites
Joe's Plumbing (via yelp.com)
Reliable Plumbing Services (via yellowpages.com)
Quick Fix Plumbing (via facebook.com)
Joe's Plumbing: NO WEBSITE
Reliable Plumbing Services: Has: reliableplumbingaustin.com
Quick Fix Plumbing: NO WEBSITE
Verified 3 businesses without websites
Queries used: 10 ($0.050)
Exported 8 leads to no_website_leads.csv