Communitygithub.com

aiagentwithdhruv/skills

Apifyを使ってビジネスリードをスクレイピング・検証し、LLMで分類、メールをエンリッチしてGoogleスプレッドシートに保存します。ユーザーがリード検索、ビジネススクレイピング、見込み客リスト作成、リードデータベース構築を依頼した際に使用します。

skills とは?

このスキルは、AIエージェントがApifyのリードファインダーアクターを使ってターゲット業界・地域のビジネスリードをスクレイピングし、LLMによる分類(業界一致度80%以上)とメールアドレスのエンリッチメントを行い、最終的にGoogleスプレッドシートに保存するための包括的なワークフローを提供します。小規模スクレイピング(1000件未満)と大規模スクレイピング(1000件以上)の2つのモードがあり、大規模スクレイピングでは地理的パーティショニングによる並列実行で3〜5倍の高速化を実現します。スクリプトは./scripts/ディレクトリにまとめられており、テストスクレイピング→品質検証→本番スクレイピング→LLM分類(オプション)→スプレッドシートアップロード→メールエンリッチメントの順で実行します。Claude Codeや同様のコード実行型AIエージェントで動作し、.envファイルにAPIトークンを設定するだけで利用できます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiagentwithdhruv/skills/tree/HEAD/scrape-leads

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

リードスクレイピング&検証

目標

Apify(code_crafter/leads-finder)を使ってリードをスクレイピングし、関連性(業界一致度 > 80%)を検証して、Googleスプレッドシートに保存します。大規模スクレイピング(1000件以上のリード)の場合は、並列スクレイピングを使用して3〜5倍の高速化を実現します。

入力

  • 業種: 対象業種(例:「配管業者」、「ソフトウェアエージェンシー」)
  • 地域: 対象地域(例:「テキサス州」、「アメリカ合衆国」、「カリフォルニア州」)。スクリプトは自動的にApifyの要求形式にフォーマットします(米国の州は自動的に「, us」サフィックスが付きます)。
  • 総件数: 必要なリードの総数

スクリプト

すべてのスクリプトは./scripts/にあります:

  • scrape_apify.py - 単一スクレイピング(1000件未満用)
  • scrape_apify_parallel.py - 並列スクレイピング(1000件以上用)
  • classify_leads_llm.py - LLMベースのリード分類
  • enrich_emails.py - AnyMailFinderによるメールエンリッチメント
  • update_sheet.py - シートへの一括更新
  • read_sheet.py - Googleスプレッドシートからのデータ読み込み

プロセス

小規模スクレイピング(1000件未満)

  1. テストスクレイピング

    python3 ./scripts/scrape_apify.py --query "業種" --location "地域" --max_items 25 --no-email-filter --output .tmp/test_leads.json
    
  2. 検証

    • .tmp/test_leads.jsonを読み込む
    • 25件中少なくとも20件(80%)が業種に一致するか確認
    • 合格: ステップ3へ進む
    • 不合格: 停止し、ユーザーにキーワードの改善を依頼
  3. 本番スクレイピング

    python3 ./scripts/scrape_apify.py --query "業種" --location "地域" --max_items 総件数 --no-email-filter --output .tmp/leads.json
    
  4. [オプション]LLM分類(複雑なニッチ向け)

    python3 ./scripts/classify_leads_llm.py .tmp/leads.json --classification_type product_saas --output .tmp/classified_leads.json
    
  5. Googleスプレッドシートへのアップロード

    python3 ./scripts/update_sheet.py .tmp/leads.json --title "リード - 業種"
    
  6. 不足メールのエンリッチ

    python3 ./scripts/enrich_emails.py スプレッドシートURL
    

大規模スクレイピング(1000件以上)

  1. テストスクレイピング(上記と同じ、25件)

  2. 並列本番スクレイピング

    python3 ./scripts/scrape_apify_parallel.py \
      --query "業種" \
      --total_count 4000 \
      --location "アメリカ合衆国" \
      --strategy regions \
      --no-email-filter
    

    地理的パーティショニングは自動で行われます:

    • アメリカ合衆国: 4分割(北東、南東、中西部、西部)
    • EU/ヨーロッパ: 4分割(西部、南部、北部、東部)
    • イギリス: 4分割(南東イングランド、北イングランド、スコットランド/ウェールズ、南西イングランド)
    • カナダ: 4分割(オンタリオ、ケベック、西部、大西洋)
    • オーストラリア: 4分割(NSW、VIC/TAS、QLD、WA/SA)
  3. 小規模スクレイピングのステップ4〜6を続行

出力

唯一の成果物はGoogleスプレッドシートのURLです。 .tmp/内のローカルJSONファイルは一時的な中間ファイルです。

エッジケース

  • リードが見つからない場合: ユーザーに検索範囲を広げるよう依頼
  • APIエラー: .envの認証情報を確認
  • 低品質な分類: 「不明」が80%を超える場合、スクレイピングキーワードを改善

環境

.envに以下が必要です:

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

スキーマ

入力

名前型必須説明
industrystringはい対象業種(例:「配管業者」、「ソフトウェアエージェンシー」)
locationstringはい対象地域(例:「テキサス州」、「アメリカ合衆国」)
total_countintegerはい必要なリードの総数
classification_typestringいいえLLM分類タイプ(例:「product_saas」)

出力

名前型説明
sheet_urlstringスクレイピングしたリードを含むGoogleスプレッドシートのURL
lead_countinteger見つかったリード数

認証情報

名前取得元
APIFY_API_TOKEN.env
GOOGLE_APPLICATION_CREDENTIALS.env
ANTHROPIC_API_KEY.env
ANYMAILFINDER_API_KEY.env

連携可能なスキル

このスキルと連携してチェーンできるスキル:classify-leads、casualize-names、instantly-campaigns、onboarding-kickoff

コスト

リード1件あたり$0.01〜0.02 + 分類1,000件あたり$0.30

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

aiagentwithdhruv/skills

Add new Modal webhooks for event-driven execution. Use when user asks to create a webhook, add an endpoint, or set up event triggers.

aiagentwithdhruv/skills

Answer Euron Gen AI Bootcamp doubts instantly. Covers Euri API setup across all frameworks (Python, LangChain, OpenAI SDK, TypeScript, n8n, curl), MCP server setup, common errors, model recommendations, and token limits. Use when someone in the bootcamp asks a question.

aiagentwithdhruv/skills

Manage emails across multiple Gmail accounts with unified tooling. Use when user asks to check email, read inbox, label emails, archive messages, or manage Gmail across accounts.

aiagentwithdhruv/skills

Auto-label Gmail emails into Action Required, Waiting On, and Reference categories. Use when user asks to label emails, triage inbox, categorize emails, or organize Gmail.

aiagentwithdhruv/skills

Scrape Google Maps for B2B leads with deep website enrichment and contact extraction. Use when user asks to find local businesses, scrape Google Maps, generate contractor lists, or build local service business databases.

aiagentwithdhruv/skills

Run Claude orchestrator locally with Cloudflare tunneling. Use when user asks to run locally, start local server, or test webhooks locally.

aiagentwithdhruv/skills

MCP server for AI-powered macOS control — apps, display, audio, files, screenshots, clipboard

aiagentwithdhruv/skills

Deploy execution scripts to Modal cloud. Use when user asks to deploy to Modal, push code to cloud, or update Modal functions.

aiagentwithdhruv/skills

Query Skool community content using RAG pipeline with vector search. Use when user asks to search Skool knowledge, find community answers, or query Skool content.

aiagentwithdhruv/skills

Scrape Upwork jobs and generate personalized proposals with cover letters. Use when user asks to find Upwork jobs, create Upwork proposals, or apply to Upwork listings.

関連スキル