🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

B2B Lead Automation

by @nicemaths123

Automate extraction and structuring of publicly available B2B business contacts from directories and listings for CRM-ready lead generation.

Versionv1.0.0
πŸ’‘ Examples

Extract Company Contacts from LinkedIn

import ApifyClient from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor("apify/linkedin-companies-scraper").call({ startUrls: [ { url: "https://www.linkedin.com/company/salesforce/" }, { url: "https://www.linkedin.com/company/hubspot/" } ], maxResults: 50 });

const { items } = await run.dataset().getData();

// Each item contains: // { name, website, industry, employeeCount, // headquarters, description, linkedinUrl }


Scrape Yellow Pages for Local Business Leads

const run = await client.actor("apify/yellowpages-scraper").call({
  searchTerms: ["digital marketing agency"],
  locations: ["New York, NY", "Los Angeles, CA", "Chicago, IL"],
  maxResultsPerPage: 30
});

const { items } = await run.dataset().getData();

// Each item contains: // { businessName, phone, address, city, state, // zip, website, category, email }


Extract Leads from Google Maps (Local Businesses)

const run = await client.actor("apify/google-maps-scraper").call({
  searchStringsArray: ["accountants in Austin TX", "law firms in Miami FL"],
  maxCrawledPlacesPerSearch: 50,
  language: "en"
});

const { items } = await run.dataset().getData();

// Each item contains: // { title, address, phone, website, rating, // reviewsCount, category, email, plusCode }


Multi-Source Lead Aggregation Pipeline

const [ypRun, gmRun] = await Promise.all([
  client.actor("apify/yellowpages-scraper").call({
    searchTerms: ["IT consulting"],
    locations: ["San Francisco, CA"],
    maxResultsPerPage: 25
  }),
  client.actor("apify/google-maps-scraper").call({
    searchStringsArray: ["IT consulting San Francisco CA"],
    maxCrawledPlacesPerSearch: 25
  })
]);

const [ypData, gmData] = await Promise.all([ ypRun.dataset().getData(), gmRun.dataset().getData() ]);

// Normalize and deduplicate by website domain const allLeads = [...ypData.items, ...gmData.items]; const uniqueLeads = allLeads.filter( (lead, index, self) => index === self.findIndex(l => l.website === lead.website) );

console.log(${uniqueLeads.length} unique leads collected);


πŸ“‹ Tips & Best Practices

  • Target businesses, not individuals β€” focus on company emails and main phone numbers
  • Set maxResultsPerPage to 25–100 to control costs and avoid rate limiting
  • Always deduplicate by domain or phone before importing to your CRM
  • Schedule recurring runs on Apify to keep your lead list fresh
  • Validate emails before sending using a service like Hunter.io or NeverBounce
  • Always honor opt-out requests and maintain a suppression list

  • View on ClawHub
    TERMINAL
    clawhub install b2b-lead-automation

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’