Places API(新版)提供了更出色的性能和新的定价模式,因此值得更新使用 Places API 的应用。如需详细了解如何比较功能,请参阅选择 API。
通过本指南,您可以了解 Places API(新版)与 Places API 之间的主要区别,以及如何处理必要的更改。
迁移的结算最佳实践
warning_amber
如果您的 API 用量足够高,达到了第二层级的价格,则适用此指南。迁移到较新版本的 API 时,您还需要按其他 SKU 付费。为避免在过渡月份增加费用,我们建议您尽可能在月初切换到正式版中的新 API。这样可以确保您在迁移月份达到最具成本效益的每月价格层级。如需了解价格层级,请参阅价格页面和价格常见问题解答。
启用 Places API(新)
如需使用 Places API(新版)的功能,您必须先在 Google Cloud 项目中启用 Places API(新版)。如需了解详情,请参阅设置您的 Google Cloud 项目。
然后,您必须确保已将 Places API(新)添加到应用使用的 API 密钥。如需了解详情,请参阅使用 API 密钥。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-22。"],[[["Places API (New) offers enhanced performance and a revised pricing structure, prompting updates for applications utilizing the Places API."],["To optimize billing, it's recommended to transition to the new APIs at the start of a month to leverage cost-effective pricing tiers."],["Enabling Places API (New) requires activation in your Google Cloud project and potentially adding it to your API key."],["Key changes encompass support for API keys and OAuth, JSON-only responses, mandatory field masking for certain APIs, and adjusted response formats."],["API-specific migration guides are available for Nearby Search, Text Search, Place Details, Place Photo, and Autocomplete, detailing necessary adjustments."]]],[]]