首页 > 解决方案 > Google Places Find_Place API 请求不返回商家名称

问题描述

指定商家地址时,此 Python 脚本不返回商家名称。我希望公司名称“大力水手”会被退回。为什么不返回公司名称?“fields= ['name']”参数有问题吗?

import googlemaps
import pprint
import time
import os

API_KEY = os.getenv('API_KEY')

gmaps = googlemaps.Client(key = API_KEY)

name_result = gmaps.find_place(input=”5949 NE Martin Luther King Jr Blvd, Portland, OR 97211”, input_type= “textquery”, fields= ['name'])
pprint.pprint(name_result)
{'candidates': [{'name': '5949 NE Martin Luther King Jr Blvd'}], 'status': 'OK'}

标签: pythongoogle-places-api

解决方案


推荐阅读