技能圖譜SKILLSGROVE
技能圖譜/效率工具/aiagentwithdhruv/skills/scrape-leads

scrape-leads

安裝

$npx skills add https://github.com/aiagentwithdhruv/skills --skill scrape-leads
$git clone --depth 1 https://github.com/aiagentwithdhruv/skills.git /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/scrape-leads ~/.claude/skills/scrape-leads
請幫我安裝這個 Agent Skill:https://github.com/aiagentwithdhruv/skills/tree/2f4c62c203b1279e82979f2d78776ce846e5a30c/scrape-leads ,先閱讀它的 SKILL.md 和指令碼,確認安全後再安裝到我的技能目錄。

簡介

原文描述 · MITScrape and verify business leads using Apify, classify with LLM, enrich emails, and save to Google Sheets. Use when user asks to find leads, scrape businesses, generate prospect lists, or build lead databases for any industry or location.
以下 SKILL.md 內容轉載自 aiagentwithdhruv/skills(提交 2f4c62c),依據 MIT 許可證轉載正文(文字未改動;僅省略檔案頭後設資料、將圖片顯示為連結,超長內容會截斷);版權歸 2026 Dhruv Tomar (AIwithDhruv) 所有。許可證:LICENSE。僅展示說明檔案,附帶指令碼請在原倉庫檢視。

Lead Scraping & Verification

Goal

Scrape leads using Apify (code_crafter/leads-finder), verify their relevance (industry match > 80%), and save them to a Google Sheet. For large scrapes (1000+ leads), use parallel scraping for 3-5x faster performance.

Inputs

  • Industry: The target industry (e.g., "Plumbers", "Software Agencies")
  • Location: The target location (e.g., "Texas", "United States", "California"). Scripts auto-format to Apify's required format (US states get ", us" suffix automatically).
  • Total Count: The total number of leads desired

Scripts

All scripts are in ./scripts/:

  • scrape_apify.py - Single scrape, for <1000 leads
  • scrape_apify_parallel.py - Parallel scraping, for 1000+ leads
  • classify_leads_llm.py - LLM-based lead classification
  • enrich_emails.py - Email enrichment via AnyMailFinder
  • update_sheet.py - Batch sheet updates
  • read_sheet.py - Read data from Google Sheets

Process

Small Scrapes (<1000 leads)

  1. Test Scrape

    python3 ./scripts/scrape_apify.py --query "INDUSTRY" --location "LOCATION" --max_items 25 --no-email-filter --output .tmp/test_leads.json
    
  2. Verification

    • Read .tmp/test_leads.json
    • Check if at least 20/25 (80%) leads match the Industry
    • Pass: Proceed to step 3
    • Fail: Stop and ask user to refine keywords
  3. Full Scrape

    python3 ./scripts/scrape_apify.py --query "INDUSTRY" --location "LOCATION" --max_items TOTAL_COUNT --no-email-filter --output .tmp/leads.json
    
  4. [Optional] LLM Classification (for complex niches)

    python3 ./scripts/classify_leads_llm.py .tmp/leads.json --classification_type product_saas --output .tmp/classified_leads.json
    
  5. Upload to Google Sheet

    python3 ./scripts/update_sheet.py .tmp/leads.json --title "Leads - INDUSTRY"
    
  6. Enrich Missing Emails

    python3 ./scripts/enrich_emails.py SHEET_URL
    

Large Scrapes (1000+ leads)

  1. Test Scrape (same as above with 25 items)

  2. Parallel Full Scrape

    python3 ./scripts/scrape_apify_parallel.py \
      --query "INDUSTRY" \
      --total_count 4000 \
      --location "United States" \
      --strategy regions \
      --no-email-filter
    

    Geographic partitioning is automatic:

    • United States: 4-way (Northeast, Southeast, Midwest, West)
    • EU/Europe: 4-way (Western, Southern, Northern, Eastern)
    • UK: 4-way (SE England, N England, Scotland/Wales, SW England)
    • Canada: 4-way (Ontario, Quebec, West, Atlantic)
    • Australia: 4-way (NSW, VIC/TAS, QLD, WA/SA)
  3. Continue with steps 4-6 from small scrapes

Outputs

The ONLY deliverable is the Google Sheet URL. Local JSON files in .tmp/ are temporary intermediates.

Edge Cases

  • No leads found: Ask user to broaden search
  • API Error: Check credentials in .env
  • Low quality classifications: If >80% "unclear", improve scrape keywords

Environment

Requires in .env:

APIFY_API_TOKEN=your_token
GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
ANTHROPIC_API_KEY=your_key
ANYMAILFINDER_API_KEY=your_key

Schema

Inputs

Name Type Required Description
industry string Yes Target industry (e.g., 'Plumbers', 'Software Agencies')
location string Yes Target location (e.g., 'Texas', 'United States')
total_count integer Yes Total number of leads desired
classification_type string No LLM classification type (e.g., 'product_saas')

Outputs

Name Type Description
sheet_url string Google Sheet URL with scraped leads
lead_count integer Number of leads found

Credentials

Name Source
APIFY_API_TOKEN .env
GOOGLE_APPLICATION_CREDENTIALS .env
ANTHROPIC_API_KEY .env
ANYMAILFINDER_API_KEY .env

Composable With

Skills that chain well with this one: classify-leads, casualize-names, instantly-campaigns, onboarding-kickoff

Cost

$0.01-0.02 per lead + $0.30/1K for classification

檢視許可證全文(MIT)
MIT License

Copyright (c) 2026 Dhruv Tomar (AIwithDhruv)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.