You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Android中使用Google Place API实现自定义地点类型搜索

Google Places API自定义类型支持与细分检索方案

Hey there! Let's tackle your two questions about Google Places API step by step:

1. 是否支持输入自定义类型?

Short answer: No — Google Places API does not support custom values for the type parameter. The type field only accepts values from Google's official preset list of place types (like store, restaurant, etc.). If you input a custom string here, the API will either ignore it entirely or return results that don't match your intended filter.

2. 如何获取汽车配件店这类细分结果?

You have two reliable ways to get targeted results for auto parts stores, depending on your needs:

方法一:使用官方预设的细分类型

Google actually provides a specific preset type for auto parts stores: auto_parts_store. Using this directly will give you the most accurate and relevant results, since it's tailored exactly to that category.

Here's how your request would look:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=lat,lng&radius=10000&type=auto_parts_store&sensor=true&key=YOUR_API_KEY

方法二:结合keyword参数补充筛选

If you need to narrow results further (e.g., looking for specialty auto parts stores) or if there's no exact preset type for your target category, pair a broad type (like store) with the keyword parameter to specify your niche.

For example, to find high-performance auto parts stores:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=lat,lng&radius=10000&type=store&keyword=高性能汽车配件&sensor=true&key=YOUR_API_KEY

A quick note: Always prioritize using an official preset type if it exists — it's far more efficient than relying solely on keywords, as it leverages Google's categorized place data directly.

内容的提问来源于stack exchange,提问作者Ashwin Nirmale

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 06:38:52