Google Play Console programatically download

Hi Team,

I have my google play account set up and I am trying to programmatically download the reports (stats/Financials) using Azure data factory. 
The "Copy Cloud Storage URI" provides the link to the storage bucket(Starts with "pubsite_") where the data is stored.
Looks like the csv files here are stored in some compressed format. When I copy the file through Azure data factory it copies a blank file. The file with size 30KB when I download in my mac becomes 500KB and I can see all the data.
My question here, Is there any compression mechanism that is used in storage of these reports in Google cloud storage?

Regards

3 REPLIES 3

Reports are stored as CSV files as shown in the documentation:

Reports are available from Google Cloud Storage. Reports are generated daily and accumulated in monthly CSV files.

Tip: If you want to import your reports from Google Cloud Storage into BigQuery, you need to convert the CSV files from UTF-16 to UTF-8.

To download the reports, you could follow this guide:

Download reports using a client library and service account

Step 1: Create a service account

  1. Open Google Developers Console.
  2. If you already have a project, use the drop-down to select a project. If you don't have a project listed or want to create a new one, click Create project.
  3. Select the Menu icon Menu icon > Permissions > Service accounts > Create service account.
  4. Follow the on-screen instructions and select Create.
  5. Copy the email address listed.
    • Example: accountName@project.iam.gserviceaccount.com

Step 2: Add the service account on Play Console

  1. Open Play Console.
  2. Select Settings Settings> User accounts & rights > Invite new user.
  3. Paste or type the email address associated with your service account.
  4. Based on the types of reports needed, select permissions.
  5. Click Add user. Your service account will be added to your account.

Step 3: Fetch reports using an API call

  1. Install the API client library for your preferred code language.
  2. Configure the code performing the API call to use OAuth2 server-to-server authentication and to request permission to the OAuth2 scope (https://www.googleapis.com/auth/devstorage.read_only).
  3. Issue authenticated API calls to fetch reports.

This Microsoft article shows how to Copy data from Google Cloud Storage using Azure Data Factory

@cristianrm ,
Thank you for the response. I followed step 1 and step 2.
Created the service account and gave it access to the new project I created in Googe Developers console.
I am still not able to see the reports in the new project I have created. Should I create a bucket in the project? If so, How do I make sure the reports land in that bucket?
Once the reports are there in the new project only I can extract them from the azure data factory.

I guess, I need a little more clarity on this.

regards,



To get your reports bucket, you can follow the documentation:

Find your Google Cloud Storage URI

You can copy your Google Cloud Storage URI by clicking the Copy Cloud Storage URI button next to the corresponding section header on the Download reports pages.

Your Cloud Storage URI begins with pubsite_prod_rev (e.g., pubsite_prod_rev_01234567890987654321).

Also, as shown in the steps on this StackOverflow answer:

Here are the complete instructions:

  1. Go to Download reports page
  2. Under "Select an application," type and select your app's name.
  3. At the bottom of the page there should be a Direct report URIs Example:
     shell gs://pubsite_prod_58148478376/reviews 
    
    Your Cloud Storage Bucket ID should be as follows:
     pubsite_prod_58148478376
    

Note: If you just uploaded your first application, it may take a while before the report is generated and visible.

Also remember that the reports are stored in a private Google Cloud Storage bucket for your Google Play Developer account.

See also: