Google Maps Search API

Search Google Maps for places matching a query and location: up to 20 normalized place records with ratings, addresses, and contact basics per request.

USD 0.001750 / appel réussi

ID public: data.maps.search · Version 1

Tarifs

USD 0.001750 / appel réussi

Démarrage rapide

Recherchez cet outil avec votre clé API, puis inspectez le provider et le endpoint renvoyés avant de lancer une exécution.

Définissez GLOOP_API_BASE sur votre adresse API et GLOOP_API_KEY sur votre clé côté serveur.

curl

curl --fail-with-body "${GLOOP_API_BASE%/}/v1/discover" \
  -H "Authorization: Bearer $GLOOP_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "limit": 5,
  "query": "Google Maps Search"
}'

Python

import os, json, urllib.request

url = os.environ['GLOOP_API_BASE'].rstrip('/') + "/v1/discover"
headers = {'Authorization': 'Bearer ' + os.environ['GLOOP_API_KEY']}
headers['Content-Type'] = 'application/json'
data = "{\n  \"limit\": 5,\n  \"query\": \"Google Maps Search\"\n}".encode('utf-8')
request = urllib.request.Request(url, data=data, headers=headers)
with urllib.request.urlopen(request) as response:
    print(json.load(response))

Node.js

const url = process.env.GLOOP_API_BASE.replace(/\/$/, '') + "/v1/discover";
const headers = { Authorization: `Bearer ${process.env.GLOOP_API_KEY}` };
headers['Content-Type'] = 'application/json';
const response = await fetch(url, { method: 'POST', headers, body: JSON.stringify({
  "limit": 5,
  "query": "Google Maps Search"
}) });
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
Documentation API des outils · POST /v1/inspect

Schéma d'entrée

{
  "additionalProperties": false,
  "properties": {
    "categoryFilterWords": {
      "description": "Optional list of Google Maps place-category names to keep; results are limited to places whose category matches one of these. Use lowercase category names as shown on Google Maps (e.g. [\"coffee shop\", \"restaurant\"]). Omit to include all categories and stay on the cheapest price; a category filter routes to a dearer source.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "language": {
      "description": "Two-letter language code for the results (e.g. en).",
      "type": "string"
    },
    "limit": {
      "description": "Maximum number of results to return (1-20, default 20). Pricing depends on the selected provider and may be flat per request.",
      "maximum": 20,
      "minimum": 1,
      "type": "integer"
    },
    "location": {
      "description": "Free-text location to search in, ideally city plus country (e.g. Austin, USA).",
      "minLength": 1,
      "type": "string"
    },
    "placeMinimumStars": {
      "description": "Only return places with at least this average rating: two (2+), twoAndHalf (2.5+), three (3+), threeAndHalf (3.5+), four (4+), or fourAndHalf (4.5+). Places with no reviews are excluded. Omit this field to stay on the cheapest price; a rating floor routes to a dearer source.",
      "enum": [
        "two",
        "twoAndHalf",
        "three",
        "threeAndHalf",
        "four",
        "fourAndHalf"
      ],
      "type": "string"
    },
    "query": {
      "description": "What you would type in the Google Maps search bar (e.g. coffee shop).",
      "type": "string"
    },
    "website": {
      "description": "Filter places by whether they list a website: allPlaces (default), withWebsite (only places that have a website), or withoutWebsite (only places without one). Omit this field, or send allPlaces, to stay on the cheapest price; withWebsite and withoutWebsite route to a dearer source.",
      "enum": [
        "allPlaces",
        "withWebsite",
        "withoutWebsite"
      ],
      "type": "string"
    }
  },
  "required": [
    "query",
    "location"
  ],
  "title": "Google Maps search input",
  "type": "object"
}

Schéma de sortie

{
  "type": "object"
}

Outils de la même catégorie