query the google play store for the version of an app?

前端 未结 4 1559
悲&欢浪女
悲&欢浪女 2020-11-30 06:57

is there a way to query the play store for the version of an app without the need for user-credentials. I am aware of this unofficial API:

http://code.google.com/p/a

4条回答
  •  遥遥无期
    2020-11-30 07:30

    Also check out: www.playstoreapi.com

    It's unofficial but easy to use (free for non commercial use). you can get data about apps, search the play store and get top charts data. from their documentation section:

    Node.js:

    var request     = require('request');
    var apiKey      = 'wij5czxu3mxkzkt9'; // your API key
    var packageName = 'com.whatsapp';     // package Name, e.g. com.whatsapp for WhatsApp
    
    var url = 'http://api.playstoreapi.com/v1.1/apps/' + packageName + '?key=' + apiKey;
    
    request({
        url: url,
        json: true
        }, function (error, response, body) {
        if (!error && response.statusCode === 200) {
            console.log(body) // Print the json response
        }
    });
    

    HTML/JS:

    
    
    
    

    Python:

    import urllib2
    import json
    
    packageName = 'com.whatsapp'      # package com.whatsapp for WhatsApp
    apiKey      = 'wij5czxu3mxkzkt9'  # your API key
    
    url = 'http://api.playstoreapi.com/v1.1/apps/{0}?key={1}'
    
    response = urllib2.urlopen(url.format(packageName, apiKey))
    
    data = json.load(response)   
    print data
    

    C# .NET:

    string apiKey = "wij5czxu3mxkzkt9"; // your API key
    string app    = "com.whatsapp";     // package com.whatsapp for WhatsApp
    
    string url = "http://api.playstoreapi.com/v1.1/apps/{0}?key={1}";
    
    using (var webClient = new System.Net.WebClient()) {
        string jsonString = webClient.DownloadString(string.Format(url, app, apiKey));
    }
    

提交回复
热议问题