SerpBase
Back to Blog

Export Google Maps Results to CSV with Python: Phones, Websites, Ratings

Search Google Maps for a business type in a city and write each place to CSV. Tested: 20 Denver plumbers, all with phone, website and rating.

December 3, 2026
By SerpBase Team2 min read

Short answer: send a business type and a place to /google/maps/search, then write each item of places to a CSV row — name, phone, website, address, rating, review count, coordinates and IDs. On 2 December 2026, "plumber" in Denver returned 20 places, and all 20 had a phone number, a website and a rating.

The request

curl -X POST 'https://api.serpbase.dev/google/maps/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"plumber","location":{"location_query":"Denver, CO"}}'

What came back

One place, shortened:

{
  "status": 0,
  "credits_charged": 2,
  "places": [
    {
      "position": 1,
      "title": "Applewood Plumbing Heating & Electric",
      "rating": 4.8,
      "reviews_count": 18256,
      "category": {"display_name": "Plumber"},
      "address": "5000 W 29th Ave, Denver, CO 80212",
      "phone": "(303) 444-1633",
      "website": "https://www.applewoodfixit.com/",
      "website_domain": "applewoodfixit.com",
      "latitude": 39.7583004,
      "longitude": -105.0512657,
      "place_id": "ChIJkWUJx22Ha4cRVVLq4AJk7Ng",
      "data_id": "0x876b876dc7096591:0xd8ec6402e0ea5255",
      "hours": {"Monday": "6 AM–10 PM", "Sunday": "6 AM–10 PM"},
      "types": ["Plumber", "Electrician", "HVAC contractor"]
    }
  ]
}

Places also carry phone_international, cid, open_status, reviews_url and photos. Review counts ranged from 10 to 18,256 across the 20 plumbers.

Python: Google Maps to CSV

import csv, requests

FIELDS = ["position", "title", "category", "phone", "website", "address",
          "rating", "reviews_count", "latitude", "longitude", "place_id", "data_id"]

def maps_rows(query, place):
    r = requests.post(
        "https://api.serpbase.dev/google/maps/search",
        headers={"X-API-Key": "YOUR_API_KEY"},
        json={"q": query, "location": {"location_query": place}},
        timeout=60,
    ).json()
    if r["status"] != 0:
        raise SystemExit(r.get("error"))
    for p in r.get("places", []):
        row = {k: p.get(k) for k in FIELDS}
        row["category"] = (p.get("category") or {}).get("display_name")
        yield row

seen = set()
with open("plumbers.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.DictWriter(f, fieldnames=FIELDS)
    w.writeheader()
    for place in ["Denver, CO", "Aurora, CO", "Lakewood, CO"]:
        for row in maps_rows("plumber", place):
            if row["place_id"] in seen:
                continue
            seen.add(row["place_id"])
            w.writerow(row)
print(len(seen), "places written")

Open plumbers.csv in Excel or Google Sheets; encoding="utf-8" keeps names with accents intact.

Things that trip people up

  • One request, up to 20 places. To cover a metro area, run nearby towns or neighbourhoods as separate places, or search around coordinates (see Maps search by coordinates), and remove repeats by place_id.
  • category and hours are objects. Flatten them before writing CSV, as the script does for category.
  • Keep place_id and data_id. They let you fetch the full place later (Place Details API) or its reviews (Reviews API).
  • Contact data is what Google shows. Some businesses have no website or phone on Maps; leave those cells empty rather than guessing.

Related

Cost and docs

Each Maps search is 2 credits. Failed requests are not charged, and new accounts get 500 free credits.