Skip to content

kix2902/PlayStoreApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PlayStoreApi

This PHP library provides an unofficial Google Play Store API

Installation

Copy the library folder into your project.

Usage

First of all include the API.php file into your PHP script:

include_once 'library/API.php';

Then you can create an PlayStoreApi object and configure it:

$api = new PlayStoreApi();
$api->setCountryCode("ES");   // Pass a valid 2 letters ISO country code (ISO 3166 alpha-2) (default: "US")
$api->setLanguageCode("es");  // Pass a valid 2 letters ISO language code (ISO 639-1) (default: "en")

And last you can search for any type of data available on the Play Store:

/*
* All of the following methods have the same structure
*
* @param $query string Term to search on the Google Play Store (mandatory)
* @param $page string PageToken of the page to load (if not set it'll load the first) (optional)
*/
$api->searchAlbums($query, $page);
$api->searchApps($query, $page);
$api->searchArtists($query, $page);
$api->searchBooks($query, $page);
$api->searchDevices($query, $page);
$api->searchMagazines($query, $page);
$api->searchMovies($query, $page);
$api->searchNewspapers($query, $page);
$api->searchSongs($query, $page);
$api->searchTvEpisodes($query, $page);
$api->searchTvShows($query, $page);

Output

Every search method will return a json string formatted like the following:

{
  "nextPageToken": "string with the pagetoken to load the next page of results",
  "items": "array of objects with variable structure depending of the type of the data searched"
}

The structure of every type data are the following (all values are optional):

Album

{
  "album_id"
  "image"
  "title"
  "artist"
  "artist_id"
  "price"
  "url"
  "description"
  "genre"
  "tracks"
  "rating_value"
  "rating_count"
}

App

{
  "package"
  "icon"
  "name"
  "developer"
  "price"
  "url"
  "description"
  "category"
  "rating_value"
  "rating_count"
  "file_size"
  "date_updated"
  "num_downloads"
  "version"
  "required_android"
  "content_rating"
}

Artist

{
  "artist_id"
  "image"
  "name"
  "url"
  "about"
}

Book

{
  "book_id"
  "image"
  "title"
  "author"
  "price"
  "url"
  "description"
  "pages"
  "languages"
  "isbn"
  "rating_value"
  "rating_count"
}

Device

{
  "device_id"
  "image"
  "title"
  "price"
  "url"
}

Magazine

{
  "magazine_id"
  "image"
  "title"
  "price"
  "url"
}

Movie

{
  "movie_id"
  "image"
  "title"
  "category"
  "price"
  "url"
}

Newspaper

{
  "newspaper_id"
  "image"
  "title"
  "price"
  "url"
}

Song

{
  "album_id"
  "song_id"
  "image"
  "title"
  "artist"
  "artist_id"
  "price"
  "url"
}

TV Episode

{
  "episode_id"
  "season_id"
  "show_id"
  "image"
  "episode_title"
  "show_title"
  "date"
  "price"
  "url"
}

TV Show

{
  "show_id"
  "image"
  "title"
  "category"
  "price"
  "url"
}

Empty output

If the search doesn't return any result or the data type isn't available in the country configured the output will look like this:

{
  "msg": "No results found"
}

TO-DO

  • Add functionality to retrieve only an object based on their IDs
  • Add methods to retrieve "Top charts" and "New arrivals" listings of every data type

About

Unofficial Google Play Store API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages