# Google My Maps Layer & Placemark Exporter (`crawlyth-forge/google-my-maps-exporter`) Actor

Export any public Google My Maps map without a login: layer list, placemark names and descriptions, points, routes, polygons, full coordinates, centroids, icons and colours, custom fields, embedded media and Google Maps links. Optional GeoJSON and KML files.

- **URL**: https://apify.com/crawlyth-forge/google-my-maps-exporter.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** Automation, Developer tools, Travel
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Google My Maps Layer & Placemark Exporter

Turn a public Google My Maps map into a structured dataset. Paste a viewer, edit or embed
link (or the bare map ID) and the actor returns the map's layers, every placemark, full route
and polygon coordinates, centroids, icon colours, custom fields, embedded media links and a
Google Maps link for each feature. Optionally save GeoJSON and the original KML to the run's
key-value store.

Google My Maps is the custom-map layer in Google Maps: food trails, festival grounds, store
locators, walking routes, ward boundaries, research maps and community projects. The map owner
can share one with "Anyone with the link"; that public map is what this actor reads. No account,
cookie, API key or Google Cloud project is involved.

### What it does

- Accepts `https://www.google.com/maps/d/viewer?mid=...`, `/edit?mid=...`, `/embed?mid=...`,
  `/maps/d/u/0/viewer?mid=...`, Drive `open?id=...` links, old `msid=` links and bare map IDs.
- Reads the same public KML/KMZ payload that Google serves from its map export endpoint.
- Writes one **map summary** row per map and one **placemark** row per point, route, polygon or
  multi-geometry (plus one **overlay** row for each image overlay).
- Keeps every custom field the owner added to a placemark (ExtendedData key/value pairs).
- Extracts image and video URLs embedded in a placemark description.
- Filters by layer, geometry type and keyword.
- Optionally writes `map-<id>.kml`, `map-<id>.geojson` and `my-maps-all.geojson` files.

Private or deleted maps return a dataset row with `status: "inaccessible"` and the HTTP status,
so a batch run reports them without stopping the rest.

### How to use

1. Open the map in Google My Maps and use **Share** to set link sharing to
   **Anyone with the link** (or use a map that is already public).
2. Copy the share URL, or take the `mid` value from it.
3. Paste one or more links into **Public My Maps URLs or map IDs**.
4. Optionally narrow the export with **Layers**, **Geometry types** and **Keyword**.
5. Run. The dataset opens on the **All rows**, **Maps** and **Placemarks** tabs.

Example input:

```json
{
  "mapUrls": [
    "https://www.google.com/maps/d/viewer?mid=1DpJu2DbYssvxH0XsK6f6iXV6BN4"
  ],
  "maxItems": 10000,
  "includeMapRecords": true,
  "includeGeoJson": true,
  "includeKml": true
}
```

The daily test uses the same map ID with `maxItems: 3`; it returns a map row and placemark rows. The default cap is 10,000 rows, enough for the largest My Maps exports; raise it up to 100,000 for bigger batches.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mapUrls` | string list | `["1DpJu2DbYssvxH0XsK6f6iXV6BN4"]` | Required. 1–50 public My Maps viewer/edit/embed/KML links, Drive links, short links, old `msid` links or bare map IDs (`mid`). |
| `maxItems` | integer | `10000` | Hard cap on dataset rows, including map summary rows (1–100,000). |
| `includeMapRecords` | boolean | `true` | Write one map summary row per map before its placemark rows. |
| `includeGeoJson` | boolean | `false` | Save per-map GeoJSON and `my-maps-all.geojson` to the key-value store. |
| `includeKml` | boolean | `false` | Save the KML Google served for each map to the key-value store. |
| `layers` | string list | – | Keep features whose layer name or full path contains any value (case-insensitive). |
| `geometryTypes` | multi-select | – | Keep `point`, `line`, `polygon`, `multigeometry` and/or `overlay` features. |
| `keyword` | string | – | Keep features whose name, description, layer, address, phone or custom-field value contains this text. |
| `proxyConfiguration` | proxy | – | Optional. The actor uses direct access with an automatic Apify datacenter fallback; set this only to force a proxy group or country. |

### Modes and rows

This is a single-purpose exporter; the "mode" is the kind of row requested:

| Row | `recordType` | What it contains |
|---|---|---|
| Map summary | `map` | Title, description (HTML and plain text), viewer URL, layer list with per-layer counts, placemark/overlay counts, geometry counts, author and view information. |
| Placemark | `placemark` | Layer and full layer path, name, description, geometry type, GeoJSON geometry, every coordinate, centroid and bounding box, icon/colour, custom fields, media URLs, Google Maps link. |
| Image overlay | `overlay` | Name, image URL, north/south/east/west box, rotation, draw order and Google Maps link. |
| Unavailable map | `map` + `status` | `inaccessible` (private/deleted/HTTP error) or `invalid` (no map ID in the input), with an error message. |

#### Map summary fields

`mapId`, `mapTitle`, `mapDescriptionHtml`, `mapDescription`, `mapUrl`, `sourceUrl`,
`inputUrl`, `layerCount`, `placemarkCount`, `overlayCount`, `featureCount`, `geometryCounts`, `layers`
(name, path, index, placemark/overlay counts, geometry counts), `mapAuthor`, `mapLink`,
`viewLatitude`, `viewLongitude`, `viewRange`, `networkLinkCount`, `status`, `scrapedAt`.

#### Placemark fields

`name`, `descriptionHtml`, `description`, `geometryType`, `geometry`, `latitude`, `longitude`,
`coordinates`, `coordinateCount`, `centroidLat`, `centroidLng`, `bbox`, `googleMapsUrl`,
`layer`, `layerPath`, `layerIndex`, `featureId`, `styleId`, `styleColor`, `styleColorAbgr`,
`styleAlpha`, `iconUrl`, `iconScale`, `lineColor`, `lineWidth`, `polyColor`, `polyFill`,
`polyOutline`, `labelScale`, `customData`, `customFieldCount`, `imageUrls`, `videoUrls`,
`mediaUrls`, `address`, `phoneNumber`, `snippet`, `visibility`, `timestamp`,
`timespanBegin`, `timespanEnd`, `sourceUrl`, `scrapedAt`.

Points get exact `latitude`/`longitude`; every geometry gets a centroid and bounding box.
Lines and polygons include the full `coordinates` list in order. The `geometry` object is
GeoJSON-ready (longitude, latitude order).

### Filters

- **Layers** — matches the layer name or full nested path, case-insensitive substring. Useful
  for exporting one day of a festival itinerary or one category of a directory map.
- **Geometry types** — `point`, `line`, `polygon`, `multigeometry`, `overlay`. A multi-geometry
  matches when any of its parts matches.
- **Keyword** — searches the name, description, layer, address, phone and custom-field values.

Filtering never drops the map summary row; it describes the whole map. `maxItems` caps total
dataset rows, including map summaries, and stops fetching new maps when reached.

### GeoJSON and KML files

When **Save GeoJSON files** is on, the key-value store gets one `map-<id>.geojson` per map and
`my-maps-all.geojson` for all filtered features. Points, routes, polygons, multi-geometries and
overlay rectangles use standard GeoJSON geometry; properties carry the record fields.

When **Save original KML files** is on, the KML Google served is stored as `map-<id>.kml`. A KMZ
archive is unpacked to its KML document first. The files are the unfiltered map; the dataset
and GeoJSON apply your filters.

### Data source and access

The KML/KMZ endpoint is the map's own public export:
`https://www.google.com/maps/d/kml?forcekml=1&mid=<id>`. It needs no login and no Google API
key. The actor tries direct access first. If a datacenter IP is blocked, it retries with
Apify's datacenter proxy automatically. You never have to configure a proxy, but an optional
proxy setting is available if you want to force a group or country.

### Limits

- **Private maps cannot be read.** A map must be shared with "Anyone with the link". Private,
  deleted and permission-restricted maps return `status: "inaccessible"`. The actor does not
  use cookies, so it cannot read a map on someone's private account.
- **Media is linked, not copied.** Images and videos inside descriptions are third-party files
  owned by the map author. Their URLs are passed through. If the owner deletes or restricts an
  image later, its URL can return 404; the actor does not rehost other people's media.
- **Network links are reported, not followed.** If a map contains a KML NetworkLink, its count
  and URL appear in the map summary, but the remote file is not fetched.
- **Google's view.** The KML is Google's own export of the map. Hidden layers, Google's
  basemap, directions and satellite imagery are not part of the exported data.
- **KML is the unfiltered map.** Filters apply to dataset and GeoJSON rows only.
- **Very large maps** are capped by `maxItems`; the run stops fetching new maps once the cap is
  reached.

### FAQ

**Do I need a Google account?** No. The map must be public, but the actor never signs in.

**Can it read a map that is only shared with specific people?** No. Ask the owner to use
"Anyone with the link" or export the KML from their own My Maps account.

**Does it work with an edit URL?** Yes. Viewer, edit, embed and Drive links all resolve to the
same public map ID.

**What is a `mid`?** The map ID in the share URL, for example
`1DpJu2DbYssvxH0XsK6f6iXV6BN4`. You can paste it on its own.

**Why is a placemark missing?** Check your layer, geometry-type and keyword filters. A map's
empty layers are listed in the map summary with zero counts.

# Actor input Schema

## `mapUrls` (type: `array`):

Viewer, edit or embed URLs from a map shared with "Anyone with the link", or the bare mid value. Share URLs with mid=, Drive open?id= links and old msid values are accepted. One map is read per item.

## `maxItems` (type: `integer`):

Hard cap on rows written to the dataset, including one map summary row per map. The run stops fetching new maps when it is reached. Default 10,000 covers the largest My Maps exports; raise it for a bigger batch.

## `includeMapRecords` (type: `boolean`):

Write one summary row per map (title, description, layer list, placemark and geometry counts) before its placemark rows. Turn off for placemark-only datasets.

## `includeGeoJson` (type: `boolean`):

Write one GeoJSON file per map plus my-maps-all.geojson (all filtered features) to the run's key-value store.

## `includeKml` (type: `boolean`):

Write the KML that Google served for each map to the run's key-value store as map-<id>.kml. KMZ archives are unpacked to their KML document.

## `layers` (type: `array`):

Keep only features whose layer name or full layer path contains any of these values (case-insensitive). Leave empty for every layer.

## `geometryTypes` (type: `array`):

Keep only these feature types. A MultiGeometry row matches when any of its parts matches. Leave empty for every type.

## `keyword` (type: `string`):

Keep features whose name, description, layer, address, phone or custom-field value contains this text (case-insensitive).

## `proxyConfiguration` (type: `object`):

Optional. The actor reads the public KML endpoint directly and falls back to Apify's datacenter proxy by itself. Set this only to force a specific proxy group or country.

## Actor input object example

```json
{
  "mapUrls": [
    "1DpJu2DbYssvxH0XsK6f6iXV6BN4"
  ],
  "maxItems": 3,
  "includeMapRecords": true,
  "includeGeoJson": false,
  "includeKml": false,
  "layers": [],
  "geometryTypes": [],
  "keyword": ""
}
```

# Actor output Schema

## `maps` (type: `string`):

Dataset with one summary row per map and one row per placemark or image overlay.

## `mapFiles` (type: `string`):

Optional map-<id>.geojson, map-<id>.kml and my-maps-all.geojson files in the run's key-value store.

# 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 = {
    "mapUrls": [
        "1DpJu2DbYssvxH0XsK6f6iXV6BN4"
    ],
    "maxItems": 3,
    "includeMapRecords": true,
    "includeGeoJson": false,
    "includeKml": false,
    "layers": [],
    "geometryTypes": [],
    "keyword": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/google-my-maps-exporter").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 = {
    "mapUrls": ["1DpJu2DbYssvxH0XsK6f6iXV6BN4"],
    "maxItems": 3,
    "includeMapRecords": True,
    "includeGeoJson": False,
    "includeKml": False,
    "layers": [],
    "geometryTypes": [],
    "keyword": "",
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/google-my-maps-exporter").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 '{
  "mapUrls": [
    "1DpJu2DbYssvxH0XsK6f6iXV6BN4"
  ],
  "maxItems": 3,
  "includeMapRecords": true,
  "includeGeoJson": false,
  "includeKml": false,
  "layers": [],
  "geometryTypes": [],
  "keyword": ""
}' |
apify call crawlyth-forge/google-my-maps-exporter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/google-my-maps-exporter"
        }
    }
}
```

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/l09jok7qgUfkeIVxG/builds/CCFX09gcYAhzdvwe3/openapi.json
