Search code examples
pythoncurlgdata-api

Programmatic login and use of non-api-supported Google services


Google provides APIs for a number of their services and bindings for several languages. However, not everything is supported. So this question comes from my incomplete understanding of things like wget, curl, and the various web programming libraries.

  1. How can I authenticate programmatically to Google?

  2. Is it possible to leverage the existing APIs to gain access to the unsupported parts of Google?

Once I have authenticated, how do I use that to access my restricted pages? It seems like the API could be used do the login and get a token, but I don't understand what I'm supposed to do next to fetch a restricted webpage.

Specifically, I am playing around with Android and want to write a script to grab my app usage stats from the Android Market once or twice a day so I can make pretty charts. My most likely target is python, but code in any language illustrating non-API use of Google's services would be helpful. Thanks folks.


Solution

  • You can get the auth tokens by authenticating a particular service against https://www.google.com/accounts/ClientLogin

    E.g.

    curl -d "Email=youremail" -d "Passwd=yourpassword" -d "service=blogger" "https://www.google.com/accounts/ClientLogin"
    

    Then you can just pass the auth tokens and cookies along when accessing the service. You can use firebug or temper data firefox plugin to find out the parameter names etc.