npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-playstore-stats-viewer

v1.0.34

Published

View your app basic statistics like installs, uninstalls and other basic events -> https://support.google.com/googleplay/android-developer/?p=stats_export

Downloads

20

Readme

google-playstore-stats-viewer

View basic stats like installs/downloads, uninstall, active users events

Maintenance GPLv3 license Generic badge PRs Welcome npm

forthebadge forthebadge forthebadge forthebadge forthebadge forthebadge forthebadge forthebadge

SUPPORT THE WORK & DEV

GitHub stars   GitHub stars   GitHub followers

Authentication

Steps to get your service account file from Google Cloud Platform

  • Go to your GCP Project https://console.cloud.google.com/iam-admin/serviceaccounts (Create gcp project if you don't have one)
  • Create service account (In 3rd step you will get option to create the key), store that key, that will be used access your app data statistics
  • Go to https://play.google.com/apps/publish
  • Go to Users and Permissions -> Invite new user -> Add the email (Service account email)
  • Now, Grant permission to service account we created (Choose permission - "View app information and download bulk reports (read-only)") -> click Add user

It can take upto 24 hours to grant permission to service account, so don't worry if you get authentication error

Bucket Name

Steps to find bucket name

  • Go to your play console
  • Navigate to Download reports -> Statistics
  • Click "Copy cloud storage URI" , Example: gs://pubsite_prod_xxxxx/stats/installs/
  • Use only "pubsite_prod_xxxxx" as the bucket name

Install

npm install -g google-playstore-stats-viewer

or

yarn global add google-playstore-stats-viewer

Usage

Using the CLI - (Get basic stats)

playstore-stats \
    -p=com.example.app \
    -k=KEY_FILE_LOCATION \
    -g=YOUR_GCP_PROJECT_ID \
    -b=pubsite_prod_xxxx

or the JavaScript API to fetch stats (Get basic stats)

const GooglePlayStoreStatsViewer = require('google-playstore-stats-viewer');

try {
    const statsViewer = new GooglePlayStoreStatsViewer({
        keyFilePath: "PATH_TO_KEY_FILE",
        packageName: "com.example.app",
        projectID: "GCP_PROJECT_ID",
        bucketName: "pubsite_prod_xxxx"})
    const data = await statsViewer.getAppStats();
    console.log(data);
} catch (e) {
  console.log(e);
}

Output (sample)

{
  currentlyActiveDevices: 344,
  totalInstallCountByUser: 1051,
  totalUninstallCountByUser: 780,
  totalInstallEventsDetected: 117276,
  totalUninstallEventsDetected: 831
}

You can use setPackageName(STRING) -> Update packageID to query stats for different apps associated with same developer account. (and you have the permission)

statsViewer.setPackageName("com.newpackage.app")

To download csv files - Statistics (Installs)

returns a promise, which resolves to an array containing downloaded file names.

try {
    const statsViewer = new GooglePlayStoreStatsViewer({
        keyFilePath: "PATH_TO_KEY_FILE",
        packageName: "com.example.app",
        projectID: "GCP_PROJECT_ID",
        bucketName: "pubsite_prod_xxxx"})
    const data = await statsViewer.downloadAppStats({
        dimension: statsViewer.Dimensions.<DIMENSION_NAME>,
        targetLocation: targetLocation
    });
    console.log(data);
} catch (e) {
  console.log(e);
}

where dimension name can be any of the following:

| DIMENSION NAME | USE | |-------------------- |----------------------- | | DEVICE | Device wise installs | | APP_VERSION | Version wise installs | | CARRIER | Carrier wise installs | | COUNTRY | Country wise installs | | LANGUAGE | Language wise | | ANDROID_OS_VERSION | OS version wise |

Use cases

What are the possible usage of this package?

  • Create API based, stats fetch
  • When you have multiple apps hosted on playstore
  • Integration with custom dashboard

Do more

Modify the source to support more methods like reviews, crashes and more. https://support.google.com/googleplay/android-developer/?p=stats_export

This project uses: