# 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:** [Seemu Scraping](https://apify.com/seemuapps) (community)
- **Categories:** Lead generation, SEO tools, Travel
- **Features:** Limited permissions
- **Stats:** 11 total users, 1 monthly users, 100.0% runs succeeded, 0 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/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

## 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(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 '{
  "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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,seemuapps/google-geocoding-batch-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/YM49LsC1pz5Zn5y0T/builds/42vbol2dtlT9HpKib/openapi.json
