Autocomplete Place Predictions
curl --request POST \
--url https://api.aisa.one/apis/v1/google-maps/autocomplete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "pizza"
}
'import requests
url = "https://api.aisa.one/apis/v1/google-maps/autocomplete"
payload = { "input": "pizza" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: 'pizza'})
};
fetch('https://api.aisa.one/apis/v1/google-maps/autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/google-maps/autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => 'pizza'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/google-maps/autocomplete"
payload := strings.NewReader("{\n \"input\": \"pizza\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/google-maps/autocomplete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"pizza\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/google-maps/autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"pizza\"\n}"
response = http.request(request)
puts response.read_body{
"suggestions": [
{
"placePrediction": {
"distanceMeters": 123,
"place": "<string>",
"placeId": "<string>",
"structuredFormat": {
"mainText": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
},
"secondaryText": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
}
},
"text": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
},
"types": [
"<string>"
]
},
"queryPrediction": {
"text": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
}
}
}
]
}Google 地图
Autocomplete Place Predictions
Autocomplete Place Predictions
POST
https://api.aisa.one
/
apis
/
v1
/
google-maps
/
autocomplete
Autocomplete Place Predictions
curl --request POST \
--url https://api.aisa.one/apis/v1/google-maps/autocomplete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "pizza"
}
'import requests
url = "https://api.aisa.one/apis/v1/google-maps/autocomplete"
payload = { "input": "pizza" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: 'pizza'})
};
fetch('https://api.aisa.one/apis/v1/google-maps/autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/google-maps/autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => 'pizza'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/google-maps/autocomplete"
payload := strings.NewReader("{\n \"input\": \"pizza\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/google-maps/autocomplete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"pizza\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/google-maps/autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"pizza\"\n}"
response = http.request(request)
puts response.read_body{
"suggestions": [
{
"placePrediction": {
"distanceMeters": 123,
"place": "<string>",
"placeId": "<string>",
"structuredFormat": {
"mainText": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
},
"secondaryText": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
}
},
"text": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
},
"types": [
"<string>"
]
},
"queryPrediction": {
"text": {
"matches": [
{
"endOffset": 123,
"startOffset": 123
}
],
"text": "<string>"
}
}
}
]
}请求规范
- 方法与路径: POST /apis/v1/google-maps/autocomplete
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/google-maps/autocomplete
{
"operationId": "google-maps.autocomplete",
"method": "POST",
"path": "/apis/v1/google-maps/autocomplete",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"includePureServiceAreaBusinesses": {
"description": "Includes businesses without physical locations (default: false).",
"type": "boolean"
},
"includeQueryPredictions": {
"description": "Includes query predictions in response for text searches (default: false).",
"type": "boolean"
},
"includedPrimaryTypes": {
"description": "Restricts results to up to five specified primary types (e.g., 'restaurant', 'cafe').",
"examples": [
[
"restaurant"
],
[
"cafe",
"bakery"
]
],
"items": {
"type": "string"
},
"type": "array"
},
"includedRegionCodes": {
"description": "Up to 15 two-character country codes (ISO 3166-1 Alpha-2) to restrict results. Query predictions unavailable when this is set.",
"examples": [
[
"US"
],
[
"US",
"CA",
"MX"
]
],
"items": {
"type": "string"
},
"type": "array"
},
"input": {
"description": "Text string to search for place predictions. Can be full words, substrings, place names, addresses, or plus codes. Must be non-empty.",
"examples": [
"pizza",
"123 Main",
"Eiffel"
],
"type": "string"
},
"inputOffset": {
"description": "Zero-based Unicode character offset of cursor position in the input string.",
"examples": [
5,
10
],
"minimum": 0,
"type": "integer"
},
"languageCode": {
"description": "Preferred language for results using IETF BCP-47 language codes (e.g., 'en-US', 'es-ES').",
"examples": [
"en-US",
"es-ES",
"fr-FR"
],
"type": "string"
},
"locationBias": {
"additionalProperties": false,
"description": "Area to bias search results toward.",
"properties": {
"circle": {
"additionalProperties": false,
"description": "Circular area for location bias or restriction.",
"properties": {
"center": {
"additionalProperties": {
"type": "number"
},
"description": "Center point with latitude and longitude coordinates.",
"examples": [
{
"latitude": 37.7749,
"longitude": -122.4194
}
],
"type": "object"
},
"radius": {
"description": "Radius in meters (0.0-50000.0 for bias, must exceed 0.0 for restriction).",
"examples": [
1000,
5000
],
"maximum": 50000,
"minimum": 0,
"type": "number"
}
},
"required": [
"center",
"radius"
],
"type": "object"
},
"rectangle": {
"additionalProperties": false,
"description": "Rectangular area for location bias or restriction.",
"properties": {
"high": {
"additionalProperties": {
"type": "number"
},
"description": "Northeast corner with latitude and longitude coordinates.",
"examples": [
{
"latitude": 37.8,
"longitude": -122.4
}
],
"type": "object"
},
"low": {
"additionalProperties": {
"type": "number"
},
"description": "Southwest corner with latitude and longitude coordinates.",
"examples": [
{
"latitude": 37.7,
"longitude": -122.5
}
],
"type": "object"
}
},
"required": [
"low",
"high"
],
"type": "object"
}
},
"type": "object"
},
"locationRestriction": {
"additionalProperties": false,
"description": "Area to restrict search results within.",
"properties": {
"circle": {
"additionalProperties": false,
"description": "Circular area for location bias or restriction.",
"properties": {
"center": {
"additionalProperties": {
"type": "number"
},
"description": "Center point with latitude and longitude coordinates.",
"examples": [
{
"latitude": 37.7749,
"longitude": -122.4194
}
],
"type": "object"
},
"radius": {
"description": "Radius in meters (0.0-50000.0 for bias, must exceed 0.0 for restriction).",
"examples": [
1000,
5000
],
"maximum": 50000,
"minimum": 0,
"type": "number"
}
},
"required": [
"center",
"radius"
],
"type": "object"
},
"rectangle": {
"additionalProperties": false,
"description": "Rectangular area for location bias or restriction.",
"properties": {
"high": {
"additionalProperties": {
"type": "number"
},
"description": "Northeast corner with latitude and longitude coordinates.",
"examples": [
{
"latitude": 37.8,
"longitude": -122.4
}
],
"type": "object"
},
"low": {
"additionalProperties": {
"type": "number"
},
"description": "Southwest corner with latitude and longitude coordinates.",
"examples": [
{
"latitude": 37.7,
"longitude": -122.5
}
],
"type": "object"
}
},
"required": [
"low",
"high"
],
"type": "object"
}
},
"type": "object"
},
"origin": {
"additionalProperties": false,
"description": "Latitude/longitude point for distance calculations.",
"properties": {
"latitude": {
"description": "Latitude coordinate.",
"examples": [
37.7749
],
"maximum": 90,
"minimum": -90,
"type": "number"
},
"longitude": {
"description": "Longitude coordinate.",
"examples": [
-122.4194
],
"maximum": 180,
"minimum": -180,
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
},
"regionCode": {
"description": "Region code in ccTLD format for formatting responses (e.g., 'us', 'br').",
"examples": [
"us",
"gb",
"fr"
],
"type": "string"
},
"sessionToken": {
"description": "User-generated string grouping calls into sessions for billing purposes.",
"examples": [
"session_123",
"user_abc_session"
],
"type": "string"
}
},
"required": [
"input"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.00313 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json