How Much Does a Plumber Cost? Build a Home Services Price Estimator
"How much should I pay for X?" is one of the most searched questions for home services. If you're building a home improvement app, real estate tool, or local services directory, adding real pricing data makes your product instantly more useful.
Here's how to build a home services cost estimator using the Thumbtack Pro Directory API.
The Idea
Instead of showing "Contact for pricing" (which nobody likes), show actual market rates: "Plumbers in Austin, TX typically charge $85-$150/hour."
One API call gets you this data.
Step 1: Query the API
import requests
RAPIDAPI_KEY = "your-key-here"
HOST = "thumbtack-pro-directory.p.rapidapi.com"
def get_service_cost(service, location="Austin, TX", limit=10):
url = f"https://{HOST}/thumbtack/search"
params = {"query": service, "location": location, "limit": limit}
headers = {
"x-rapidapi-key": RAPIDAPI_KEY,
"x-rapidapi-host": HOST
}
r = requests.get(url, headers=headers, params=params)
return r.json()
results = get_service_cost("plumber")
for pro in results.get("results", []):
name = pro.get("name", "")
rating = pro.get("rating", "N/A")
price = pro.get("price_estimate", "Contact for quote")
print(f"{name}: {rating} stars | {price}")
Step 2: Build a Cost Comparison Widget
def cost_summary(service, cities):
summary = {}
for city in cities:
data = get_service_cost(service, city)
pros = data.get("results", [])
prices = []
for p in pros:
est = p.get("price_estimate", "")
# Parse price ranges like "$85-$150"
import re
nums = re.findall(r'\$?([\d,]+)', str(est))
prices.extend([float(n.replace(",", "")) for n in nums])
if prices:
summary[city] = {
"min": min(prices),
"max": max(prices),
"avg": round(sum(prices) / len(prices), 2),
"pros_found": len(pros)
}
return summary
cities = ["Austin, TX", "New York, NY", "Denver, CO", "Miami, FL"]
costs = cost_summary("plumber", cities)
for city, data in costs.items():
print(f"{city}: ${data['min']}-${data['max']} (avg ${data['avg']}, {data['pros_found']} pros)")
Output:
Austin, TX: $75-$185 (avg $118.50, 10 pros)
New York, NY: $95-$275 (avg $162.00, 10 pros)
Denver, CO: $80-$165 (avg $112.75, 10 pros)
Miami, FL: $85-$195 (avg $128.00, 10 pros)
Step 3: Embed in Your App
Turn this into an API endpoint for your own app:
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route("/cost-estimate")
def cost_estimate():
service = request.args.get("service", "plumber")
city = request.args.get("city", "Austin, TX")
data = get_service_cost(service, city)
# ... process and return
return jsonify(data)
Now your real estate app can show "Average plumber cost in this neighborhood: $118/hr" next to every listing.
Use Cases
- Real estate apps: Show service costs by neighborhood
- Moving calculators: "Movers in Portland cost $X/hr"
- Home improvement guides: Embed real pricing in your content
- Lead generation: "Find top-rated electricians near you" with actual price data
The free tier gives you 200 requests/month — enough to power a modest app or prototype. Try the Thumbtack Pro Directory API.
Top comments (0)