A Google Data API is an API based upon the Google Data protocol. The Google Data protocol is based on the Atom 1.0 and RSS 2.0 syndication formats, plus the Atom Publishing Protocol (APP).
The Google Data protocol extends those standards in various ways, using the extension mechanisms built into the standards. Feeds conform to either the Atom or RSS syndication formats. The publishing model conforms to the Atom Publishing Protocol.
The protocol also provides a general model for feeds, queries, and results. You can use it to send queries and updates to any Data API.
JSON refers to JavaScript Object Notation.
JSON is a lightweight data interchange format whose simplicity has resulted in widespread use among web developers. It is easy to read and write; you can parse it using any programming language, and its structures map directly to data structures used in most programming languages.
Read more about Using JSON with the Google Data APIs.
alt
query parameter.
alt=rss
alt=json
or alt=json-in-script
Read more about Requesting and using JSON feeds.
alt=atom-in-script
alt=json-in-script
, but results are returned as an Atom XML string rather than JSON.
alt=rss-in-script
alt=atom-in-script
, but results are returned as an RSS XML string rather than Atom.
Read more about the alternate formats in the Google Data Reference Guide.
No, but you can use Gmail's Atom feed with
AuthSub or OAuth to request read-only access to a user's unread messages. The scope should be set to https://mail.google.com/mail/feed/atom/
. An example query would be:
GET https://mail.google.com/mail/feed/atom/
If you're interested in managing your mail, Gmail also has IMAP/POP support.
Google API | Service name |
---|---|
Google Apps Provisioning APIs | apps |
Google Base Data API | gbase |
Blogger Data API | blogger |
Book Search Data API | print |
Calendar Data API | cl |
Google Code Search Data API | codesearch |
Contacts Data API | cp |
Documents List Data API | writely |
Finance Data API | finance |
Gmail Atom feed | mail |
Health Data API | health weaver (H9 sandbox) |
Notebook Data API | notebook |
Picasa Web Albums Data API | lh2 |
Spreadsheets Data API | wise |
Webmaster Tools API | sitemaps |
YouTube Data API | youtube |
For more information on the other parameters used in a ClientLogin request, see the ClientLogin documentation.
scope
parameter is required by AuthSub and OAuth to identify which Google service(s) your application will have access to.
Google API | Service name |
---|---|
Google Base Data API | http://www.google.com/base/feeds/ |
Blogger Data API | http://www.blogger.com/feeds/ |
Book Search Data API | http://www.google.com/books/feeds/ |
Calendar Data API | http://www.google.com/calendar/feeds/ |
Contacts Data API | http://www.google.com/m8/feeds/ |
Documents List Data API | http://docs.google.com/feeds/ |
Finance Data API | http://finance.google.com/finance/feeds/ |
Gmail Atom feed | https://mail.google.com/mail/feed/atom/ |
Health Data API | https://www.google.com/health/feeds/ https://www.google.com/h9/feeds/ (H9 sandbox) |
Picasa Web Albums Data API | http://picasaweb.google.com/data/ |
Spreadsheets Data API | http://spreadsheets.google.com/feeds/ |
Webmaster Tools API | http://www.google.com/webmasters/tools/feeds/ |
YouTube Data API | http://gdata.youtube.com |
AuthSubRevokeToken
API call.
A single use token can only be exchanged for a session token if the original AuthSubRequest
URL specified session=1
as a query parameter.
AuthSub is designed for web applications. It ensures that user credentials are securely sent directly from a user's web browser to Google's servers rather than through a 3rd party web site.
ClientLogin is for installed desktop applications. It requires the requesting application to transmit user credentials to Google on behalf of the user.
See the documentation on Google Account Authentication API.
default
to mean "the user whose authentication token I am using."The Java, .NET, Python and Objective-C client libraries are officially supported by Google. In addition, our partner Zend has written a PHP client library. Using these libraries, you can construct Google Data protocol requests, send them to a service, and process server responses. There is also a JavaScript client library that currently only supports Blogger, Calendar, and Google Contacts.
If you write a client library in a language other than Java, .Net, Python or Objective-C, and would like to share with the Data API developer community, post in the Google Data APIs discussion group. We would love to hear from you!
Bugs or feature requests for the client libraries can be reported at the following locations:
After posting your bug, create a thread in the developer forum for the appropriate API.
Client Library | Reference Guide |
---|---|
Java | Javadoc |
JavaScript | JSdoc |
.NET | NDoc |
PHP | phpDoc |
Python | PyDoc |
There are a number of tools listed below, but you may also want to read the article On the Wire: Network Capture Tools for API Developers which describes in depth examples of both WireShark and Fiddler.
The Java client libraries use the java.util.logging
package to enable logging of HTTP requests. This will allow you to enable logging of headers for requests and responses, as well as status codes and request URLs. It does not currently log the full request and response streams. The logger name used for these logs is com.google.gdata.client.http.HttpGDataRequest
.
In the case that an error code is returned from the servers, an Exception is thrown. The exception classes inherit from com.google.gdata.util.ServiceException
and include a public method called getResponseBody()
. Look at the Javadoc for more information.
System.Diagnostics
tracing methods to log the path of execution, if tracing is enabled. Also, in the case of an error, a GDataRequestException
is thrown. The exception contains a ResponseString
which allows you to access the body of the HTTP response.In order to receive a gzip encoded response from one of the Google Data APIs you must do two things: set an "Accept-Encoding" header and modify your user agent to contain the string "gzip". An example of properly formed headers:
User-Agent: my program (gzip) Accept-Encoding: gzip