PHP code example of droidmanspace / google-play-scraper
1. Go to this page and download the library: Download droidmanspace/google-play-scraper library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
droidmanspace / google-play-scraper example snippets
use Raulr\GooglePlayScraper\Scraper;
$scraper = new Scraper();
then use methods to the $scraper object .
Eg: $app = $scraper->getApp('com.mojang.minecraftpe');
var_dump($app); // display the response
array (
'id' => 'com.mojang.minecraftpe',
'url' => 'https://play.google.com/store/apps/details?id=com.mojang.minecraftpe',
'image' => 'https://lh3.googleusercontent.com/30koN0eGl-LHqvUZrCj9HT4qVPQdvN508p2wuhaWUnqKeCp6nrs9QW8v6IVGvGNauA=w300',
'title' => 'Minecraft: Pocket Edition',
'author' => 'Mojang',
'author_link' => 'https://play.google.com/store/apps/developer?id=Mojang',
'categories' => array (
'Arcade',
'Creativity',
),
'price' => '$6.99',
'screenshots' => array (
'https://lh3.googleusercontent.com/VkLE0e0EDuRID6jdTE97cC8BomcDReJtZOem9Jlb14jw9O7ytAGvE-2pLqvoSJ7w3IdK=h310',
'https://lh3.googleusercontent.com/28b1vxJQe916wOaSVB4CmcnDujk8M2SNaCwqtQ4cUS0wYKYn9kCYeqxX0uyI2X-nQv0=h310',
// [...]
),
'description' => 'Our latest free update
$app = $scraper->getApps(array(
'com.mojang.minecraftpe',
'com.google.android.youtube',
));
use Raulr\GooglePlayScraper\Scraper;
$scraper = new Scraper();
$categories = $scraper->getCategories();
array (
'BOOKS_AND_REFERENCE',
'BUSINESS',
'COMICS',
'COMMUNICATION',
'EDUCATION',
'ENTERTAINMENT',
'FINANCE',
'HEALTH_AND_FITNESS',
'LIBRARIES_AND_DEMO',
'LIFESTYLE',
'APP_WALLPAPER',
'MEDIA_AND_VIDEO',
'MEDICAL',
'MUSIC_AND_AUDIO',
'NEWS_AND_MAGAZINES',
'PERSONALIZATION',
'PHOTOGRAPHY',
'PRODUCTIVITY',
'SHOPPING',
'SOCIAL',
'SPORTS',
'TOOLS',
'TRANSPORTATION',
'TRAVEL_AND_LOCAL',
'WEATHER',
'APP_WIDGETS',
'GAME_ACTION',
'GAME_ADVENTURE',
'GAME_ARCADE',
'GAME_BOARD',
'GAME_CARD',
'GAME_CASINO',
'GAME_CASUAL',
'GAME_EDUCATIONAL',
'GAME_MUSIC',
'GAME_PUZZLE',
'GAME_RACING',
'GAME_ROLE_PLAYING',
'GAME_SIMULATION',
'GAME_SPORTS',
'GAME_STRATEGY',
'GAME_TRIVIA',
'GAME_WORD',
'FAMILY',
'FAMILY_ACTION',
'FAMILY_BRAINGAMES',
'FAMILY_CREATE',
'FAMILY_EDUCATION',
'FAMILY_MUSICVIDEO',
'FAMILY_PRETEND',
)
$collections = $scraper->getCollections();
array (
'topselling_free',
'topselling_paid',
'topselling_new_free',
'topselling_new_paid',
'topgrossing',
'movers_shakers',
)
$apps = $scraper->getList('topselling_free', 'SOCIAL');
array (
array (
'id' => 'com.facebook.katana',
'url' => 'https://play.google.com/store/apps/details?id=com.facebook.katana',
'title' => 'Facebook',
'image' => 'https://lh3.googleusercontent.com/ZZPdzvlpK9r_Df9C3M7j1rNRi7hhHRvPhlklJ3lfi5jk86Jd1s0Y5wcQ1QgbVaAP5Q=w340',
'author' => 'Facebook',
'rating' => 3.9888803958892822,
'price' => null,
),
array (
'id' => 'com.snapchat.android',
'url' => 'https://play.google.com/store/apps/details?id=com.snapchat.android',
'title' => 'Snapchat',
'image' => 'https://lh4.ggpht.com/vdK_CsMSsJoYvJpYgaj91fiJ1T8rnSHHbXL0Em378kQaaf_BGyvUek2aU9z2qbxJCAFV=w340',
'author' => 'Snapchat Inc',
'rating' => 3.8660063743591309,
'price' => null,
),
// [...]
)
$apps = $scraper->getListChunk('topselling_free', 'SOCIAL', 20, 80);
$apps = $scraper->getSearch('unicorns', 'free', '4+');