1

After some researches i have managed to use AndroidPublisher api from google and am able to connect with google developer console from my web app in java. But it seems, since i don't have any google play accounts (do not have any app on play store) i cant get any thing from the android publisher api. I am just being able to connect the console. But my concern here is not to get information of any app that i have developed, but of any app that is already in play store. Currently i want to have reviews. So far i have tried this :

        /** Global instance of the JSON factory. */
    JsonFactory JSON_FACTORY = (JsonFactory) JacksonFactory.getDefaultInstance();

    /** Global instance of the HTTP transport. */
    HttpTransport HTTP_TRANSPORT = (HttpTransport) GoogleNetHttpTransport.newTrustedTransport();

    GoogleCredential credential = GoogleCredential.fromStream(new FileInputStream("AppReviews-08a95e474894.json"))
            .createScoped(Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER));

    AndroidPublisher androidPublisher = new AndroidPublisher.Builder(HTTP_TRANSPORT, JSON_FACTORY ,credential).setApplicationName("Dream League Soccer").build();

    AndroidPublisher.Reviews reviews = androidPublisher.reviews()

    println "reviews --------------------= ${reviews.list("com.firsttouchgames.dls3").setMaxResults(500).execute()}"

When this executes, i get following exception:

Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "androidpublisher",
    "message" : "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
    "reason" : "projectNotLinked"
  } ],
  "message" : "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}

I think this means, i do not have any google play accounts linked in my google developer console project/account.

So, do i need to have a google play account necessarily? Even if i have an account in google play, can i access the reviews of global apps (like i have used Dream League Soccer in above example with correct package name).

Please help, couldn't find any resource, or any answers on previously asked related questions. Please help!

Prabin Upreti
  • 498
  • 5
  • 16
  • Have you tried checking this [SO post](https://stackoverflow.com/questions/25481207/why-getting-error-the-project-id-used-to-call-the-google-play-developer-api-has)? – MαπμQμαπkγVπ.0 Mar 02 '18 at 11:20

1 Answers1

2

The API is for the use of Android App developers to get information about their own apps. It isn't for scraping the store for getting information about all apps. This API will not do what you want it to, it will only get information about your own apps, and you don't have any.

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37
  • Pls answer below link.I tried to do the same in android app.But i cant figure out the value of redirect uri https://stackoverflow.com/questions/50185190/how-to-access-google-developer-api-in-android-app – Lavanya Velusamy May 05 '18 at 02:57