yeriomin / play-store-api

Google Play Store protobuf API wrapper in java
GNU General Public License v3.0
322 stars 130 forks source link

how to get content rating of an App? #14

Closed wormcy closed 6 years ago

wormcy commented 6 years ago

I have tried with following code, the result always be 0.

       DetailsResponse response = null;
       response = api.details("org.amalgam.laboratory");
        AppDetails detail = response.getDocV2().getDetails().getAppDetails();
        System.out.println(detail.getContentRating());

Thanks a lot!

yeriomin commented 6 years ago

Here: response.getDocV2().getRelatedLinks().getRated()

Unfortunately, Play Store API does not provide an integer value. You can get a label which looks like "Rated for 12+" here: response.getDocV2().getRelatedLinks().getRated().getLabel(). There is an image there too.

wormcy commented 6 years ago

Awesome!! Thanks