服務帳戶必須在安全環境中使用,例如您的伺服器。
服務帳戶憑證必須以安全的方式管理,以免
洩漏給未獲授權使用此 API 的人。
若您要代表 API 存取 API,應使用 OAuth 用戶端 ID
個別使用者的特性舉例來說,如果網站需要存取
網路用戶端的 Google Play Developer API 時,您可以使用
用戶端 ID。系統將改以他們的 Google 帳戶驗證使用者
服務帳戶這可讓您代表使用者執行 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"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eYou need to set up API access in the Google Play Console and Google Cloud Console to use the Google Play Developer API.\u003c/p\u003e\n"],["\u003cp\u003eA service account is generally recommended for accessing the API, while OAuth clients are used for individual user access.\u003c/p\u003e\n"],["\u003cp\u003eGrant the service account necessary permissions in the Google Play Console to enable API functionality.\u003c/p\u003e\n"],["\u003cp\u003eTo find your Developer ID, check the URL of any page in the Google Play Console, such as the API access page.\u003c/p\u003e\n"],["\u003cp\u003eExplore specialized APIs and client libraries for specific tasks and programmatic access.\u003c/p\u003e\n"]]],["To access the Google Play Developer API, begin by creating a Google Cloud Project and enabling the Google Play Developer API within it. Then, configure access via a service account for secure server-side access, or an OAuth client for individual user access. For service accounts, create one in Google Cloud Console and invite it as a user in Google Play Console, granting necessary permissions. For OAuth clients, create an OAuth consent screen and then an OAuth client ID. Finally, you can retrieve your unique developer id from the Google Play Console URL.\n"],null,["# Getting Started\n\n| **Note:** You no longer need to link your developer account to a Google Cloud Project in order to access the Google Play Developer API.\n\nBefore you can start making API calls, you need to set up API access to your\nGoogle Play Developer Account. This involves changes in both the\nGoogle Play Console and Google Cloud Console. The following instructions\nexplain the steps needed to start using the Google Play Developer API.\n\n1. Create a Google Cloud Project.\n2. Enable the Google Play Developer API for your Google Cloud Project.\n3. Set up a service account with appropriate Google Play Console permissions to access the Google Play Developer API.\n\nCreate a Google Cloud Project\n-----------------------------\n\nYou can skip this step if you already have a Google Cloud Project\nyou want to use.\n\nCreate a project in the\n[Google Cloud Console](https://console.cloud.google.com/projectcreate).\n\nFor further information on Google Cloud Projects,\nrefer to [Creating and managing projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\nEnable the API\n--------------\n\nOnce you have set up the Google Cloud Project, you need to enable\nthe Google Play Developer API for this project.\n\nTo enable Google Play Developer API:\n\n1. Go to the [Google Play Developer API page](https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/) in Google Cloud Console.\n2. Click **Enable**.\n\nConfigure OAuth and Service Accounts\n------------------------------------\n\nYou need to configure access to the Google Play Developer API with an OAuth client or\na service account. In most cases, you should use a service account\nto access the API.\n\nService accounts must be used in a secure environment, such as your server.\nThe service account credentials need to be securely managed so they are not\nrevealed to anyone that is not authorized to use the API.\n\nThe OAuth Client ID should be used if you need to access the API on behalf\nof an individual user. For example, if your website needs to access the\nGoogle Play Developer API from the web client on behalf of the user, you can use the\nClient ID. The user will be authenticated with their Google account instead\nof the service account. This allows you to make API calls on behalf of a user\nwithout compromising service account credentials.\n\n- Service account: A secure software service will access the API (most common)\n- OAuth clients: A user will access the API\n\n### Use a service account\n\nYou can create a [service account](/accounts/docs/OAuth2ServiceAccount) from\nthe Google Play Console.\n\n1. In the Google Cloud Console go to [Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).\n2. Click **Create service account** and follow the steps.\n3. Go to the [Users \\& Permissions](https://play.google.com/console/users-and-permissions) page on the Google Play Console.\n4. Click **Invite new users**.\n5. Put an email address for your service account in the email address\n field and grant the necessary rights to perform actions.\n\n To use the Google Play Billing APIs, you must grant the following permissions:\n - *View financial data, orders, and cancellation survey responses*\n - *Manage orders and subscriptions*\n6. Click **Invite user**.\n\nAt this point, you should be able to access the Google Play Developer API through the\nservice account. For more information, see [Using OAuth 2.0 for Server to Server\nApplications](/accounts/docs/OAuth2ServiceAccount).\n\n### Use OAuth clients\n\nYou can allow users to perform actions using the API under their own credentials\nusing an [OAuth](https://developers.google.com/accounts/docs/OAuth2) client.\nA user's actions are limited to those permitted via the\n[Users and permissions](https://play.google.com/console/users-and-permissions)\npage on the Google Play Console.\n\nBefore creating OAuth clients, you need to configure branding information for\nyour product. For more information, see [Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615).\n\n1. In the Google Cloud Console, go to [OAuth consent screen page](https://console.cloud.google.com/apis/credentials/consent).\n2. Follow the steps to create OAuth consent screen.\n\nTo create an OAuth client:\n\n1. In the Google Cloud Console, go to [Credentials](https://console.cloud.google.com/apis/credentials).\n2. Click Create Credentials \\\u003e OAuth client ID.\n3. Choose your application type and follow the instructions.\n\nAdditional information\n----------------------\n\nUse the following tips and tricks to help you get started with API usage on\nGoogle Play.\n\n### Obtain your Developer ID\n\nSome APIs require you to provide a Google Play Console Developer ID. This\nis a long number that was assigned when your Google Play Developer Account\nwas created. Your Developer ID can be found in the URL of almost any page on the\nGoogle Play Console, such as the\n[API access](https://play.google.com/console/api-access) page.\n\nFor example, consider the Google Play Console URL: \n\n https://play.google.com/console/developers/1234567890123456789/api-access\n\nIn the URL above, the Developer ID would be `1234567890123456789`.\n\n**Note:** If an app is transferred from one Google Play Developer Account\nto another, the Developer ID associated with that app will change. This means\nthat after the transfer completes, you must use the Developer ID for the new\nGoogle Play Developer Account account in API calls for that app.\n\n### Specialized APIs\n\nThe Google Play Developer API contains several specialized APIs that allow\nyou to perform specific types of analysis on your app:\n\n[Reply to Reviews API](/android-publisher/reply-to-reviews)\n: Allows you to view user feedback for your app and reply to this feedback.\n\n[Voided Purchases API](/android-publisher/voided-purchases)\n: Allows you to revoke access to in-app products associated with purchases that\n a user has voided.\n\n### Client libraries\n\nWe have provided client libraries you can use to programmatically\naccess the REST APIs. For more information, see [Client Libraries and Code\nSamples](/android-publisher/libraries)."]]