0% found this document useful (0 votes)
7 views12 pages

Claude Code Lead Scraper Setup Guide

Uploaded by

moh20231121
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views12 pages

Claude Code Lead Scraper Setup Guide

Uploaded by

moh20231121
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

The Claude Code Lead Scraper Setup

Guide
How to Scrape Business Leads With Emails Using Claude Code and Apify

What You'll Build


By the end of this guide, you'll have a working lead scraper that:
Scrapes every business from Google Maps in any city and category
Visits each business website and pulls their email address
Exports a clean CSV with names, emails, phone numbers, websites, and addresses
Costs less than $1 per run (often under $0.50)
Runs in about 2 minutes

No coding experience required. You'll use Claude Code (an AI tool that runs inside VS Code) and Apify
(a web scraping platform with thousands of ready-made scrapers). You tell Claude Code what to
scrape in plain English, and it does the rest.

Section 1: Set Up Claude Code


Claude Code is an AI tool that runs inside VS Code (a free code editor). It can read files, write code, run
commands, and connect to external tools like Apify. Here's how to set it up from scratch.

Install VS Code
1. Open your web browser and go to [Link]
2. Click the big blue Download button for your operating system (Mac or Windows)
3. Once downloaded, open the installer and follow the prompts
4. When it's done, open VS Code. You'll see a dark editor with a welcome tab.

Install the Claude Code Extension


1. Look at the left sidebar in VS Code. You'll see a column of icons.
2. Click the Extensions icon. It looks like four small squares with one pulled away.
3. In the search box at the top, type Claude Code
4. You'll see "Claude Code" by Anthropic. Click the blue Install button.
5. Wait about 10 seconds. A new Claude Code icon will appear in the left sidebar.

Sign In
1. Click the Claude Code icon in the left sidebar
2. Click Sign In
3. Your browser will open to Anthropic's sign-in page
4. Create an account if you don't have one, or sign in with your existing account
5. Click Allow when it asks to connect to VS Code
6. Switch back to VS Code. You should see a chat panel where you can type messages to
Claude.

Verify It Works
1. In the Claude Code chat panel, type: "Hello, can you hear me?"
2. Press Enter
3. Claude should respond with a greeting. If it does, you're all set.

If you see an error about a subscription, you may need to add a payment method at
[Link]. Claude Code requires an Anthropic API subscription (starts at $5/month for
the Pro plan).
Section 2: Create Your Apify Account
Apify is a web scraping platform. It has thousands of pre-built scrapers (called "actors") that other
people have already built and tested. You don't need to write any scraping code yourself. You just tell
the actor what to scrape, and it does the work.

Sign Up
1. Open your browser and go to [Link]
2. Click Sign Up in the top right corner
3. You can sign up with Google, GitHub, or email and password
4. Complete the sign-up process

Understand the Free Tier


Apify gives you $5 of free credits every month. That's enough for roughly:
1,000 to 2,000 Google Maps scrapes
500 to 1,000 website contact extractions
Plenty for testing and small batches

You don't need to enter a credit card to start. The free tier works for everything in this guide.

Get Your API Token


1. After signing in, click your profile icon in the top right corner
2. Click Settings
3. Click Integrations in the left menu
4. You'll see a section called Personal API Tokens
5. Click Create token or copy the existing one
6. Copy this token and save it somewhere safe (like a note on your computer). You'll need it in
the next step.
This token is like a password that lets Claude Code use your Apify account. Don't share it publicly.

Section 3: Connect Apify to Claude Code


This is the key step. You're going to connect Apify to Claude Code using something called an "MCP
server." MCP stands for Model Context Protocol. It's a way for Claude Code to talk directly to external
tools like Apify.

Add the Apify MCP Server


1. Open VS Code and click the Claude Code icon in the left sidebar
2. In the Claude Code chat panel, type this exact command:

claude mcp add --transport http apify [Link] --header "Authorization:


Bearer YOUR_APIFY_TOKEN"

3. Replace YOUR_APIFY_TOKEN with the token you copied in the previous step
4. Press Enter
5. Claude Code will confirm the MCP server was added

Test the Connection


1. In the Claude Code chat panel, type: "List the available Apify actors you can use"
2. Press Enter
3. Claude should respond with a list of actors it can now access through Apify
4. If it works, you're connected. Claude Code can now call any Apify scraper directly.

If you get an error, double-check that:


Your API token is correct (no extra spaces)
You included the Bearer prefix before the token
Your Apify account is active

Section 4: Understand the Google Maps Scraper


Before running your first scrape, it helps to understand what the Google Maps Scraper does.

What It Is
The Google Maps Scraper is the most popular actor on Apify, with over 297,000 users. It was built by
the Apify team (actor ID: compass/crawler-google-places ). It searches Google Maps for
businesses matching your criteria and extracts their public information.

What Data It Returns


For each business, you get:
Business name (e.g., "Smith's Plumbing")
Address (full street address)
Phone number (if listed)
Website URL (if they have one)
Google rating (e.g., 4.5 stars)
Number of reviews
Business category (e.g., "Plumber", "Restaurant")
Operating hours
Google Maps URL

What It Costs
On the free tier, scraping Google Maps costs very little. A batch of 200 businesses typically costs
between $0.10 and $0.30 in Apify credits, depending on how much data you extract per listing.
Section 5: Run Your First Lead Scrape
Now for the fun part. You're going to tell Claude Code to scrape leads from Google Maps.

Tell Claude What to Scrape


1. Open the Claude Code chat panel in VS Code
2. Type a natural language prompt like this:

Use Apify to scrape all plumbers in Saskatoon, Saskatchewan from Google Maps.
Get their business name, address, phone number, and website URL.
Save the results as a JSON file called [Link].

3. Press Enter
4. Claude Code will call the Google Maps Scraper through Apify
5. You'll see progress updates as the scraper runs
6. When it's done (usually 1-2 minutes), Claude will show you the results and save the file

Review the Results


Open [Link] in VS Code. You'll see something like:

[
{
"title": "Smith's Plumbing & Heating",
"address": "123 Main St, Saskatoon, SK S7K 1A1",
"phone": "+1-306-555-0123",
"website": "[Link]
"rating": 4.7,
"reviews": 89,
"category": "Plumber"
},
...
]
Try Different Searches
You can scrape any business type in any location. Just change your prompt:
"Scrape all dentists in Regina, Saskatchewan"
"Scrape all roofing contractors in Calgary, Alberta"
"Scrape all restaurants in downtown Vancouver"
"Scrape all auto repair shops within 25km of Toronto"

Section 6: Enrich Leads With Email Addresses


The Google Maps scrape gives you phone numbers and websites, but most businesses don't list their
email on Google Maps. To get emails, you need to visit each business website and extract the contact
information. Apify has a scraper for this too.

Run the Contact Enrichment


1. In the Claude Code chat panel, type:

Take the websites from [Link] and use Apify's Contact Details Scraper
to visit each website and extract email addresses, social media profiles,
and any additional phone numbers. Save the enriched results as [Link].

2. Press Enter
3. Claude Code will run the Contact Details Scraper on each website URL
4. This takes a bit longer (2-5 minutes depending on how many leads you have)
5. When done, you'll have enriched data with emails

What the Enrichment Adds


For each business website, the Contact Details Scraper pulls:
Email addresses (from contact pages, footer, about pages)
Social media profiles (Facebook, Instagram, LinkedIn, Twitter)
Additional phone numbers (if different from Google Maps listing)

Not every website will have an email visible. Expect to find emails for about 60-70% of businesses.
That's still a lot better than manual searching.

Cost
The Contact Details Scraper costs about $1.50 per 1,000 websites visited. For 200 leads, that's roughly
$0.30.

Section 7: Export and Clean Your Lead List


Now you have enriched leads. Time to export them into a clean, usable format.

Export as CSV
1. In Claude Code, type:

Convert [Link] to a CSV file called [Link].


Include columns: business_name, email, phone, website, address, rating, reviews.
Remove any duplicates. Sort by rating (highest first).

2. Press Enter
3. Claude will create a clean CSV file

Open in a Spreadsheet
You can open the CSV in:
Google Sheets (upload the file)
Microsoft Excel (double-click the file)
Apple Numbers (double-click on Mac)

Clean Up Tips
Remove rows where email is blank (if email is your primary contact method)
Filter by rating (4.0+ stars = established businesses, more likely to respond)
Check for duplicate phone numbers (some businesses have multiple Google listings)
Add a "Status" column to track your outreach

Section 8: Advanced: LinkedIn Profile Scraping


Google Maps is the safest and cheapest way to scrape leads. But if you need professional contacts
(specific people at companies), Apify also has LinkedIn scrapers.

No-Cookie LinkedIn Scrapers


Several Apify actors can scrape LinkedIn profiles without requiring your LinkedIn login credentials. This
means your personal LinkedIn account is not at risk.
Popular options:
Mass LinkedIn Profile Scraper with Email by dev_fusion ($10/1,000 profiles)
LinkedIn Profile Scraper by curious_coder ($3/1,000 profiles)
LinkedIn Profile Scraper - No Cookie by supreme_coder ($3/1,000 profiles)

Legal Considerations
Be aware of the following:
LinkedIn's Terms of Service prohibit scraping. Violating TOS can result in your account being
banned.
The hiQ Labs v. LinkedIn court ruling established that scraping publicly accessible data is not
illegal under the Computer Fraud and Abuse Act.
Using no-cookie scrapers eliminates the risk to your personal LinkedIn account.
GDPR applies if you're scraping contacts in Europe. Always have a legitimate business reason.
Best practice: only scrape publicly available information, and give people a way to opt out of
your outreach.

When to Use LinkedIn vs Google Maps

Use Case Best Source

Local businesses (plumbers, dentists, restaurants) Google Maps

Specific professionals (CTOs, marketing directors) LinkedIn

Businesses with websites Google Maps + Contact Enrichment

B2B sales to specific companies LinkedIn company + employee scraper

Section 9: Advanced: Automate Daily Scrapes


Once your scraper works, you can set it to run automatically on a schedule.

Apify Schedules
1. Log in to Apify at [Link]
2. Go to Schedules in the left menu
3. Click Create schedule
4. Select the actor you want to run (e.g., Google Maps Scraper)
5. Set the input (location, business type, etc.)
6. Choose a frequency (daily, weekly, monthly)
7. Apify will run the scraper automatically and store the results
Webhook Notifications
You can set up Apify to notify you when a scrape completes:
1. In your actor run settings, go to Webhooks
2. Add a webhook URL (this can be an email service, Slack webhook, or your own API endpoint)
3. Apify will send a POST request when the scrape finishes

Building a Recurring Pipeline


For a production lead gen pipeline, combine:
1. Scheduled Google Maps scrape (weekly, new businesses in your target area)
2. Contact enrichment (runs automatically after the Maps scrape via webhook)
3. CSV export (saved to Google Drive or emailed to you)
4. Deduplication (compare against your existing leads database)

You can build all of this by prompting Claude Code step by step.

Section 10: Next Steps


You now have a working lead scraper. Here's how to scale it:

Scale to Multiple Cities


Run the same scraper for every city in your target market. If you serve all of Saskatchewan, scrape
Regina, Saskatoon, Prince Albert, Moose Jaw, and Swift Current in separate batches.

Add AI Lead Scoring


Ask Claude Code to score each lead based on criteria like: website quality, number of reviews, rating,
whether they have an email, and business age. This helps you prioritize outreach.
Integrate With Your CRM
Import the CSV directly into your CRM (HubSpot, Salesforce, Pipedrive, etc.) or email outreach tool
(Instantly, Woodpecker, Lemlist).

Explore More Scrapers


Apify has 10,000+ actors. Beyond Google Maps, try:
Yelp Scraper for restaurant and service leads
Yellow Pages Scraper for directory listings
Website Contact Scraper for bulk email extraction from any URL list

About Nu Stimulus
Nu Stimulus is a growth partner for businesses doing $1M+ in revenue. We build marketing systems, AI
automation, and content engines that drive real results.
Follow @KyleWhitrow on Instagram for more Claude Code builds like this one.
Want to see the full lead scraping system in action? Comment APIFY on any of our posts and we'll
send you this guide plus a video walkthrough.

Built with Claude Code. Published by Nu Stimulus.

Send an email to kyle@[Link] for inquiries.


[Link]

You might also like