Gravity API v1.1
If you were looking for the legacy 1.0 documentation, you will find it here.


Within The Browser

If you plan to integrate the Gravity recommender system from the client browser, and for some reason do not wish to use the JavaScript client, you can do so by reading the Browserside Updates and Browserside Recommendation Requests specifications. Please note that even when you create a custom implementation of the Gravity communication, the automatic reporting of recommendation exposures and recommendation clicks available from the javascript client may still be used if the javascript is included on your web page.

With The Javascript Client

The JavaScript API is the recommended way to integrate the Gravity recommender system from client browsers. The javascript client not only contains all the functions you need to communicate with the system, but also contains some automation of necessary reporting. Note that this automation is also available for ordinary serverside implementations and for custom browser implementations if only the JavaScript client is loaded into your web page.

From Your Server

The serverside API is for use in cases where it is impossible to fetch recommendations from within the browser. Using the serverside API for recommendations that are to be exposed in an ordinary browser is discouraged, as this makes it impossible for the Gravity receiver end to recognize the browser client. If you are here simply to see the details about a JSON payload, please go directly to the Payload Specifications document.

Loading a Complete Dataset

A newly started service has no data and will therefore not produce the best recommendations. Initially, one should load a set of historical data into the service to avoid this. These data are not sent as individual updates through the Gravity API, but as separate files. Dataset files must obey the xml format described in our xsd schema description. Please contact Sannsyn for further details.