Getting the Android Market Token (for use in getting live data)

Mmmmm... Market Data...

Mmmmm... Market Data...

I’ve been sitting on this code for a while now. I had been tooling around with it mostly about a year ago when I was collecting live market data – it actually took a long time to figure out what the actual token was. Not sure if this method will be changed since there is apparently a big update for the market coming up, I’m assuming it won’t change though – otherwise older versions of the market would break. For people who don’t know – the http requests the vending apk is sending holds a “token” which there was no link to how it was obtained or formed. It turns out to just be a simple token requested like any other google service. The “service” name just turned out to be “android”. Other “services” that the market uses are “androidsecure” and “sierra” – the latter being the codename for google-checkout.

The main reason this was a pain to figure out was because it’s being handled by the com.google.android.googleapps package, not the vending.apk package.

Hopefully this snippet will be useful for some people, like the MyMarket creators or anyone else trying to do market data analysis. I’ll try to post later how to actually send data and receive it using this token. Enjoy for now!

  1. There is also http://www.androlib.com which seems to have access to Market.

  2. Interesting post. You can also request that Android Market authentication token by requesting a local service on the Android device itself…

  3. @Édouard

    Yes you can — but that doesn’t help me if I want a different token than the one registered to the phone. Or running an application NOT on a phone.

  4. Hi,
    I’m really interesting in retrieving live data from the market.
    If you have find the way to send and receive data from the market, It would be very cool to publish an article on this.
    I’m trying to build request from my computer, using curl for now.

    Thanks for all and in advance

    P.S : sorry for my English (I’m French).

  5. @b2l

    Sorry, I will not be posting a how to with all the source included. There should be enough information on this site already to aid people in making these requests.

    Plenty of people have done it already, I just don’t want to hand people exact code on how to do these things — it requires a little learning 😉

  6. i want to download com.viziomobile.MarketLive but i could not.Please if anyone have apk send me.. Sorry for my English.

  7. @Fatih –

    Sorry but this isn’t an apk sharing site 😉

  8. hi:
    when I use a Vending.apk from network,
    I can login into the app,and browse the apps in the market,
    but I can not download the free apps,
    do you know why?
    or you can give me a email:
    [email protected],
    thanks very much;

  9. @Édouard/@Tim

    Above you guys discussed:

    “Interesting post. You can also request that Android Market authentication token by requesting a local service on the Android device itself…”

    I’d like to use the authtoken from the phone to avoid requiring the user to enter a google login id/password. Unfortunately, I’m consistently getting 403 errors trying to use the “android” authtoken from the device using the approach described here: http://groups.google.com/group/android-market-api/browse_thread/thread/1ddfdb22727181b5

    Do you know if this approach still works with the market? Can you point me to some sample code that works?

  10. @yml

    That code should still work, though I guess it depends on the version of Android your using. You may have to use the AccountManager APIs in newer versions (http://developer.android.com/reference/android/accounts/AccountManager.html)

Your Name Email Website