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 REST or RPC protocols.

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 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, read the Developer's Guide, or work through the OpenSocial Tutorial. Because all OpenSocial applications are gadgets, you might also want to study the gadgets.* API Developer's Guide.

REST Protocol and RPC Protocol

The REST protocol and RPC protocol provide complementary functionality to the JavaScript API, so you can access people, activities, and data from your server.

The REST and RPC protocols are designed to use standard web technologies:

  • Server interactions are based on the JSON-RPC protocol, the AtomPub protocol, or plain XML.
  • Authentication is handled by OAuth.

OpenSocial Community Wiki

Be sure to visit the OpenSocial Community Wiki for lots of user-editable documentation including reference, articles, and examples.