這項產品或功能為舊版。如要進一步瞭解舊版狀態,請參閱「
舊版產品和功能」。如要改用 Places API (新版),請參閱
遷移指南。
Places API (舊版) 總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
簡介
Places API 可讓您使用文字字串或依據鄰近程度,搜尋及擷取各種地點類型的資訊。Places API (舊版) 是 Places API (新版) 的舊版。
下表列出這兩個 API 的對應版本。請參閱本指南,瞭解兩者的主要差異,並遷移至 Places API (新版)。
遷移至新版 API
如要遷移至新版 API,請參閱下列遷移指南:
Places API (新版) 新增的主要功能
本節將介紹 Places API (新版) 新增的主要功能。
Places API (新版) 是在 Google Cloud 的服務基礎架構上實作,這項實作作業可帶來更安全可靠的平台,並提供 OAuth 等強化安全選項。這項標準 API 設計可讓各個 API 保持一致,進而提升使用 Places API (新版) 開發的效率。
Places API (新版) 效能更佳,因此值得取代使用現有 Places API 的應用程式。
簡化計費模式
Places API (新版) 簡化了定價方式,您只需為使用的資料付費。簡化定價是透過欄位遮罩實作。
使用 Place Details (新版)、Nearby Search (新版) 和 Text Search (新版) 時,您可以透過欄位遮罩控制要在回應中傳回的欄位清單。這樣一來,系統只會針對您要求的資料向您收費。使用欄位遮蓋是良好的設計做法,可確保您不會要求不必要的資料,有助於避免不必要的處理時間和帳單費用。
地點的回覆資料一致
使用舊版 API 時,Place Details (舊版)、Nearby Search (舊版) 和 Text Search (舊版) API 會針對地點傳回不同的回應資料。Places API (新版) 會將回應標準化,因此這些 API 都會傳回相同地點的資料。
擴展地點類型
API 回應現在可以包含地點的主要類型。每個地點都可以有一個類型值,指定為地點的主要類型,如表 A 所示。
新版 API 也包含幾種新類型。您可以在 Nearby Search (新版) 和 Text Search (新版) 的搜尋中使用這些新類型和現有類型。所有新類型都包含在 Table
A 中。
動態地點資料
Places API (新版) 支援動態回應資料,例如電動車充電站的可用性,或是加油站的最新油價。使用這些回應欄位建立動態使用者體驗。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],null,["# Places API (Legacy) overview\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nIntroduction\n------------\n\nThe Places API lets you search for and retrieve information for a variety of\nplace types using a text string or by proximity. Places API (Legacy) is the legacy\nversion of\n[Places API (New)](/maps/documentation/places/web-service/op-overview).\n\nThe following table lists the corresponding versions of both APIs. Use this\nguide to understand the key differences between the two and migrate to\nPlaces API (New).\n\n| Places API (Legacy) | Places API (New) | Notes |\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Find Place (Legacy)](/maps/documentation/places/web-service/search-find-place) | [Text Search (New)](/maps/documentation/places/web-service/text-search) | There is no new version of Find Place (Legacy). Text Search (New) has replaced it. |\n| [Nearby Search (Legacy)](/maps/documentation/places/web-service/search-nearby) | [Nearby Search (New)](/maps/documentation/places/web-service/nearby-search) | All requests using the legacy API that include a text query should use [Text Search (New)](/maps/documentation/places/web-service/text-search) because Nearby Search (New) does not support text input. |\n| [Text Search (Legacy)](/maps/documentation/places/web-service/search-text) | [Text Search (New)](/maps/documentation/places/web-service/text-search) | |\n| [Place Details (Legacy)](/maps/documentation/places/web-service/details) | [Place Details (New)](/maps/documentation/places/web-service/place-details) | |\n| [Place Photos (Legacy)](/maps/documentation/places/web-service/photos) | [Place Photos (New)](/maps/documentation/places/web-service/place-photos) | |\n| [Place Autocomplete (Legacy)](/maps/documentation/places/web-service/autocomplete) | [Autocomplete (New)](/maps/documentation/places/web-service/place-autocomplete) | |\n| [Query Autocomplete (Legacy)](/maps/documentation/places/web-service/query) | [Autocomplete (New)](/maps/documentation/places/web-service/place-autocomplete) | Capabilities added to Autocomplete (New). |\n\nMigrate to the new APIs\n-----------------------\n\nTo migrate to the new APIs, see the following migration guides:\n\n- [Migrate to Nearby Search (New)](/maps/documentation/places/web-service/migrate-nearby)\n- [Migrate to Text Search (New)](/maps/documentation/places/web-service/migrate-text)\n- [Migrate to Place Details (New)](/maps/documentation/places/web-service/migrate-details)\n- [Migrate to Place Photos (New)](/maps/documentation/places/web-service/migrate-photo)\n- [Migrate to Autocomplete (New)](/maps/documentation/places/web-service/migrate-autocomplete)\n\nKey features added to Places API (New)\n--------------------------------------\n\nThis section covers key features added to Places API (New).\n\n### Implemented on the Google Cloud standard platform\n\nPlaces API (New) is implemented on the [service\ninfrastructure](https://cloud.google.com/service-infrastructure/docs/overview)\non Google Cloud. This implementation brings with it a more secure and trusted\nplatform with enhanced security options like\n[OAuth](/maps/documentation/places/web-service/oauth-token). This standard API\ndesign brings a level of consistency across the APIs that improve the efficiency\nof development with Places API (New).\n\n### Improved performance\n\nPlaces API (New) provides improved performance, making it worthwhile to\nreplace apps that use the existing Places API.\n\n### Simplified pricing\n\nPricing is simplified with Places API (New) so that you only pay for the\ndata you use. Simplified pricing is implemented using a [field\nmask](/maps/documentation/places/web-service/choose-fields).\n\nWith Place Details (New), Nearby Search (New), and\nText Search (New) you use the field mask to control the list of fields to\nreturn in the response. You are then only billed for the data requested. Using\nfield masking is a good design practice to ensure that you don't request\nunnecessary data, which helps to avoid unnecessary processing time and billing\ncharges.\n\n### Consistent response data for a place\n\nWith the legacy APIs, the Place Details (Legacy), Nearby Search (Legacy), and\nText Search (Legacy) APIs returned different response data for a place.\nPlaces API (New) standardizes the response so these APIs all return the\nsame data for a place.\n\n### Expanded place types\n\nThe API response can now contain a place's *primary type* . Every place can have\na single type value that is specified as the place's primary type, as listed in\n[Table A](/maps/documentation/places/web-service/place-types#table-a).\n\nThe new API also includes several new types. You can use these new types, and\nthe existing types, in a search with Nearby Search (New)\nand Text Search (New). The new types are all included in [Table\nA](/maps/documentation/places/web-service/place-types#table-a).\n\n### Dynamic place data\n\nPlaces API (New) supports dynamic response data, such as the availability\nof an EV charging station or the latest fuel prices for a gas station. Use these\nresponse fields to create dynamic user experiences."]]