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 / chamada bem-sucedida
ID público: data.maps.search · Versão 1
Preços
USD 0.001750 / chamada bem-sucedida
Início rápido
Busque esta ferramenta com sua chave API e inspecione o provider e o endpoint retornados antes de executar.
Defina GLOOP_API_BASE com o endereço da API e GLOOP_API_KEY com sua chave do servidor.
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());Documentação da API de ferramentas · POST /v1/inspectEsquema de entrada
{
"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"
}Esquema de saída
{
"type": "object"
}