# Google Maps Geocode Scraper (`romy/google-maps-geocode-scraper`) Actor

Get reverse geocoding and shareable place links from Google Maps. Talks directly to Google Maps' internal mobile API, no login needed. Split from the mature, published google-maps-all-in-one-api for a focused, single-purpose workflow.

- **URL**: https://apify.com/romy/google-maps-geocode-scraper.md
- **Developed by:** [Romy](https://apify.com/romy) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 address chargeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Google Maps Geocode Scraper do?

**Google Maps Geocode Scraper** reverse geocodes lat/lng points into a Google Maps place hierarchy, and/or generates shareable `maps.app.goo.gl` links for a place — the same short link the app's own "Share" button produces. One dataset row per query.

It talks directly to the same private gRPC API the official Google Maps Android app uses (`mobilemaps-pa-gz.googleapis.com`), reverse-engineered and proven working in [Google Maps Unofficial API](https://apify.com/romy/google-maps-all-in-one-api) — this is the geocode + share slice of that all-in-one Actor, split out as its own focused batch-run Actor (`/geocode` and `/share`).

### Why use Google Maps Geocode Scraper?

- **Real protobuf/gRPC data, not scraped HTML**
- **Place hierarchy, not just an address string** — reverse geocode returns `kgId`/`gcid` and a parent chain (campus/park/compound-style areas), when Google's data has one
- **Real shareable links** — byte-for-byte the same request the app's Share button sends
- **Batch-friendly** — pass any number of geocode and/or share queries in one run
- **No account, no API key needed**
- **Use cases:** reverse-geocoding a dataset of coordinates, generating shareable links for a places database

### Input

| Field     | Type  | Description                                                                                     |
| --------- | ----- | ----------------------------------------------------------------------------------------------- |
| `geocode` | array | `{ lat, lng }` points to reverse geocode. Optional — provide at least one of `geocode`/`share`. |
| `share`   | array | `{ placeId, address, lat, lng }` to turn into a shareable link. Optional.                       |

Example:

```json
{
    "geocode": [{ "lat": 38.8960382, "lng": -77.0365611 }],
    "share": [
        {
            "placeId": "0x89b7b7bcdecbb1df:0x715969d86d0b76bf",
            "address": "White House, Pennsylvania Avenue Northwest, Washington, DC, USA",
            "lat": 38.8976763,
            "lng": -77.0365298
        }
    ]
}
```

### Output

One row per query:

```json
{
    "type": "geocode",
    "lat": 38.8960382,
    "lng": -77.0365611,
    "location": { "kgId": "/g/11v5rw0dxd", "gcid": "gcid:park", "parents": [] }
}
```

```json
{
    "type": "share",
    "placeId": "0x89b7b7bcdecbb1df:0x715969d86d0b76bf",
    "url": "https://maps.app.goo.gl/VRP3mQSMQksCVY7U8"
}
```

### Known limitations

- **`location` is legitimately `null`** for plain addresses and standalone landmarks — Google's data only has a hierarchy for campus/park/compound-style areas. This is correct behavior, not a bug.
- Search, autocomplete, place detail, reviews, directions, and reference-data lookups are separate spin-off Actors — this one is geocode + share only. See [google-maps-search-scraper](https://apify.com/romy/google-maps-search-scraper) and [google-maps-place-detail-scraper](https://apify.com/romy/google-maps-place-detail-scraper).

### Pricing

Pay per event, via the `address` event — charged once per geocode or share-link result pushed to the dataset, starting at $0.0007 (FREE tier). See the Actor's Pricing tab for current rates.

# Actor input Schema

## `geocode` (type: `array`):

Array of { lat, lng } points to reverse geocode into a place hierarchy (kgId/gcid + parents). Legitimately returns a null location for plain addresses/standalone landmarks — that's correct behavior, not a bug.

## `share` (type: `array`):

Array of place details to turn into a maps.app.goo.gl short link — the same link the app's own "Share" button produces.

## Actor input object example

```json
{
  "geocode": [
    {
      "lat": 38.8960382,
      "lng": -77.0365611
    }
  ],
  "share": [
    {
      "placeId": "0x89b7b7bcdecbb1df:0x715969d86d0b76bf",
      "address": "White House, Pennsylvania Avenue Northwest, Washington, DC, USA",
      "lat": 38.8976763,
      "lng": -77.0365298
    }
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "geocode": [
        {
            "lat": 38.8960382,
            "lng": -77.0365611
        }
    ],
    "share": [
        {
            "placeId": "0x89b7b7bcdecbb1df:0x715969d86d0b76bf",
            "address": "White House, Pennsylvania Avenue Northwest, Washington, DC, USA",
            "lat": 38.8976763,
            "lng": -77.0365298
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/google-maps-geocode-scraper").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 = {
    "geocode": [{
            "lat": 38.8960382,
            "lng": -77.0365611,
        }],
    "share": [{
            "placeId": "0x89b7b7bcdecbb1df:0x715969d86d0b76bf",
            "address": "White House, Pennsylvania Avenue Northwest, Washington, DC, USA",
            "lat": 38.8976763,
            "lng": -77.0365298,
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("romy/google-maps-geocode-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "geocode": [
    {
      "lat": 38.8960382,
      "lng": -77.0365611
    }
  ],
  "share": [
    {
      "placeId": "0x89b7b7bcdecbb1df:0x715969d86d0b76bf",
      "address": "White House, Pennsylvania Avenue Northwest, Washington, DC, USA",
      "lat": 38.8976763,
      "lng": -77.0365298
    }
  ]
}' |
apify call romy/google-maps-geocode-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,romy/google-maps-geocode-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/uspJ8YVrwph7bwpeE/builds/f9phdxTSpNmr9umsz/openapi.json
