# Google Maps API by APISH (`apish/google-maps-api`) Actor

Google Maps data as clean JSON via APISH: Google Maps place details, Google Maps directions, Google Maps places near a point and 4 more endpoints. Pay per credit; failed calls are free.

- **URL**: https://apify.com/apish/google-maps-api.md
- **Developed by:** [APISH](https://apify.com/apish) (community)
- **Categories:** SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 credits

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 Maps API by APISH

Get public Google Maps data as clean, consistent JSON: google Maps place details, google Maps directions, google Maps places near a point, google Maps place photos, one Google Maps place, google Maps place reviews and more. 7 endpoints, one response shape, numbers parsed, absolute URLs.

### How to use

1. Pick an **Endpoint**. Each option shows what it returns and its price in credits.
2. Enter its **Parameters** as JSON, for example `{"origin":"40.7580,-73.9855","destination":"JFK Airport"}`. All parameters are listed below.
3. Run. Each call becomes one row in the dataset. Use **Batch** to run the same endpoint for many inputs and **Pages per input** to follow pagination.

### Pricing

Pay per event: you pay per APISH credit the call used. The price of each endpoint is in the table below. Calls that fail on our side (server errors, timeouts, blocks) are free.

### Endpoints

| Endpoint | Returns | Required parameters | Credits |
|---|---|---|---|
| `/google-maps/v1/details` | Google Maps place details | — | 1 |
| `/google-maps/v1/directions` | Google Maps directions | `origin`, `destination` | 1 |
| `/google-maps/v1/nearby` | Google Maps places near a point | `lat`, `lng` | 1 |
| `/google-maps/v1/photos` | Google Maps place photos | — | 1 |
| `/google-maps/v1/place` | One Google Maps place | — | 1 |
| `/google-maps/v1/reviews` | Google Maps place reviews | — | 1 |
| `/google-maps/v1/search` | Google Maps place search | `q` | 1 |

### Output

Each dataset row has `endpoint`, `params`, `status`, `credits_used` and the endpoint's data. Add `"raw": 1` to the parameters to also get the site's original record, or `"fields": "a,b.c"` to return only the fields you need.

### Endpoint details

#### Google Maps place details

Endpoint `/google-maps/v1/details` · 1 credit per successful call.

Everything the place panel shows: contact details, address parts, plus code, opening hours and open status, descriptions, rating with its 1-5 star histogram, review topics, the About tab (accessibility, amenities, payments, parking…), popular times when Google has them, owner, links (menu, order, reservations), labels, a photo sample and the first reviews. Identify the place by `feature_id`, `cid`, a Maps `url`, or `place_id` with `q`. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `feature_id`: The place's Google data id (`0x…:0x…`), from search results (`feature_id`) or a Maps URL (`!1s0x…`).
- `cid`: The place's CID (the number in `?cid=` Maps links), instead of feature_id.
- `url`: A Google Maps place URL, instead of feature_id.
- `place_id`: Google place id (`ChI…`), alone (resolved through its Maps page) or with `q` (the place name and city).
- `q`: With place_id, or alone: the place name and city to look up.
- `hl`: Language (default en).
- `gl`: Country (default us).

#### Google Maps directions

Endpoint `/google-maps/v1/directions` · 1 credit per successful call.

Routes between two points for a travel mode: distance, duration (typical and in current traffic), warnings (tolls, ferries) and turn-by-turn steps. Points are `lat,lng` or a place name (resolved with a Maps search). Every response includes `credits_used`: the credits this call cost.

Parameters:

- `origin` (required): Start: `lat,lng` or a place name.
- `destination` (required): End: `lat,lng` or a place name.
- `mode`: driving (default), walking, cycling or transit.
- `hl`: Language (default en).
- `gl`: Country (default us).

Example parameters: `{"origin":"40.7580,-73.9855","destination":"JFK Airport"}`

#### Google Maps places near a point

Endpoint `/google-maps/v1/nearby` · 1 credit per successful call.

Places around `lat`,`lng` (or `location=lat,lng`), optionally of a kind (`q`, e.g. restaurants, pharmacies). `zoom` sets the search radius (15 by default: a neighbourhood; 13 a city district; 17 a few blocks). Each place carries `distance_m` from the point. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `lat` (required): Latitude of the point.
- `lng` (required): Longitude of the point.
- `q`: What to look for (default: any place).
- `zoom`: Map zoom 3-21 (default 15); lower is a wider area.
- `page`: Page number (20 places per page).
- `limit`: Places per page (max 20).
- `hl`: Language (default en).
- `gl`: Country (default us).

Example parameters: `{"lat":"30.2672","lng":"-97.7431"}`

#### Google Maps place photos

Endpoint `/google-maps/v1/photos` · 1 credit per successful call.

The photos the place panel carries: the cover photos and every photo attached to its reviews, as full-size URLs (`=s0`; replace with `=w800-h600` for a thumbnail) with dimensions and captions, plus the place's total photo count. Identify the place as for details. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `feature_id`: The place's Google data id (`0x…:0x…`), from search results (`feature_id`) or a Maps URL (`!1s0x…`).
- `cid`: The place's CID (the number in `?cid=` Maps links), instead of feature_id.
- `url`: A Google Maps place URL, instead of feature_id.
- `place_id`: Google place id (`ChI…`), alone (resolved through its Maps page) or with `q` (the place name and city).
- `q`: With place_id, or alone: the place name and city to look up.
- `hl`: Language (default en).
- `gl`: Country (default us).
- `limit`: Photos to return (max 200).

#### One Google Maps place

Endpoint `/google-maps/v1/place` · 1 credit per successful call.

Pass `q` or a Google Maps place URL. `place_id` selects a match inside that search.

Parameters:

- `q`
- `url`: A Google Maps place URL (instead of q).
- `place_id`: Google place id to pick among the matches.

#### Google Maps place reviews

Endpoint `/google-maps/v1/reviews` · 1 credit per successful call.

The reviews the place panel carries (typically 5-10, the ones Google ranks most relevant; `sort=newest\|highest\|lowest` gives the first five for that order instead) with rating, text, date, author profile, photos, the guided answers (parking, seating, vegetarian options…) and the owner reply, plus the 1-5 star histogram and the review topics with mention counts. Identify the place as for details. Every response includes `credits_used`: the credits this call cost.

Parameters:

- `feature_id`: The place's Google data id (`0x…:0x…`), from search results (`feature_id`) or a Maps URL (`!1s0x…`).
- `cid`: The place's CID (the number in `?cid=` Maps links), instead of feature_id.
- `url`: A Google Maps place URL, instead of feature_id.
- `place_id`: Google place id (`ChI…`), alone (resolved through its Maps page) or with `q` (the place name and city).
- `q`: With place_id, or alone: the place name and city to look up.
- `hl`: Language (default en).
- `gl`: Country (default us).
- `limit`: Reviews to return (max 50).
- `sort` — one of `relevant`, `newest`, `highest`, `lowest`: relevant, newest, highest or lowest: the five reviews Google shows first for that order (from the Reviews tab's own call). Without sort: the reviews the place panel embeds (most relevant).

#### Google Maps place search

Endpoint `/google-maps/v1/search` · 1 credit per successful call.

Each page is the next 20 Google results. `next_page` is null on the last page.

Parameters:

- `q` (required)
- `lat`: Centre the search on this point (with lng), like the map viewport.
- `lng`: Longitude of the centre point.
- `zoom`: With lat/lng, the map zoom 3-21 (default 14); lower is a wider area.
- `page`: Page number. Pass `next_page` from the previous response; `next_page` is null on the last page.
- `limit`: Places per page (max 20).

Example parameters: `{"q":"coffee near times square"}`

### Support

Questions, bugs or a missing field? Open an issue in this Actor's Issues tab and we will reply there.

Public data only: nothing behind a login. You are responsible for how you use the data you collect.

# Actor input Schema

## `endpoint` (type: `string`):

Which Google Maps endpoint to call. Each option shows what it returns and its price in credits.

## `params` (type: `object`):

Query parameters for the endpoint, as JSON. See the README for every endpoint's parameters. Example: {"origin":"40.7580,-73.9855","destination":"JFK Airport"}

## `batch` (type: `array`):

Run the same endpoint for many inputs: a list of parameter objects. Each item is one call. Leave empty to use Parameters.

## `maxPages` (type: `integer`):

For paginated endpoints: follow next_cursor up to this many pages per input. 1 = first page only.

## Actor input object example

```json
{
  "endpoint": "/google-maps/v1/directions",
  "params": {
    "origin": "40.7580,-73.9855",
    "destination": "JFK Airport"
  },
  "batch": [],
  "maxPages": 1
}
```

# Actor output Schema

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

One row per call: endpoint, params, status, credits_used and the data.

# 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 = {
    "endpoint": "/google-maps/v1/directions",
    "params": {
        "origin": "40.7580,-73.9855",
        "destination": "JFK Airport"
    },
    "batch": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("apish/google-maps-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 = {
    "endpoint": "/google-maps/v1/directions",
    "params": {
        "origin": "40.7580,-73.9855",
        "destination": "JFK Airport",
    },
    "batch": [],
}

# Run the Actor and wait for it to finish
run = client.actor("apish/google-maps-api").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 '{
  "endpoint": "/google-maps/v1/directions",
  "params": {
    "origin": "40.7580,-73.9855",
    "destination": "JFK Airport"
  },
  "batch": []
}' |
apify call apish/google-maps-api --silent --output-dataset

```

## MCP server setup

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

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/YBhYVgxfle2Ak8P86/builds/cS6NwmLcSOa7GuaAK/openapi.json
