Skip to main content
The Shovels CLI makes it easy to go from a broad market search to a targeted contractor list in a few commands. In this tutorial, we’ll find the top solar contractors in a California ZIP code, inspect their permit history, and export the results to CSV. This is a common workflow for sales teams, market researchers, and AI agents building lead lists.

Step-by-Step Recipe

0

Set Up the CLI

If you haven’t already, install the CLI and configure your API key:
Verify it works:
For detailed setup instructions, see the CLI Quickstart Guide.
1

Find Your Target Market

If you know your ZIP code, you can use it directly as a --geo-id. If you need to find a city or county geo_id, search for it:
For this tutorial, we’ll use ZIP code 92024 (Encinitas, CA).
2

Search for Contractors

Search for solar contractors active in 2024:
This returns up to 20 contractors with their names, contact info, permit counts, and ratings.
Add --include-count with --limit 1 to see the total number of matching contractors before fetching the full list.
3

Inspect a Contractor's Permits

Pick a contractor ID from the results and view their permit history:
This returns individual permits with descriptions, dates, job values, and addresses.To see monthly performance metrics:
4

Export to CSV

Use jq to transform the JSON output into CSV:
This creates a CSV with headers, ready for a spreadsheet or CRM import.
5

Expand to a Broader Area (Optional)

Scale up by searching at the state level:
Use --min-permits to filter for contractors with a track record.
If your results are too broad or too narrow, here are some adjustments:
  • Too many results: Add --min-permits, --min-job-value, or narrow the --geo-id to a smaller area
  • Too few results: Expand the date range, use a broader geo_id (county or state), or remove tag filters
  • Wrong specialty: Use shovels tags list to see all available tags and pick the right one
  • Need specific contractors: Add --contractor-name or --contractor-license to filter by known details

Additional Help

If you run into issues, check the CLI error codes guide or reach out to support@shovels.ai. Happy Digging!