Menu

Build a local B2B lead list in 20 lines of Python (Google Maps + website contacts)
πŸ“°

Build a local B2B lead list in 20 lines of Python (Google Maps + website contacts)

DEV Community: apiΒ·TORIXΒ·about 2 hours ago
#vAMZwOfU
#devtoapi#devto#dev#client#google
Reading 0:00
15s threshold

Sales teams pay a lot for lists like "all dentists in Austin with a phone, website and email". You can build one yourself in a few minutes with two hosted scrapers and the Apify Python client. You pay only for the rows you get back (about $3 per 1,000), and nothing for empty sites.

The pipeline

Google Maps Scraper returns businesses for a search term and a location: name, phone, website, rating, review count.

Website Contact Details Extractor visits each website and returns emails (including Cloudflare-obfuscated ones), extra phones, LinkedIn, Instagram, X and the company name.

Both run over plain HTTP, without a headless browser, so a few hundred businesses take seconds.

Code

pip install apify-client export APIFY_TOKEN = ... # free account: console.apify.com β†’ Settings β†’ API & Integrations

Enter fullscreen mode

Exit fullscreen mode

import csv , os from apify_client import ApifyClient

client = ApifyClient ( os . environ [ " APIFY_TOKEN " ])

# 1) Businesses from Google Maps run = client .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.