A package to query the Google Play Store.
NOTE: This project is a work in progress.
This project requires Go1.1+.
$ go get github.com/airamrguez/go-playstore
There are mainly two actions lookups and searchs.
This example shows how to fetch data for the Candy Crush Saga in english, spanish and french.
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"github.com/airamrguez/go-playstore"
)
func main() {
// For an app that doesn't use Google App Engine you can directly
// use net/http package.
httpGet := func(url *url.URL) (*http.Response, error) {
return http.Get(url)
}
// English content is always fetched.
app, err := playstore.MultiLookUp(httpGet, "com.king.candycrushsaga", ["es", "fr"])
if err != nil {
panic(err)
}
json, err := json.Marshal(app)
if err != nil {
panic(err)
}
fmt.Println(string(json))
}
Search all applications that match a term. In this case we search for all applications matching candy.
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"github.com/airamrguez/go-playstore"
)
func main() {
httpGet := func(url *url.URL) (*http.Response, error) {
fmt.Println(url.String())
return http.Get(url.String())
}
apps, err := playstore.Search(httpGet, "candy", 40, "en")
if err != nil {
panic(err)
}
json, err := json.Marshal(apps)
if err != nil {
panic(err)
}
fmt.Println(string(json))
}
- Look up with multilingual support.
- Search a term.
- Add tests
- Add leadership