# Google Geocoding Batch Scraper (`seemuapps/google-geocoding-batch-scraper`) Actor

Convert a list of addresses to latitude/longitude (forward geocoding) or coordinates to addresses (reverse geocoding) in bulk using the official Google Geocoding API.

- **URL**: https://apify.com/seemuapps/google-geocoding-batch-scraper.md
- **Developed by:** [Andrew](https://apify.com/seemuapps) (community)
- **Categories:** Lead generation, SEO tools, Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 geocode 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 Geocoding Batch Scraper

Convert a bulk list of addresses to latitude/longitude — or coordinates back to clean, normalized addresses — using the official Google Geocoding API. Stop running one-off cURL calls; paste your list and export.

### What you get

- **Forward geocoding** — address → lat/lng, placeId, formatted address, and split components (street, locality, country, postal code, etc.)
- **Reverse geocoding** — lat/lng → formatted address, placeId, and the full component breakdown
- **One dataset row per result** — Google sometimes returns multiple candidates per input; each one is its own row with a `rank`
- **All address components extracted** — street number, route, neighborhood, locality, admin areas, country, country code, postal code, plus code
- **Per-input error handling** — bad inputs get a row with `status` set to `INVALID_INPUT`, `ZERO_RESULTS`, etc.; the run continues
- **Region & component biasing** — pin forward geocoding to a country, restrict by admin area, or filter reverse geocoding by location type

### Use cases

- **CRM cleanup** — turn a column of free-text addresses into normalized fields with lat/lng for mapping
- **Real estate / property data** — resolve street addresses to coordinates for distance, school zone, and amenity analysis
- **Logistics & routing** — pre-geocode delivery addresses before bulk routing
- **Reverse-lookup analytics** — turn GPS pings into city/neighborhood for cohort analysis
- **Address validation** — flag inputs that return `partial_match: true` or `ZERO_RESULTS` for cleanup

### How to use

1. Pick a **Mode**:
   - **Forward** — address strings, one per line.
   - **Reverse** — `lat,lng` pairs (e.g. `40.7128,-74.006`), one per line.
2. Paste your list into **Inputs**.
3. (Optional) Set **Language** for the formatted address (`en`, `es`, `fr`, …).
4. (Forward only, optional) Set **Region** to bias by country (`us`, `gb`, `de`) and **Components** to constrain (`country:US`).
5. (Reverse only, optional) Set **Result type** and **Location type** filters.
6. Run — every result becomes its own dataset row.

### Forward vs reverse examples

**Forward input:**
````

1600 Amphitheatre Pkwy, Mountain View, CA
221B Baker Street, London

```

**Reverse input:**
```

37.4220,-122.0841
51.5237,-0.1585

````

### Output schema

| Field | Type | Description |
|---|---|---|
| `input` | string | Echo of the original input |
| `mode` | string | `forward` or `reverse` |
| `rank` | number | 1-based rank when Google returns multiple candidates |
| `status` | string | `OK`, `ZERO_RESULTS`, `INVALID_INPUT`, `OVER_QUERY_LIMIT`, `REQUEST_DENIED`, `INVALID_REQUEST`, `ERROR` |
| `formattedAddress` | string \| null | Google's canonical address string |
| `latitude` / `longitude` | number \| null | Coordinates |
| `placeId` | string \| null | Google place ID — stable identifier |
| `locationType` | string \| null | `ROOFTOP`, `RANGE_INTERPOLATED`, `GEOMETRIC_CENTER`, `APPROXIMATE` |
| `partialMatch` | boolean \| null | `true` if Google guessed at part of the input |
| `types` | string[] | Place types (e.g. `street_address`, `locality`) |
| `streetNumber` | string \| null | Street number component |
| `route` | string \| null | Street name |
| `neighborhood` | string \| null | Neighborhood |
| `subLocality` | string \| null | Sub-locality (e.g. NYC borough) |
| `locality` | string \| null | City |
| `adminArea1Long` / `adminArea1Short` | string \| null | State / region (full and abbreviated) |
| `adminArea2Long` | string \| null | County |
| `country` | string \| null | Country name |
| `countryCode` | string \| null | Two-letter country code |
| `postalCode` | string \| null | ZIP / postal code |
| `plusCodeGlobal` | string \| null | Global plus code |
| `plusCodeCompound` | string \| null | Compound plus code |
| `error` | string \| null | Error message if `status` is not `OK` |

### Tips

- **Use Components** (`country:US`) to prevent ambiguous addresses from matching the wrong country (e.g. "Springfield" matches dozens of places worldwide).
- **`locationType` matters** — `ROOFTOP` is a precise address match; `APPROXIMATE` means Google fell back to a city center.
- **`partialMatch: true`** is a strong signal the input had typos or missing parts — flag these for human review.
- Google rate-limits aggressive batches; if you see `OVER_QUERY_LIMIT` consistently, slow down or raise the quota in Google Cloud.
- For reverse geocoding of a point with multiple result types, the first row is the most specific (street address) and later rows broaden up to country.

# Actor input Schema

## `mode` (type: `string`):

Forward converts addresses to coordinates. Reverse converts 'lat,lng' pairs to formatted addresses and components.
## `inputs` (type: `array`):

Forward mode: one address per line. Reverse mode: one 'lat,lng' pair per line (e.g. 40.7128,-74.006).
## `language` (type: `string`):

BCP-47 language code for the formatted address (e.g. en, es, fr).
## `region` (type: `string`):

Two-letter ccTLD region bias for forward geocoding (e.g. us, gb, de).
## `components` (type: `string`):

Component filter for forward geocoding, e.g. 'country:US' or 'country:GB|locality:London'.
## `resultType` (type: `string`):

Pipe-separated reverse-geocoding result types, e.g. 'street_address|locality|country'.
## `locationType` (type: `string`):

Pipe-separated reverse-geocoding location types, e.g. 'ROOFTOP|RANGE_INTERPOLATED'.

## Actor input object example

```json
{
  "mode": "forward",
  "inputs": [
    "1600 Amphitheatre Pkwy, Mountain View, CA",
    "1 Apple Park Way, Cupertino, CA"
  ],
  "language": "en"
}
````

# Actor output Schema

## `results` (type: `string`):

One record per input: input, mode, rank, status, formattedAddress, latitude, longitude, placeId, locationType, partialMatch, types, streetNumber, route, neighborhood, subLocality, locality, adminArea1Long, adminArea1Short, adminArea2Long, country, countryCode, postalCode, plusCodeGlobal, plusCodeCompound, error.

# 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 = {
    "inputs": [
        "1600 Amphitheatre Pkwy, Mountain View, CA",
        "1 Apple Park Way, Cupertino, CA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/google-geocoding-batch-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 = { "inputs": [
        "1600 Amphitheatre Pkwy, Mountain View, CA",
        "1 Apple Park Way, Cupertino, CA",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("seemuapps/google-geocoding-batch-scraper").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 '{
  "inputs": [
    "1600 Amphitheatre Pkwy, Mountain View, CA",
    "1 Apple Park Way, Cupertino, CA"
  ]
}' |
apify call seemuapps/google-geocoding-batch-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Geocoding Batch Scraper",
        "description": "Convert a list of addresses to latitude/longitude (forward geocoding) or coordinates to addresses (reverse geocoding) in bulk using the official Google Geocoding API.",
        "version": "1.0",
        "x-build-id": "f4ggf2uQ6D2LKUYz6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/seemuapps~google-geocoding-batch-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-seemuapps-google-geocoding-batch-scraper",
                "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/seemuapps~google-geocoding-batch-scraper/runs": {
            "post": {
                "operationId": "runs-sync-seemuapps-google-geocoding-batch-scraper",
                "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/seemuapps~google-geocoding-batch-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-seemuapps-google-geocoding-batch-scraper",
                "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": [
                    "inputs"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "forward",
                            "reverse"
                        ],
                        "type": "string",
                        "description": "Forward converts addresses to coordinates. Reverse converts 'lat,lng' pairs to formatted addresses and components.",
                        "default": "forward"
                    },
                    "inputs": {
                        "title": "Inputs",
                        "type": "array",
                        "description": "Forward mode: one address per line. Reverse mode: one 'lat,lng' pair per line (e.g. 40.7128,-74.006).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "BCP-47 language code for the formatted address (e.g. en, es, fr).",
                        "default": "en"
                    },
                    "region": {
                        "title": "Region (forward only)",
                        "type": "string",
                        "description": "Two-letter ccTLD region bias for forward geocoding (e.g. us, gb, de)."
                    },
                    "components": {
                        "title": "Components (forward only)",
                        "type": "string",
                        "description": "Component filter for forward geocoding, e.g. 'country:US' or 'country:GB|locality:London'."
                    },
                    "resultType": {
                        "title": "Result type (reverse only)",
                        "type": "string",
                        "description": "Pipe-separated reverse-geocoding result types, e.g. 'street_address|locality|country'."
                    },
                    "locationType": {
                        "title": "Location type (reverse only)",
                        "type": "string",
                        "description": "Pipe-separated reverse-geocoding location types, e.g. 'ROOFTOP|RANGE_INTERPOLATED'."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
