Documentation

  • Service Credentials
  • /
  • Google Play

To obtain the KEY_FILE (a JSON key file) for accessing the Google Play Developer API, you’ll need to create a service account and generate a key in the Google Cloud Platform (GCP), then link this service account to your Google Play Developer account. Here’s a step-by-step guide:

 

1. Create a Google Cloud Project (if it doesn’t already exist)

If you don’t already have a Google Cloud Platform project, you’ll need to create one:

  • Go to the Google Cloud Console.
  • Click on the project dropdown at the top of the page next to “Google Cloud Platform.”
  • Click on “New Project” at the top-right of the modal that appears.
  • Enter a project name and select a billing account if prompted. Click “Create.”

 

2. Create a Service Account

  • In the Google Cloud Console, make sure your new project is selected.
  • Navigate to “IAM & Admin” > “Service Accounts” in the left-hand menu.
  • Click on “Create Service Account.”
  • Enter a service account name and description, then click “Create.”
  • Assign the service account a role. For accessing the Google Play Developer API, a role such as “Project > Editor” can be used, but for better security practice, you might want to use a more restrictive custom role that has only the permissions needed.
  • Click “Done” to finish creating the service account.

 

3. Create a Key for the Service Account

  • Find the service account you just created in the list of service accounts.
  • Click on the service account name to go to its details page.
  • Go to the “Keys” tab.
  • Click on “Add Key” > “Create new key.”
  • Choose “JSON” as the key type and click “Create.”
  • The JSON key file will be automatically downloaded to your computer. This is your KEY_FILE that you will use to authenticate your requests to the Google Play Developer API.

 

4. Link Service Account to Google Play Developer Account

  • Go to Google Cloud Console > APIs & Services
  • Search for “Google Play Android Developer API”.
  • Enable
  • Go to Google Play Console > Users & Permissions > Invite user > Enter service account email created at step 2.
  • Add App > Select your app.
  • Go to “Financial data” and select “View Financial data” and “Manage orders and subscriptions”
  • Click “Invite User” to finish linking the service account.
  • Wait at least 24 hours for Google to proceed the request.