• Stars
    star
    79
  • Rank 408,196 (Top 9 %)
  • Language
    Go
  • License
    GNU Lesser Genera...
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Golang scraper to get data from Google Play Store

google-play-scraper

GoDoc Go Report Card Coverage Status

Golang scraper to get data from Google Play Store

This project is inspired by the google-play-scraper node.js project

Installation

go get -u github.com/n0madic/google-play-scraper/...

Usage

Get app details

Retrieves the full detail of an application.

package main

import (
    "github.com/davecgh/go-spew/spew"
    "github.com/n0madic/google-play-scraper/pkg/app"
)

func main() {
    a := app.New("com.google.android.googlequicksearchbox", app.Options{
        Country:  "us",
        Language: "us",
    })
    err := a.LoadDetails()
    if err != nil {
        panic(err)
    }
    err = a.LoadPermissions()
    if err != nil {
        panic(err)
    }
    spew.Dump(a)
}

Search apps

Retrieves a list of apps that results of searching by the given term.

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/search"
)

func main() {
    query := search.NewQuery("game", search.PricePaid,
        search.Options{
            Country:  "ru",
            Language: "us",
            Number:   100,
            Discount: true,
            PriceMax: 100,
            ScoreMin: 4,
        })

    err := query.Run()
    if err != nil {
        panic(err)
    }

    errors := query.LoadMoreDetails(20)
    if len(errors) > 0 {
        panic(errors[0])
    }

    for _, app := range query.Results {
        if !app.IAPOffers {
            fmt.Println(app.Title, app.URL)
        }
    }
}

Get category

Returns a list of clusters for the specified application category.

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/category"
    "github.com/n0madic/google-play-scraper/pkg/store"
)

func main() {
    clusters, err := category.New(store.Game, store.AgeFiveUnder, category.Options{
        Country:  "us",
        Language: "us",
        Number:   100,
    })
    if err != nil {
        panic(err)
    }

    clusterName := "New & updated games"
    err = clusters[clusterName].Run()
    if err != nil {
        panic(err)
    }

    for _, app := range clusters[clusterName].Results {
        fmt.Println(app.Title, app.URL)
    }
}

Get collection

Retrieve a list of applications from one of the collections at Google Play.

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/collection"
    "github.com/n0madic/google-play-scraper/pkg/store"
)

func main() {
    c := collection.New(store.TopNewPaid, collection.Options{
        Country: "uk",
        Number:  100,
    })
    err := c.Run()
    if err != nil {
        panic(err)
    }

    for _, app := range c.Results {
        fmt.Println(app.Title, app.Price, app.URL)
    }
}

Get developer applications

Returns the list of applications by the given developer name or ID

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/developer"
)

func main() {
    dev := developer.New("Google LLC", developer.Options{
        Number: 100,
    })
    err := dev.Run()
    if err != nil {
        panic(err)
    }

    for _, app := range dev.Results {
        fmt.Println(app.Title, "by", app.Developer, app.URL)
    }
}

Get reviews

Retrieves a page of reviews for a specific application.

Note that this method returns reviews in a specific language (english by default), so you need to try different languages to get more reviews. Also, the counter displayed in the Google Play page refers to the total number of 1-5 stars ratings the application has, not the written reviews count. So if the app has 100k ratings, don't expect to get 100k reviews by using this method.

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/reviews"
)

func main() {
    r := reviews.New("com.activision.callofduty.shooter", reviews.Options{
        Number: 100,
    })

    err := r.Run()
    if err != nil {
        panic(err)
    }

    for _, review := range r.Results {
        fmt.Println(review.Score, review.Text)
    }
}

Get similar

Returns a list of similar apps to the one specified.

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/similar"
)

func main() {
    sim := similar.New("com.android.chrome", similar.Options{
        Number: 100,
    })
    err := sim.Run()
    if err != nil {
        panic(err)
    }

    for _, app := range sim.Results {
        fmt.Println(app.Title, app.URL)
    }
}

Get suggest

Given a string returns up to five suggestion to complete a search query term.

package main

import (
    "fmt"

    "github.com/n0madic/google-play-scraper/pkg/suggest"
)

func main() {
    sug, err := suggest.Get("chrome", suggest.Options{
        Country:  "us",
        Language: "us",
    })
    if err != nil {
        panic(err)
    }

    for _, s := range sug {
        fmt.Println(s)
    }
}

More Repositories

1

twitter-scraper

Scrape the Twitter frontend API without authentication with Golang.
Go
881
star
2

gitlab-registry-images-cleaner

Utility to remove old Docker images from the Gitlab registry
Python
55
star
3

twitter2rss

Twitter to RSS proxy
Go
50
star
4

alpine-gcc

The Alpine Docker image with latest GCC compiler (C/C++)
Dockerfile
20
star
5

ai-art-bot

App generates random images using AI Stable Diffusion and posts them in Telegram
Python
19
star
6

sendmail

Standalone drop-in replacement for sendmail with direct send
Go
16
star
7

go-hdrezka

Scraper package for HDrezka site
Go
9
star
8

fullrss

Full text RSS feeds proxy
Go
6
star
9

sprig-repl

REPL go-template with Sprig functions
Go
5
star
10

tib-shellex

Acronis TIB Shell Extension Installer
5
star
11

macvendor

Go library with embedded DB for getting MAC address vendor information
Go
5
star
12

qemu-boot-tester

QEMU GUI for testing boot ISO
AutoIt
5
star
13

nmap-vulners-vulscan

Docker image for advanced vulnerability scanning with Nmap NSE scripts
Dockerfile
4
star
14

app2kube

The easiest way to create and apply kubernetes manifests for an application
Go
4
star
15

site2rss

Go library for scraping the site and creating RSS feeds.
Go
4
star
16

get-github-release

Utility downloads and unpacks the latest binary release from GitHub
Go
3
star
17

geo-traceroute

Traceroute with GeoIP lookup
Go
3
star
18

site2rss-proxy

RSS proxy for sites updates
Go
3
star
19

fullrss-proxy

Full text RSS feeds proxy
PHP
2
star
20

github-release-feed

GitHub releases RSS feed
Go
2
star
21

vagrant-kubeadm-cluster

Vagrantfile with kubeadm cluster
Shell
2
star
22

fullfeed

Convert partial feed to full-text feed with golang
Go
2
star
23

TabNote

Simple notepad with tabs and autosave
Pascal
1
star
24

img2pdf

img2pdf is a command line tool to convert raster images to PDF
Go
1
star
25

cloudping

Check the network latency between regions of cloud providers and your location
Go
1
star
26

postlog

Postfix log viewer
PHP
1
star
27

git-clone

Git clone standalone
Go
1
star
28

cf-kv-db

Simple K/V serverless database with Cloudflare workers
JavaScript
1
star
29

smarttv-install

SmartTV Widget Installer
AutoIt
1
star
30

page2rss

Site to RSS proxy
PHP
1
star
31

go-instauuid

Go package that provides a simple and efficient way to generate Instagram-like unique identifiers (UUIDs)
Go
1
star