# Search places

Search Google Maps for places by keyword, optional location, and viewport bias. Returns distinct places with available identity, contact, rating, category, and coordinate fields. Country biases results; it is not a strict country filter.

- Platform: [Google Maps](https://docs.upscrape.com/docs/platforms/googlemaps)
- Capability ID: `googlemaps.search`
- Cost: 1 credit per request
- Maximum runtime: 120 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "limit": 20,
    "location": "San Francisco, CA",
    "query": "coffee shops"
  },
  "capability": "googlemaps.search"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | `string` | No | Two-letter country code for the gl parameter (default 'us'). Default: `us`. |
| `lang` | `string` | No | Language code such as 'en' or 'en-US' (default 'en'). Default: `en`. |
| `lat` | `number` | No | Latitude for geo-bias (use with lng). From -90 to 90. |
| `limit` | `integer` | No | Max records to return (default 60, max 120). From 1 to 120. Default: `60`. |
| `lng` | `number` | No | Longitude for geo-bias (use with lat). From -180 to 180. |
| `location` | `string` | No | Location bias appended to query, e.g. 'New York, NY'. |
| `query` | `string` | Yes | Search query, e.g. 'pizza restaurants'. |
| `zoom` | `integer` | No | Map zoom level (default 14; higher = tighter area, lower = wider). From 10 to 18. |

### Example input

```json
{
  "limit": 20,
  "location": "San Francisco, CA",
  "query": "coffee shops"
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "items": [
    {
      "address": "The Coffee Movement, 1737 Balboa St, San Francisco, CA 94121",
      "cid": "2726196137705445702",
      "feature_id": "0x808587fb77f5f64d:0x25d564f177f99946",
      "lat": 37.7764721,
      "lng": -122.47782249999999,
      "maps_url": "https://www.google.com/maps/place/?q=place_id:ChIJTfb1d_uHhYARRpn5d_Fk1SU",
      "name": "The Coffee Movement",
      "place_id": "ChIJTfb1d_uHhYARRpn5d_Fk1SU",
      "rating": 4.8,
      "types": [
        "Coffee shop"
      ],
      "website": "https://www.thecoffeemovement.com/"
    },
    {
      "address": "The Coffee Berry SF, 1410 Lombard St, San Francisco, CA 94123",
      "cid": "5181132708478222499",
      "feature_id": "0x80858135f0db680b:0x47e714bf5f0080a3",
      "lat": 37.8014124,
      "lng": -122.4249979,
      "maps_url": "https://www.google.com/maps/place/?q=place_id:ChIJC2jb8DWBhYARo4AAX78U50c",
      "name": "The Coffee Berry SF",
      "phone": "[redacted:phone]",
      "place_id": "ChIJC2jb8DWBhYARo4AAX78U50c",
      "rating": 4.9,
      "types": [
        "Coffee shop"
      ],
      "website": "http://thecoffeeberrysf.com/"
    },
    {
      "address": "Saint Frank Coffee, 2340 Polk St, San Francisco, CA 94109",
      "cid": "1904023059391355563",
      "feature_id": "0x808580e84308f899:0x1a6c72e2732c9aab",
      "lat": 37.7984797,
      "lng": -122.4220775,
      "maps_url": "https://www.google.com/maps/place/?q=place_id:ChIJmfgIQ-iAhYARq5osc-JybBo",
      "name": "Saint Frank Coffee",
      "phone": "[redacted:phone]",
      "place_id": "ChIJmfgIQ-iAhYARq5osc-JybBo",
      "rating": 4.5,
      "types": [
        "Coffee shop",
        "Cafe"
      ],
      "website": "http://www.saintfrankcoffee.com/"
    }
  ],
  "summary": {
    "has_more": true,
    "query": "coffee shops",
    "total_items": 20
  }
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 3 items |
| `items` | `array` | 3 items |
| `summary` | `object` | 3 fields |
| `summary.has_more` | `boolean` | true |
| `summary.query` | `string` | coffee shops |
| `summary.total_items` | `integer` | 20 |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
