# Google Data APIs Samples

**Warning** : This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the [Google Data APIs directory](https://developers.google.com/gdata/docs/directory), many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see [Google Accounts Authentication and Authorization](https://developers.google.com/accounts).

This page provides links and information about sample code.

## Contents

1. [JavaScript samples](https://developers.google.com/gdata/samples#JavaScript)
2. [JSON samples](https://developers.google.com/gdata/samples#JSON)
3. [Gadget samples](https://developers.google.com/gdata/samples#Gadgets)
4. [Java samples](https://developers.google.com/gdata/samples#Java)
5. [.NET samples](https://developers.google.com/gdata/samples#NET)
6. [Other languages](https://developers.google.com/gdata/samples#OTHERLANGS)

## JavaScript samples

The [JavaScript client library](https://developers.google.com/gdata/docs/js)
can be used from web browsers to interact with the [Base Data API](https://developers.google.com/base), [Blogger Data API](https://developers.google.com/blogger/docs/1.0/developers_guide_js),
[Calendar Data API](https://developers.google.com/google-apps/calendar/v1/developers_guide_javascript), [Contacts Data API](https://developers.google.com/google-apps/contacts/v1/developers_guide_js), and
[Finance Data API](https://developers.google.com/finance/docs/1.0/developers_guide_js).

**Note**: The samples that were previously in this section have been removed because they relied on APIs and/or authentication methods that are no longer available.

## JSON samples

These are live samples; click to view them. For more information, see [Using JSON with Google Data APIs](https://developers.google.com/gdata/json).

### Google Calendar

[Upcoming events from Calendar](https://developers.google.com/gdata/samples/cal_sample)
:   This sample demonstrates displaying a list of upcoming calendar events from a Google Calendar on a web page using the JSON output format provided by the Calendar Data API.

### Blogger

[Recent posts from Blogger](https://developers.google.com/gdata/samples/blogger_sample)
:   This sample demonstrates displaying a list of recent posts from a blog hosted on Blogger Beta using the JSON output format provided by the Blogger Data API.

### Spreadsheets

[Reading Google Spreadsheets data](https://developers.google.com/gdata/samples/spreadsheet_sample)
:   This sample demonstrates displaying data from a Google Spreadsheet on a web page using the JSON output format provided by the Spreadsheet Data API.

## Gadget samples

For more information on creating Google Data API gadgets, see [Creating a Google Data Gadget](https://developers.google.com/gdata/articles/gdata_gadgets) or the full [Writing OAuth Gadgets](https://developers.google.com/gadgets/docs/oauth) documentation.

[Blogger gadget](http://code.google.com/p/gdata-samples/source/browse/trunk/gadgets/blogger/blogger_gadget.xml)
[YouTube gadget](http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/oauth-test.xml)

## Java samples

### Samples bundled with the client library

These samples can be found in the downloadable Java client library
package. For more information, see the [Java
client library developer's guide](https://developers.google.com/gdata/client-java), or [download the Java client library](https://code.google.com/p/gdata-java-client/downloads/list).

[java/sample/authsub/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/authsub)
:   GData AuthSub proxy, implemented using Java servlets; sample JavaScript client that accesses data through the proxy.

[java/sample/calendar/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/calendar)
:   Simple client that performs several hardwired manipulations on a Google Calendar.

[java/sample/codesarch/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/codesearch)
:   Command line client to query the Google Code Search data API.

[java/sample/spreadsheet/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/spreadsheet)
:   Sample apps using Google Spreadsheet API.

[java/sample/appsforyourdomain/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/appsforyourdomain)
:   Sample apps using G Suite API.

[java/sample/blogger/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/blogger)
:   Sample apps using Blogger API.

[java/sample/contacts/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/contacts)
:   Sample apps using Google Contacts API.

[java/sample/docs/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/docs)
:   Sample apps using Google Doclist API.

[java/sample/gbase/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/gbase)
:   Sample apps using Google Base API.

[java/sample/photos/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/photos)
:   Sample apps using Picasa Web Album API.

[java/sample/sidewiki/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/sidewiki)
:   Sample apps using Google Sidewiki API.

[java/sample/webmastertools/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/webmastertools)
:   Sample apps using Webmaster API.

[java/sample/youtube/](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/youtube)
:   Sample apps using YouTube API.

[YouTubeSample ASP page](http://google-gdata.googlecode.com/svn/trunk/clients/cs/samples/YouTubeSample/)
:   Video search and upload sample using the client library.

## .NET samples

### Samples bundled with the client library

These samples can be found in the downloadable .NET client library package. For more information, see the [.NET client library developer's guide](https://developers.google.com/gdata/client-cs), or [download the .NET client library](https://code.google.com/p/google-gdata).

[clients/cs/samples/blogger/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/blogger)
:   Sample apps using Blogger API.

[clients/cs/samples/calendar/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/calendar)
:   Sample apps using Google Calendar Data API.

[clients/cs/samples/spreadsheets/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/spreadsheets)
:   Sample apps using Google Spreadsheet API.

[clients/cs/samples/DocListUploader/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/DocListUploader)
:   Uploads documents to Google Docs.

[clients/cs/samples/DocListExporter/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/DocListExporter)
:   Exports Google Documents in various formats.

[clients/cs/samples/PhotoBrowser/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/PhotoBrowser)
:   Sample apps using Picasa Web Album API.

[clients/cs/samples/YouTubeSample/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/YouTubeSample)
:   Sample apps using YouTube API.

[clients/cs/samples/appsforyourdomain/](https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/appsforyourdomain)
:   Sample apps using G Suite API.

### Other examples

[Contacts Updater](https://code.google.com/p/gdata-samples/source/browse/#svn/trunk/contacts/ContactsUpdater)
:   A WPF sample that demonstrates how to read and update your contacts using the Contacts API.
    A [.zip file](http://gdata-samples.googlecode.com/svn/trunk/contacts/ContactsUpdater/ContactsUpdater.zip) is also available.

[Google Docs PDF Concatenator](https://code.google.com/p/gdata-samples/source/browse/#svn/trunk/doclist/PdfConcatenate)
:   Concatenates PDF files together and uploads the result to Google Docs.
    A [.zip file](http://gdata-samples.googlecode.com/files/PdfConcatenate.zip) is also available.

## Other languages

### C++

[Documents List API sample](https://code.google.com/p/gdata-cpp-util/source/browse/trunk/doclist_sample.cc)
:   Allows users to view, upload, delete, and search their Google documents, spreadsheets, presentations, and folders. This sample
    also demonstrates the API's ACL functionality by listing the users who have read/write permissions.

### Ruby

[DocList Manager](https://code.google.com/p/gdata-samples/source/browse/#svn/trunk/doclist/DocListManager)
:   Ruby on Rails sample that allows users to view and export documents.

[Back to top](https://developers.google.com/gdata/samples#top)