Automating a Local Sales Pipeline with Google Places and PageSpeed

Why automate a local sales pipeline
As a web developer doing outreach to local businesses, I found myself repeating the same manual steps over and over: search a vertical, scan the map pack, visit each site, run a couple of audits, and then decide whether a cold call is worth it. That process works, but it wastes time on repetitive clicks and inspections.
I decided to build a small automation that does the heavy lifting: it finds nearby businesses using the Google Places API, fetches details like phone numbers and websites, runs a PageSpeed audit for chosen metrics, and outputs everything into a CSV that I can open in Google Sheets and sort through.
This post walks through the strategy, the key implementation details, and what I learned from running the script.
The big picture
Goals:
- Discover businesses in a target vertical and area.
- Collect names, addresses, phone numbers, and websites.
- Run a performance and SEO audit via PageSpeed.
- Export results to CSV for quick prioritization and outreach.
Core building blocks:
- Google Places API for discovering and retrieving business details. See the Places documentation for setup and endpoints: Google Places API.
- PageSpeed Insights API for automated audits and performance metrics: PageSpeed Insights API.
- Google Cloud console to enable APIs and manage credentials. For permissions and API enablement see the IAM and API docs: Google Cloud IAM and APIs.
How the script works, step by step
-
Configure Google Cloud and obtain an API key
- Create or use an existing Google Cloud project.
- Enable the Places API and the PageSpeed Insights API from the console.
- Create an API key and restrict it so it only works for the services you need.
-
Query the Places API for the map pack
- Use a search query like plumbers near me or a specific city/area.
- The Places API returns paginated results. Requests typically return up to 20 results per page and a next_page_token to fetch additional pages. The script loops until it has collected the set number of businesses.
-
Fetch place details
- For every place returned, call the Place Details endpoint to collect the business name, formatted address, phone number, website, and other fields useful for outreach.
-
Run PageSpeed audits
- For each website, run the PageSpeed Insights API. You can specify a strategy of mobile or desktop depending on what you care about most.
- Collect the metrics that matter to you. I focused on the performance score and the SEO and best-practices categories so I could identify obvious opportunities.
-
Export to CSV
- Combine the place details and the PageSpeed scores and write them into a CSV with columns like name, phone, website, performance_score, seo_score, notes.
- Open the CSV in Google Sheets for sorting and filtering when preparing outreach.
Implementation notes and tips
- Pagination: the Places API uses a next_page_token which may require a short wait before it becomes active. Be sure to handle that delay in your code.
- Rate limits and quotas: both APIs have quotas. Keep an eye on your usage in the Google Cloud console and consider batching requests to avoid throttling.
- Strategy selection: mobile strategy often shows lower scores and highlights mobile UX issues, which are high-value selling points for many small businesses.
- CSV handling: export as UTF-8 and include the full URL for quick click-through during outreach.
Example results and how I used them
After running the script over a target area for a specific vertical, I ended up with a sheet of 56 businesses including phone numbers, websites, and PageSpeed metrics. Some sites had performance scores in the 30s and 40s. Those low scores became my highest-priority leads because they indicate clear and demonstrable opportunities to improve load times and search visibility.
When I call, I can point to specific metrics from the audit and offer a prioritized plan to fix the most impactful issues. That grounded, measurable approach gets results far more often than a generic pitch.
Where to get the script
I made the script public on GitHub. If you want the script as a starting point, feel free to grab it and adapt it to your workflow. If you prefer, drop a comment or reach out and I can help customize it for your vertical.
Here is the code on my GitHub.
Final thoughts
Automating the discovery and basic auditing of local businesses saves hours of manual work and scales outreach while keeping the personal touch intact. By combining the Places API and PageSpeed Insights API you get both contextual business data and technical signals that map directly to opportunities you can sell.
If you want help setting this up, or would like the exact script I used, let me know and I can share the repository or walk you through the configuration.