Skip to content

AppDetails

Izzy edited this page Dec 10, 2020 · 4 revisions

Listing app details

As usual, you first need to make the class available to your code. Then you can lookup details on a given app (e.g. obtained by one of the Search methods) by passing it to the parseApplication() method. Here's an example call:

require "google-play.php";
$google = new GooglePlay();
$app = $google->parseApplication("com.bezapps.flowdiademo");
print_r($app);

The output then would look like this:

Array
(
    [packageName] => com.bezapps.flowdiademo
    [name] => Flowdia Diagrams Lite
    [developer] => BEZAPPS
    [category] => Productivity
    [type] => app
    [description] => Flowdia is an easy to use flow diagram tool that can be used to quickly create professional quality flowcharts, mind maps, BPMN, network and server layouts, Cisco network, Rack diagram, UML activity, business process
    [icon] => https://lh3.googleusercontent.com/Ad85EXrQ1CwPA7Nyf9j_jYtgD4V8Tk7AM9iLRF0lMTG6fRgakgemmYy547o9nDlt5SUU=s180
    [images] => Array
        (
            [0] => https://lh3.googleusercontent.com/E-v927YsFTavPwOPoQlX3ghrgtwBDs2og-BlkR-uJVjln3zPZn42BQf66DUk3RgLjHQ=w720-h310
            [1] => https://lh3.googleusercontent.com/DdUSr7Q3Hn1d6bu9WHRWT3pxRu-kQ08toOUrteVM0PEqq21DL0_bocr2Dkp-V36Ogts=w720-h310
            [2] => https://lh3.googleusercontent.com/Zme-HjUlmoiTXsDfuirj6uAnXw4ynuTCKg_VIVFjLZvd6M7RtQ2iwTpddKEBRzaDkw=w720-h310
            [3] => https://lh3.googleusercontent.com/ksZiKVJ5xLO1vyY7J8wGiO1jmte8BeGnTvkm1ztZfktVHM4U91nJ5OXiqI5Ns1dajLex=w720-h310
            [4] => https://lh3.googleusercontent.com/EOjIutnWGalSQqJXkCzhZ6o4DnhiJZZm58Ai32K99nYooe4aWWpe1HB5PM9MVjM5gsk=w720-h310
            [5] => https://lh3.googleusercontent.com/j-YgtRA1U6Pm88cJqjz4rn_WCPAprveqf-ti4lqqnCrtMjmpkldRgh8T-UDSYBCUBko=w720-h310
            [6] => https://lh3.googleusercontent.com/Sl8V1J_DYPfkq9QOdFKGlon4debOEHfvLK2FpGmaPi0nenQUF3XbJ88H49shlsINKF4=w720-h310
            [7] => https://lh3.googleusercontent.com/2G2MRdimo5m17xMB5V9lQ_3j2BH_jA-y5T8vEx3oktosVXlbUp6FiQ32B3DKG_-_x94=w720-h310
            [8] => https://lh3.googleusercontent.com/eiauYcpKC8RwmjfPKhDzlXqmRA_N-wikj1VMf2a3ce_dmGSdUhNOpPN2pJ7fukZE6YV8=w720-h310
            [9] => https://lh3.googleusercontent.com/VslU20e8ZUVWM5ac5t9etc7d0I7GFqVQpoMu6zfxcruSAkYLXwDIYpvP2u3vGBoCoP0=w720-h310
            [10] => https://lh3.googleusercontent.com/K14ntx3VnpjfvEUlxkW9Q7DxCalbw3_bAP-t3b0jS4gzsI_WqKo6m6w2eR2vCvG3ygo=w720-h310
            [11] => https://lh3.googleusercontent.com/pqbjnQHoHsYDYicHJgw0GzO-6B4wyc8Xn39zl9LyarNBQad4FBpz6GYJCfLFrEurkUo=w720-h310
        )

    [updated] => May 24, 2020
    [version] => 1.10.1
    [require] => 4.4 and up
    [install] => 500,000+
    [age] => Everyone
    [rating] => 3.9
    [votes] => 1,820
    [price] => 0
    [size] => Varies with device
    [ads] => 0
    [iap] => 0
    [success] => 1
    [message] =>
)

Had you e.g. misspelled the package name, or specified an app not listed at Google Play, Results would look slightly different:

Array
(
    [success] => 0
    [message] => HTTP/1.0 404 Not Found
)

The result array

Most fields of the array should be rather self-explaining, so let's keep it short:

  • packageName: the package name (ID) of the app. You've specified that with your call.
  • name: the „human readable“ name of the app
  • developer: name of the developer
  • category: how this app was categorized (human-readable form)
  • type: something like an over-category. This is either 'game', 'family' or 'app'
  • summary: a short description of the app
  • description: a (hopefully) more detailed description of the app
  • icon: URL to the app's icon
  • images: an array of URLs to screenshots
  • updated: date of the last published version of this app
  • version: last published version of this app
  • require: minimal required Android version (if available)¹
  • install: raw install count (how often the app has been downloaded)
  • age: for what age group the app is suitable
  • rating: a (float) rating value (something between 0 and 5)
  • votes: how many users have rated this app
  • price: 0 for „free“ apps – else a price including the currency, e.g. '$2.99'
  • size: size of the APK file (if available)¹
  • ads: whether the app is known to contain/show ads (1) or not (0)
  • iap: whether the app is known to use in-app payment (1) or not (0)
  • success: if you've seen the previous details, this is 1 – data was successfully retrieved. If retrieval failed, it is 0, and message gives you details on what went wrong.
  • message: empty if success==1, but giving details on what went wrong otherwise.

Obtaining language specific content

The parseApplication() method knows of 2 additional, optional parameters: to specify the language, and the region/location. The first is applied to content (if translations are available), the latter to values like the price (including currency). Note that not all content is translated, as that would make scraping complicated.

Example: Get details in German with prices for Austria:

$app = $google->parseApplication("com.bezapps.flowdiademo", "de", "AT");
Clone this wiki locally