# Google Local API | Local Pack & Business Search SERPs (`johnvc/google-local-api`) Actor

Search Google Local results - the local pack inside Google Search SERPs. Extract businesses with rating, reviews, phone, hours, place\_id, GPS coordinates. Country, language, and device targeting. Pay per page. MCP-ready for AI agents.

- **URL**: https://apify.com/johnvc/google-local-api.md
- **Developed by:** [John](https://apify.com/johnvc) (community)
- **Categories:** Lead generation, SEO tools, Automation
- **Stats:** 16 total users, 10 monthly users, 100.0% runs succeeded, 8 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Google Local API | Local Pack & Business Search SERPs (MCP-ready)

> **Search Google Local results - the local pack inside Google Search SERPs - and get clean JSON back. Local businesses with rating, reviews, phone, hours, place_id, GPS coordinates, ads, and related place suggestions. Pay per page. MCP-ready for Claude, ChatGPT, Cursor, and other AI agents.**

Pass a search query (and optionally a city) and the Actor returns the same structured data Google shows in the local pack on its Search results page: titles, ratings, review counts, addresses, phone numbers, opening hours, business categories, price tiers, place IDs, GPS coordinates, action links (directions, website, order, phone, reservations), and the related-place suggestions Google surfaces under the main results. Country, language, Google domain, and device controls are all exposed.

This is the only Apify Actor focused on the **Google Local Search SERP** (the local pack inside a normal Google Search), as opposed to scraping Google Maps directly. The result is 100% reliability (no browsers, no captchas), the exact data layout Google ships to users on the web, and per-page pricing that is predictable regardless of how many businesses appear.

---

### Use with Claude, ChatGPT, Cursor & other AI agents (MCP)

This Actor is a first-class tool on the [Apify MCP Server](https://docs.apify.com/platform/integrations/mcp). Any MCP-compatible AI agent - Claude (Desktop, Web, Code), ChatGPT (via custom GPT or MCP bridge), Cursor, VS Code, Cline, Windsurf, Kilo Code, Opencode, Glama - can discover and call this Actor in natural language.

**What an AI agent does with this:**

> User: *"Find me the highest-rated dentists in Brooklyn that take walk-ins."*
>
> Agent calls `search-actors("google local")` on the Apify MCP server, picks this Actor, calls it with `{"q": "dentists walk-ins", "location": "Brooklyn, New York, United States", "max_pages": 2}`, gets the local pack businesses back, ranks them by rating and review count, and returns a short list to the user with phone numbers.

#### Quick setup - Claude Desktop

Add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server"],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_API_TOKEN"
      }
    }
  }
}
````

Restart Claude Desktop. Then ask Claude something like *"Find vegan restaurants in Austin with at least 4.5 stars and 200+ reviews."* Claude will discover this Actor, ask permission to call it, and return structured results.

#### Quick setup - Cursor / VS Code / Cline / Windsurf

These editors support **dynamic tool discovery**, so after the first call this Actor is registered as a named tool for the rest of the session, and subsequent prompts skip the discovery step entirely.

Point your MCP client at:

```
https://mcp.apify.com
```

…with header `Authorization: Bearer YOUR_APIFY_API_TOKEN`. Full setup: [Apify MCP integration docs](https://docs.apify.com/platform/integrations/mcp).

#### Quick setup - ChatGPT (and other static MCP clients)

ChatGPT, Gemini CLI, and Amazon Q connect through the same `https://mcp.apify.com` endpoint and call this Actor via the generic `call-actor` tool. Same result, just no session-level tool registration.

#### Use cases for AI agents

- **Local lead-gen agents** - "Pull every plumber in {city} with under 50 reviews so I can pitch SEO services."
- **Local SEO copilots** - "Where does {brand} rank in the local pack for 'best coffee' across these 25 cities?"
- **Reservation / booking assistants** - "Find me three Italian places near Union Square with a 4.5+ rating and a phone link."
- **Competitor monitoring agents** - "Watch the top-3 local pack results for 'pediatric dentist Brooklyn' weekly."
- **Market research agents** - "How many CrossFit gyms are in each of these 100 zips, and what is the median rating?"

***

### What this Actor does

A Google Local search wrapper that takes a query and returns the local pack businesses Google would show on the Search results page, plus the local ads and the related-place suggestions Google adds beneath them. Localize by country, language, Google domain, and device. Set `max_pages` to walk through more results. Each page is one billable event.

Whether you are powering an AI agent through MCP, building a local-business directory, running local SEO rank tracking, or generating outreach lists, this Actor produces the structured local pack data you need.

**SEO benefit**: Local pack data lets agencies and in-house teams measure visibility for geo-targeted keywords, benchmark competitors, and prioritize Google Business Profile optimization.

***

### What data you get

| Field | Description |
|---|---|
| **Business details** | Title, type/category, description, price tier ($, $$, $$$, $$$$) |
| **Ratings & reviews** | Average star rating, total review count, raw review text label |
| **Contact** | Address, phone number, opening hours, "Open 24 hours" labels |
| **Identifiers** | `place_id` (Google CID), `provider_id`, `lsig` signature, place-search URL |
| **Geo** | `gps_coordinates` (latitude + longitude) for every listing |
| **Action links** | Directions, website, order, schedule, phone (when available) |
| **Media** | Thumbnail image, large thumbnail |
| **Service options** | Dine-in, takeout, delivery, in-store shopping, curbside pickup, no-contact delivery, etc. |
| **Ads** | Paid local placements (Google Local Ads) with the same business fields plus an ad title |
| **Related places** | "Discover more places" suggestions Google appends under the main results |
| **Pagination** | `pagination.current` (page index). Use the `max_pages` input to fetch more pages. |
| **Metadata** | Pages processed, total results estimate, pagination status |

***

### Key features

**Comprehensive coverage** - Every public local pack field Google returns: rating, reviews, phone, hours, GPS, place\_id, service options, ad placements, related places.

**Country, language, and Google domain controls** - `gl` (200+ country codes), `hl` (200+ languages), `google_domain` (regional google.\* domains). Localize the search exactly the way a real user in that market would see it.

**Device emulation** - `device` switches between desktop (about 20 results per page) and mobile (about 10 results per page) layouts.

**Smart pagination** - Set `max_pages` to fetch as many pages as you need, or `0` for unlimited (bounded by a 20-page safety cap). The Actor walks pages automatically; you do not need to manage offsets.

**Transparent pay-per-page pricing** - $0.02 setup + $0.02 per page. No subscriptions, no result-count surprises, no per-business markup.

**Production-grade reliability** - API-backed instead of browser-based, so no captchas, no proxies, no rate-limit gymnastics. Schema-validated output. Structured error records for invalid input.

**Pre-flight budget check** - Before any work is done, the Actor compares the projected cost against your remaining spending limit and exits cleanly with an `InsufficientFunds` error record if there is not enough headroom.

**MCP-ready** - First-class tool on the [Apify MCP Server](https://docs.apify.com/platform/integrations/mcp) for Claude, ChatGPT, Cursor, and any other MCP-compatible agent.

***

### Usage examples

#### Example 1: Basic search

```json
{
  "q": "coffee",
  "location": "Austin, Texas, United States",
  "max_pages": 1
}
```

#### Example 2: Local SEO rank tracking

```json
{
  "q": "best pizza",
  "location": "Brooklyn, New York, United States",
  "gl": "us",
  "hl": "en",
  "max_pages": 3
}
```

#### Example 3: International market

```json
{
  "q": "boulangerie",
  "location": "Paris, France",
  "google_domain": "google.fr",
  "gl": "fr",
  "hl": "fr",
  "max_pages": 2
}
```

#### Example 4: Mobile layout

```json
{
  "q": "gym near me",
  "location": "San Francisco, California, United States",
  "device": "mobile",
  "max_pages": 2
}
```

#### Example 5: Specific place by Google CID

```json
{
  "q": "the standard hotel",
  "ludocid": "14414772292044717666",
  "max_pages": 1
}
```

***

### Example output

Each dataset item is one page of Google Local results. Excerpt:

```json
{
  "page_number": 1,
  "search_timestamp": "2026-05-12T10:30:00.123456",
  "search_parameters": {
    "q": "coffee",
    "location": "Austin, Texas, United States",
    "gl": "us",
    "hl": "en",
    "device": "desktop",
    "max_pages": 1
  },
  "search_metadata": {
    "pages_processed": 1,
    "max_pages_set": 1,
    "pagination_limit_reached": false,
    "total_results_estimate": null
  },
  "local_results": [
    {
      "position": 1,
      "title": "Houndstooth Coffee",
      "rating": 4.6,
      "reviews_original": "(1.2K)",
      "reviews": 1200,
      "price": "$$",
      "type": "Coffee shop",
      "address": "401 Congress Ave Suite 100C, Austin, TX",
      "hours": "Open until 7 PM",
      "place_id": "1234567890123456789",
      "gps_coordinates": {"latitude": 30.2672, "longitude": -97.7431},
      "service_options": {"dine_in": true, "takeout": true, "delivery": false},
      "links": {
        "directions": "https://www.google.com/maps/dir/?...",
        "website": "https://houndstoothcoffee.com",
        "order": "https://order.example.com/houndstooth"
      },
      "thumbnail": "https://lh3.googleusercontent.com/...",
      "thumbnail_large": "https://lh3.googleusercontent.com/...",
      "place_id_search": "https://www.google.com/maps?cid=1234567890123456789"
    }
  ],
  "ads_results": [],
  "local_map": {"image": "https://..."},
  "discover_more_places": [
    {"title": "Best coffee", "places": "Mozart's, Cafe Medici, Houndstooth..."}
  ],
  "pagination": {"current": 1}
}
```

***

### Input parameters

| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| `q` | string | yes | `coffee` | Search query |
| `location` | string | no | `Austin, Texas, United States` | City-level location; cannot combine with `uule` |
| `uule` | string | no | - | Google-encoded location for precise targeting |
| `google_domain` | string | no | `google.com` | Regional Google domain |
| `gl` | string | no | `us` | 2-letter country code |
| `hl` | string | no | `en` | 2-letter language code |
| `ludocid` | string | no | - | Google CID for a specific place |
| `tbs` | string | no | - | Advanced filter string |
| `device` | enum | no | `desktop` | `desktop`, `tablet`, or `mobile` |
| `max_pages` | integer | no | `1` | 0 = unlimited (safety cap 20) |

***

### Pricing

This Actor uses Apify's **pay-per-event** model:

| Event | Cost | When charged |
|---|---|---|
| `setup` | $0.02 | Once per run |
| `page_processed` | $0.02 | Per page of results |

**Worked example**: a 10-page run costs `$0.02 (setup) + 10 x $0.02 (pages) = $0.22`. A single-page run costs `$0.04`. Failed validation (missing `q`, conflicting `location` + `uule`) writes a structured error record to the dataset and exits **without charging** anything beyond setup.

You always know your maximum cost up front: `setup + (max_pages x page_processed)`.

***

### How to get started

1. Click **Try for free** at the top of this Actor's Apify Store page.
2. Set a `q` (search query) and, if you want geo-targeted results, a `location`.
3. Run the Actor. Each page is pushed as its own dataset item; you can export to JSON, CSV, or Excel.
4. (Optional) Wire this Actor into Claude, ChatGPT, or Cursor through the [Apify MCP Server](https://docs.apify.com/platform/integrations/mcp) - see the MCP section above.

***

### FAQ

**Q1. Is this a Google Maps scraper?**
No. This Actor targets the **Google Local Search SERP** - the local pack inside a normal Google Search results page. The data layout, ranking, and ad behavior differ from Google Maps. Use this when you care about the SERP surface (local SEO rank tracking, snippet-style results, ad presence inside Search) rather than the Maps app.

**Q2. How many businesses are returned per page?**
Roughly 20 on desktop and 10 on mobile, matching what Google ships. Set `device` and `max_pages` to control.

**Q3. Will my cost spike if Google returns more results than I expected?**
No. You pay per page fetched, not per business. The cost of a single-page run is fixed at `$0.04` regardless of how many local results that page contains.

**Q4. Why both `location` and `uule`?**
`location` is the easy path (just a city name). `uule` is for advanced users who want sub-city or coordinate-level precision via Google's encoded-location format. They cannot be used together.

**Q5. What happens if I supply an invalid input?**
The Actor exits with a structured `error` record before doing any billable work. No setup or page charges are applied.

**Q6. Does this work with AI agents through MCP?**
Yes. See the **Use with Claude, ChatGPT, Cursor & other AI agents (MCP)** section near the top. MCP-compatible clients can discover and call this Actor natively.

**Q7. Where do I see results?**
In the Apify console under your run's **Dataset** tab. Export as JSON, CSV, or Excel from there. Each dataset item is one page; iterate them to walk all results.

***

Whether you are wiring this up as an MCP tool for Claude, ChatGPT, or Cursor - or pulling Google Local data directly through Apify's API - you will have clean, structured local pack results in minutes. Click **Try for free** to run your first search.

### Featured Tasks

Ready-to-run examples that show this API solving a specific problem. Each opens its own setup so you can run it on your account in one click.

- [Track local pack rankings for plumbers in Phoenix](https://apify.com/johnvc/google-local-api/examples/track-local-pack-rankings-plumbers-phoenix?fpr=9n7kx3) - which plumbers rank in the Phoenix local pack, with rating, reviews, phone, and address.

- [Find HVAC contractor leads in Dallas](https://apify.com/johnvc/google-local-api/examples/find-hvac-contractor-leads-dallas?fpr=9n7kx3) - HVAC contractors in Dallas from the local pack, with contact details for outreach.

- [Check the Google local pack for dentists in Chicago](https://apify.com/johnvc/google-local-api/examples/check-local-pack-dentists-chicago?fpr=9n7kx3) - who ranks in the Chicago dentist local pack, with rating, reviews, and rank.

- [Google local pack rank tracker for SEO agencies](https://apify.com/johnvc/google-local-api/examples/google-local-pack-rank-tracker-seo-agencies?fpr=9n7kx3) - track local pack rankings across keywords and cities for SEO clients.

- [Check Google local pack rankings for restaurants in Miami](https://apify.com/johnvc/google-local-api/examples/check-local-pack-rankings-restaurants-miami?fpr=9n7kx3) - which restaurants rank in the Miami local pack, with rating, reviews, and rank.

- [Track plumber near me local pack rankings](https://apify.com/johnvc/google-local-api/examples/track-plumber-near-me-local-pack-rankings?fpr=9n7kx3) - track which plumbers rank in Google's local pack for 'plumber near me' in any city.

- [Monitor local SERP visibility for dentist SEO](https://apify.com/johnvc/google-local-api/examples/monitor-local-serp-visibility-for-dentist-seo?fpr=9n7kx3) - monitor a dentist's visibility in Google's local SERP for any city.

- [Find local plumber leads in Tampa Florida](https://apify.com/johnvc/google-local-api/examples/find-local-plumber-leads-in-tampa-florida?fpr=9n7kx3) - build a plumber lead list for Tampa, Florida from Google's local results.

- [Find HVAC contractor leads in Phoenix Arizona](https://apify.com/johnvc/google-local-api/examples/find-hvac-contractor-leads-in-phoenix-arizona?fpr=9n7kx3) - build an HVAC contractor lead list for Phoenix, Arizona from Google's local results.

- [Build a roofer contact list for Dallas Texas](https://apify.com/johnvc/google-local-api/examples/build-a-roofer-contact-list-for-dallas-texas?fpr=9n7kx3) - get every roofer in Google's local results for Dallas, Texas as structured data.

- [List water damage restoration companies in Houston](https://apify.com/johnvc/google-local-api/examples/list-water-damage-restoration-companies-in-houston?fpr=9n7kx3) - list water damage restoration companies in Houston from Google's local results, with phone, address, rating, review count, and GPS for each business..

- [Find med spas in Scottsdale with ratings](https://apify.com/johnvc/google-local-api/examples/find-med-spas-in-scottsdale-with-ratings?fpr=9n7kx3) - find every med spa in Google's local results for Scottsdale, Arizona.

- [Find water damage restoration leads in Dallas](https://apify.com/johnvc/google-local-api/examples/find-water-damage-restoration-leads-dallas?fpr=9n7kx3) - find water damage restoration companies in Dallas from the Google local pack.

- [Find water damage restoration leads in Phoenix](https://apify.com/johnvc/google-local-api/examples/find-water-damage-restoration-leads-phoenix?fpr=9n7kx3) - find water damage restoration companies in Phoenix from the Google local pack.

- [Find dental implant leads in Phoenix](https://apify.com/johnvc/google-local-api/examples/find-dental-implant-leads-phoenix?fpr=9n7kx3) - find dental implant providers in Phoenix from the Google local pack.

- [Find assisted living facility leads in Phoenix](https://apify.com/johnvc/google-local-api/examples/find-assisted-living-leads-phoenix?fpr=9n7kx3) - find assisted living facilities in Phoenix from the Google local pack.

- [Find financial advisor leads in Denver](https://apify.com/johnvc/google-local-api/examples/find-financial-advisor-leads-denver?fpr=9n7kx3) - find financial advisors in Denver from the Google local pack.

- [Find med spa leads in Dallas](https://apify.com/johnvc/google-local-api/examples/find-med-spa-leads-dallas?fpr=9n7kx3) - find med spas in Dallas from the Google local pack.

- [Find home care agency leads in Philadelphia](https://apify.com/johnvc/google-local-api/examples/find-home-care-agency-leads-philadelphia?fpr=9n7kx3) - find home care agencies in Philadelphia from the Google local pack.

- [Find immigration lawyer leads in New York](https://apify.com/johnvc/google-local-api/examples/find-immigration-lawyer-leads-new-york?fpr=9n7kx3) - find immigration lawyers in New York from the Google local pack.

- [Find tree service leads in Houston](https://apify.com/johnvc/google-local-api/examples/find-tree-service-leads-houston?fpr=9n7kx3) - find tree service companies in Houston from the Google local pack.

- [Find pest control leads in Tampa](https://apify.com/johnvc/google-local-api/examples/find-pest-control-leads-tampa?fpr=9n7kx3) - find pest control companies in Tampa from the Google local pack.

- [Find junk removal leads in Houston](https://apify.com/johnvc/google-local-api/examples/find-junk-removal-leads-houston?fpr=9n7kx3) - find junk removal companies in Houston from the Google local pack.

- [Find appliance repair leads in Chicago](https://apify.com/johnvc/google-local-api/examples/find-appliance-repair-leads-chicago?fpr=9n7kx3) - find appliance repair companies in Chicago from the Google local pack.

- [Find concrete contractor leads in Dallas](https://apify.com/johnvc/google-local-api/examples/find-concrete-contractor-leads-dallas?fpr=9n7kx3) - find concrete contractors in Dallas from the Google local pack.

- [Find solar installer leads in San Diego](https://apify.com/johnvc/google-local-api/examples/find-solar-installer-leads-san-diego?fpr=9n7kx3) - find solar installers in San Diego from the Google local pack.

- [Find Medicare insurance agent leads in Houston](https://apify.com/johnvc/google-local-api/examples/find-medicare-agent-leads-houston?fpr=9n7kx3) - find Medicare insurance agents in Houston from the Google local pack.

- [Find mortgage broker leads in Chicago](https://apify.com/johnvc/google-local-api/examples/find-mortgage-broker-leads-chicago?fpr=9n7kx3) - find mortgage brokers in Chicago from the Google local pack.

- [Find painting contractor leads in Denver](https://apify.com/johnvc/google-local-api/examples/find-painting-contractor-leads-denver?fpr=9n7kx3) - find painting contractors in Denver from the Google local pack.

- [Find water damage restoration leads](https://apify.com/johnvc/google-local-api/examples/find-water-damage-restoration-leads?fpr=9n7kx3) - find water damage restoration companies in any city from the Google local pack.

- [Find dental implant leads](https://apify.com/johnvc/google-local-api/examples/find-dental-implant-leads?fpr=9n7kx3) - find dental implant providers in any city from the Google local pack.

- [Find assisted living facility leads](https://apify.com/johnvc/google-local-api/examples/find-assisted-living-leads?fpr=9n7kx3) - find assisted living facilities in any city from the Google local pack.

- [Find financial advisor leads](https://apify.com/johnvc/google-local-api/examples/find-financial-advisor-leads?fpr=9n7kx3) - find financial advisors in any city from the Google local pack.

- [Find med spa leads](https://apify.com/johnvc/google-local-api/examples/find-med-spa-leads?fpr=9n7kx3) - find med spas in any city from the Google local pack.

- [Find home care agency leads](https://apify.com/johnvc/google-local-api/examples/find-home-care-agency-leads?fpr=9n7kx3) - find home care agencies in any city from the Google local pack.

- [Find immigration lawyer leads](https://apify.com/johnvc/google-local-api/examples/find-immigration-lawyer-leads?fpr=9n7kx3) - find immigration lawyers in any city from the Google local pack.

- [Find tree service leads](https://apify.com/johnvc/google-local-api/examples/find-tree-service-leads?fpr=9n7kx3) - find tree service companies in any city from the Google local pack.

- [Find pest control leads](https://apify.com/johnvc/google-local-api/examples/find-pest-control-leads?fpr=9n7kx3) - find pest control companies in any city from the Google local pack.

- [Find junk removal leads](https://apify.com/johnvc/google-local-api/examples/find-junk-removal-leads?fpr=9n7kx3) - find junk removal companies in any city from the Google local pack.

- [Find appliance repair leads](https://apify.com/johnvc/google-local-api/examples/find-appliance-repair-leads?fpr=9n7kx3) - find appliance repair companies in any city from the Google local pack.

- [Find concrete contractor leads](https://apify.com/johnvc/google-local-api/examples/find-concrete-contractor-leads?fpr=9n7kx3) - find concrete contractors in any city from the Google local pack.

- [Find solar installer leads](https://apify.com/johnvc/google-local-api/examples/find-solar-installer-leads?fpr=9n7kx3) - find solar installers in any city from the Google local pack.

- [Find Medicare insurance agent leads](https://apify.com/johnvc/google-local-api/examples/find-medicare-insurance-agent-leads?fpr=9n7kx3) - find Medicare insurance agents in any city from the Google local pack.

- [Find mortgage broker leads](https://apify.com/johnvc/google-local-api/examples/find-mortgage-broker-leads?fpr=9n7kx3) - find mortgage brokers in any city from the Google local pack.

- [Find painting contractor leads](https://apify.com/johnvc/google-local-api/examples/find-painting-contractor-leads?fpr=9n7kx3) - find painting contractors in any city from the Google local pack.

- [Export Google Local Results to CSV](https://apify.com/johnvc/google-local-api/examples/export-google-local-results-to-csv?fpr=9n7kx3)

Last Updated: 2026.06.15

# Actor input Schema

## `q` (type: `string`):

The Google Local search query. Examples: 'coffee', 'dentists near me', 'plumbers in Brooklyn', 'best pizza'. Combine with the 'location' field for city-level targeting. Any term valid in Google Local search is accepted.

## `location` (type: `string`):

City-level location (e.g., 'Austin, Texas, United States', 'London', 'Brooklyn, New York'). Optional but recommended. Cannot be combined with 'uule'. If both are omitted, results use the API's default origin.

## `uule` (type: `string`):

Advanced: Google-encoded location string for precise geographic targeting. Use instead of 'location' for fine-grained control. Cannot be combined with 'location'.

## `google_domain` (type: `string`):

Which Google domain to query (e.g., 'google.com', 'google.co.uk', 'google.fr', 'google.de'). Defaults to 'google.com'. Use the regional domain for localized result formatting.

## `gl` (type: `string`):

Two-letter country code (ISO 3166-1 alpha-2, e.g., 'us', 'uk', 'fr', 'de', 'jp'). Localizes search results to that country. Defaults to 'us'.

## `hl` (type: `string`):

Two-letter language code (ISO 639-1, e.g., 'en', 'es', 'fr', 'de', 'ja'). Sets the language for the interface and result content. Defaults to 'en'.

## `ludocid` (type: `string`):

Advanced: Google customer identifier (CID) for a specific place. When provided, narrows results around that single business.

## `tbs` (type: `string`):

Advanced: Google search filter string for criteria not exposed elsewhere. See Google's filter documentation for valid syntax.

## `device` (type: `string`):

Which device to emulate. Affects results-per-page count (desktop returns about 20 per page, mobile about 10) and result formatting. Defaults to 'desktop'.

## `max_pages` (type: `integer`):

Maximum number of result pages to fetch (1-indexed). Set 0 for unlimited, bounded by a safety cap of 20 pages. Default: 1. Each fetched page is billed separately under pay-per-event.

## Actor input object example

```json
{
  "q": "coffee",
  "location": "Austin, Texas, United States",
  "google_domain": "google.com",
  "gl": "us",
  "hl": "en",
  "device": "desktop",
  "max_pages": 1
}
```

# Actor output Schema

## `allResults` (type: `string`):

Complete dataset with every page returned by the run. Each item is one page and contains local\_results, ads\_results, local\_map, discover\_more\_places, and search metadata.

## `localResults` (type: `string`):

Filtered view focused on the local\_results array - the organic local pack businesses Google returns for the query, with rating, reviews, phone, hours, GPS, and place\_id.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "q": "coffee",
    "location": "Austin, Texas, United States",
    "google_domain": "google.com",
    "gl": "us",
    "hl": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("johnvc/google-local-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "q": "coffee",
    "location": "Austin, Texas, United States",
    "google_domain": "google.com",
    "gl": "us",
    "hl": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("johnvc/google-local-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "q": "coffee",
  "location": "Austin, Texas, United States",
  "google_domain": "google.com",
  "gl": "us",
  "hl": "en"
}' |
apify call johnvc/google-local-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=johnvc/google-local-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Local API | Local Pack & Business Search SERPs",
        "description": "Search Google Local results - the local pack inside Google Search SERPs. Extract businesses with rating, reviews, phone, hours, place_id, GPS coordinates. Country, language, and device targeting. Pay per page. MCP-ready for AI agents.",
        "version": "0.1",
        "x-build-id": "YDci8yJcaFsEFKyPe"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/johnvc~google-local-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-johnvc-google-local-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/johnvc~google-local-api/runs": {
            "post": {
                "operationId": "runs-sync-johnvc-google-local-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/johnvc~google-local-api/run-sync": {
            "post": {
                "operationId": "run-sync-johnvc-google-local-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "q"
                ],
                "properties": {
                    "q": {
                        "title": "Search Query",
                        "minLength": 1,
                        "type": "string",
                        "description": "The Google Local search query. Examples: 'coffee', 'dentists near me', 'plumbers in Brooklyn', 'best pizza'. Combine with the 'location' field for city-level targeting. Any term valid in Google Local search is accepted."
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "City-level location (e.g., 'Austin, Texas, United States', 'London', 'Brooklyn, New York'). Optional but recommended. Cannot be combined with 'uule'. If both are omitted, results use the API's default origin."
                    },
                    "uule": {
                        "title": "UULE (Encoded Location)",
                        "type": "string",
                        "description": "Advanced: Google-encoded location string for precise geographic targeting. Use instead of 'location' for fine-grained control. Cannot be combined with 'location'."
                    },
                    "google_domain": {
                        "title": "Google Domain",
                        "type": "string",
                        "description": "Which Google domain to query (e.g., 'google.com', 'google.co.uk', 'google.fr', 'google.de'). Defaults to 'google.com'. Use the regional domain for localized result formatting."
                    },
                    "gl": {
                        "title": "Country Code",
                        "pattern": "^[a-z]{2}$",
                        "type": "string",
                        "description": "Two-letter country code (ISO 3166-1 alpha-2, e.g., 'us', 'uk', 'fr', 'de', 'jp'). Localizes search results to that country. Defaults to 'us'."
                    },
                    "hl": {
                        "title": "Language Code",
                        "pattern": "^[a-z]{2}$",
                        "type": "string",
                        "description": "Two-letter language code (ISO 639-1, e.g., 'en', 'es', 'fr', 'de', 'ja'). Sets the language for the interface and result content. Defaults to 'en'."
                    },
                    "ludocid": {
                        "title": "Place CID",
                        "type": "string",
                        "description": "Advanced: Google customer identifier (CID) for a specific place. When provided, narrows results around that single business."
                    },
                    "tbs": {
                        "title": "Advanced Filter String",
                        "type": "string",
                        "description": "Advanced: Google search filter string for criteria not exposed elsewhere. See Google's filter documentation for valid syntax."
                    },
                    "device": {
                        "title": "Device",
                        "enum": [
                            "desktop",
                            "tablet",
                            "mobile"
                        ],
                        "type": "string",
                        "description": "Which device to emulate. Affects results-per-page count (desktop returns about 20 per page, mobile about 10) and result formatting. Defaults to 'desktop'.",
                        "default": "desktop"
                    },
                    "max_pages": {
                        "title": "Maximum Pages",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of result pages to fetch (1-indexed). Set 0 for unlimited, bounded by a safety cap of 20 pages. Default: 1. Each fetched page is billed separately under pay-per-event.",
                        "default": 1
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
