Developers
The ShareThis API (STAPI) is for advanced use when you plan to:- Share something more than just a single web page (e.g. image, video, etc.)
- Change the default object properties
- Share multiple objects on a single web page
If you do not need these advanced capabilities, we suggest you use the standard website configuring tool or the ShareThis WordPress plugin.
Object Properties
Shared objects closely follow the structure of the Entry element as specified by the hAtom microformat (see http://microformats.org/wiki/hatom for more information). Shared objects, like feeds, are often viewed without the context of a web page, so be descriptive.
Since we don't know the encoding of your web page, we have to ask that all strings be encoded in utf-8. Click here for a script to make your strings utf-8 safe.
Below is the supported list of user assignable properties for a shared object.
title:(required) utf-8 string, defaults to document.title
url:(required) fully qualified URL, defaults to document.URL
summary:(optional) utf-8 string, defaults to null
content:(optional) utf-8 string, defaults to null
icon:(optional) fully qualified URL, defaults to Alexa thumbnail of url
updated:(optional) ISO 8601 date, defaults to document.lastModified
published:(optional) ISO 8601 date, defaults to null
author:currently not implemented
category:currently not implemented
Note: The content attribute is embedded in share messages where possible (i.e. email, web page). If you use this attribute make sure it is embeddable.
JavaScript Elements
JavaScript array elements are used to provide greater control of the behavior of the button and/or widget. The elements must placed in brackets immediately after the object definition (see "button:" example in the sample code above). The following are the available ShareThis JavaScript elements:button: create a customized ShareThis button and/or label for any object or page to be shared
popup: launches the widget in a new window rather than an iFrame
embeds: allows embedded elements to be seen while iFrame is loading
onclick: allows for execution of a custom function when button is clicked
offsetTop: changes the vertical positioning of the ShareThis widget in relation to the button link
offsetLeft: changes the horizontal positiong of the ShareThis widget in relation to the button link
Click this link to begin using:
ShareThis API (STAPI)STAPI
- How do I create my own custom ShareThis button?
- How do I make the widget appear in a new popup window?
- How do I allow embedded elements to be visible while the iFrame is loaded?
- How do I execute my own function along with the ShareThis button?
- What do I do if I’m having problems with Flash showing through the ShareThis widget?
- How do I change the positioning of the ShareThis widget in relation to the ShareThis button link?
- How can I use ShareThis within Flash?
Other Resources
- Encoding/decoding UTF8 in javascript - Script for dealing with UTF8 in javascript
- hAtom 0.1 - Microformat for syndicating content
