English | Site Directory

OpenSocial API Documentation

The OpenSocial API is a set of common APIs for building social applications on many websites. There are two ways to access the OpenSocial API: client-side using the JavaScript API and server-side using RESTful data APIs.

JavaScript API

The JavaScript API lives under the opensocial.* namespace and provides access to three primary areas of functionality:

  • People -- information about individual people and their relationships to each other
  • Activities -- ability to post and view updates on what people are doing
  • Persistence -- a simple key-value data store to allow server-free stateful applications

Here are some of the things you can do with the JavaScript API:

  • Build applications without maintaining your own server
  • Build applications that include a server-side component (for offline processing and/or access from other websites)
  • Create brand-new applications
  • Expose existing web applications in the context of existing social websites
  • Add social features to existing Google Gadgets
  • Write one application that can run in the context of many different social websites

The JavaScript API is designed to use standard web technologies:

  • It's packaged as a set of methods in the opensocial.* namespace.
  • It allows you to use any standard JavaScript programming techniques and third-party libraries.
  • It includes a full asynchronous callback system to support rich AJAX interactivity.

To build an application using the OpenSocial JavaScript API, check out the Getting Started Guide or work through the OpenSocial Tutorial.

RESTful Data APIs

The RESTful Data APIs will provide complementary functionality to the JavaScript API, so you can access people, activities, and data from your server.

The RESTful data APIs are also designed to use standard web technologies:

  • Server interactions are based on the RESTful AtomPub protocol.
  • Authentication is handled by OAuth.