Get More Traffic
You've already got an audience that loves your content, product or service. Profit from helping them tell their friends and followers about you. The Universal Share API will enable the people that visit your website to share articles, comments, purchases and other activities from your website with their friends on multiple social networks. This API is free to use (premium upgrades are available), and helps you grow your bottom line and traffic without growing your marketing budget.
Universal Share API Documentation
Shareaholic provides social APIs to connect your site or application to each of the major social networks for sharing. If you can’t use the Shareaholic JavaScript SDK, you can link to these API endpoints directly. With these APIs you can customize the social sharing experience for your users to match the look and feel of your site or application.
Designed for Ease
All API methods are accessible via simple HTTP calls. We have optimized for ease of implementation, so you won’t see anything complicated. Most implementations of this API take less than 15 minutes to setup. Simply hit the provided URLs with their respective parameters, and you're done.
Getting Started: Authentication
All API endpoints require authentication credentials to be supplied as query arguments. To get started, you'll need a free Shareaholic account and Site ID. Signup for an account and then add your site to get your Site ID. The Site ID is your API Key.
Example:
...&apikey=8943b7fd64cd8b1770ff5affa9a9437b&...
Note: the apikey used in this document is intended for use as an example only. It is subject to change.
Share Content with over 100+ (and growing!) Destination Services
Let your users share content from any website, desktop app, mobile app, etc to any supported destination service.
Endpoint:https://www.shareaholic.com/api/share/?v=1
Parameter | Description | Required? | Example |
---|---|---|---|
v |
API Version | Required | v=1 |
apitype |
API Type | Required | apitype=1 (1=Redirect, 2=Pingback, 3=1x1 pixel) |
apikey |
API Key | Required | apikey=8943b7fd64cd8b1770ff5affa9a9437b |
service |
Destination Service ID | Required | service=7 (lookup IDs) |
link |
Link | Required | link=https://www.yoursite.com |
title |
Page Title | Optional | title=My%20Awesome%20Webpage |
notes |
Notes | Optional | notes=I%20love%20this! |
media_link |
Media Link | Optional | media_link=https://www.yoursite.com/logo.png |
short_link |
Shortened Link | Optional | short_link=https://bit.ly/1OTIqm |
shortener |
URL Shortener | Optional | shortener=shrlc (tinyurl|bitly|jmp|shrlc|none) |
shortener_key |
URL Shortener Credentials | Optional | shortener_key=shareaholic|R_83932e4c5d02d1f94aea0f40fbc557ec |
templates[twitter][body] |
Twitter Template | Optional | templates[twitter][body]=${title} - ${short_link} |
templates[twitter][related] |
Suggested Twitter Accounts (requires a plan) |
Optional | templates[twitter][related]=my_twitter_handle,my_other_twitter |
templates[email][body] |
E-mail Template | Optional | templates[email][body]=${link} |
templates[email][subject] |
E-mail Subject | Optional | templates[email][subject]=${title} |
templates[whatsapp][text] |
WhatsApp Template | Optional | templates[whatsapp][text]=${title} - ${short_link} |
templates[whatsapp][phone] |
Phone Number | Optional | templates[whatsapp][phone]=1617XXXXXXX |
tags |
Tags | Optional | tags=programming,python,howto |
source |
Source | Optional | source=shareaholic |
Working Example (posting a link to Facebook):
<a href="https://www.shareaholic.com/api/share/?v=1&apitype=1&apikey=8943b7fd64cd8b1770ff5affa9a9437b&service=5&title=What%20Do%20Your%20Customers%20Want%20to%20Buy%3F&link=https://nextviewventures.com/blog/what-do-your-customers-want-to-buy/&source=Shareaholic" target="_blank">Post to Facebook</a>
Give it a try: Post to Facebook
Notes:
link
,short_link
,title
, andnotes
parameters should be URL-encoded, plain text, no HTML, UTF-8. You can not include a parameter value in the request that has '&', '?', '#', ' ', or other reserved parameters without first encoding it.- Parameters should not contain spaces: any parameter with spaces will be rejected. All spaces should be either percent encoded (%20) or plus encoded (+). Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before posting.
- Parameters must have a slash between the domain and the path component. For example, https://example.com?query=parameter is invalid, and instead should be formatted as https://example.com/?query=parameter
link
parameter value should be a complete URL and not a shortened link (like a bit.ly short link). You should always pass shortened links (ex. you may want to do this for Twitter) through theshort_link
parameter.templates[twitter][related]
parameter value should be a valid Twitter handle, without the '@' or any whitespace. Multiple Twitter accounts can be added as a comma-separated list of values with no spaces in between.
Link Tracking & URL Shorteners
Shareaholic can automatically shorten the link
for you using a supported shortening service that you specify.
...&shortener=bitly...
We currently support the following shorteners/parameter values:
shortener= | Description |
---|---|
tinyurl | |
bitly | Includes support for custom bitly domains |
jmp | |
shrlc | Default |
none | Do not shorten link |
You can further customize this option with your own bitly or j.mp account by setting the shortener_key
parameter. If you set this parameter, the API will use your personal bitly generic access token to shorten the link.
...&shortener=bitly&shortener_key=9602e640dc831a9f32b68e570acffdbeccb1b760&...
For those of you that are using older versions of Bitly (where your token starts with "R_"), you will need to pass your Bitly username as well:
shortener_key
format: username|R_token (i.e. delimited by "|").
Note that we only shorten links for services where it is appropriate (i.e. sharing to Twitter, but not Reddit). Also, if you would prefer not to publicize your shortener keys, you can setup your URL Shortener preferences and keys in your Shareaholic Admin Console. This is also the only way to setup a Bitly Custom Domain. If you do not pass the shortener
and shortener_key
parameters when calling the API call, the API will automatically lookup your saved cloud settings linked to your API Key, including the Bitly Custom Domain.
Templates i.e. customize your Tweets, Emails
By specifying a templates[][]
API parameter, you can customize the default post format for services that support templates. Specifying a template
is completely optional. The following services currently support templates:
- Email (also covers Gmail, Yahoo Mail, Outlook and AOL Mail)
The Share API supports a few different tokens in a template — you can use all, some, or none of them:
Template Token | Description |
---|---|
${title} | Title of the page |
${link} | Link to the page |
${short_link} | Shortened link to the page |
${notes} | Any text; usually a very short summary of the link or user selected text |
Sample template
for Twitter:
...&templates[twitter][body]=Reading: ${title} (${short_link}) via @Shareaholic %23api %23devtools&...
Result:
Give it a try: Tweet this!
Suggested Twitter Accounts
By specifying the templates[twitter][related]
API parameter, you can specify Twitter accounts to appear in the "Recommend Twitter Accounts" page that appears after a user shares your content via Twitter. This feature is currently available for Pro Subscribers only.
To specify Twitter accounts to be recommended, enter a comma-separated list of Twitter handles, omitting the '@' sign and any whitespace.
Sample templates[twitter][related]
for Twitter:
...&templates[twitter][related]=my_twitter_handle,my_other_twitter...
Tags (describe your content)
Use the optional tags
API parameter to further describe the content/URL being shared. Amongst many other benefits, you will get back more useful analytics tracking reports as a result.
tags
takes a set of comma-separated values (CSV) with no trailing comma. Commas inside tag values MUST be URL encoded (as %2C) and commas separating tags MUST NOT be encoded. For example, the tags "python", "conference" and "Boston, MA" should be passed as:
...&tags=python,conference,boston%2Cma&...
You can pass in as many tags as you'd like, but we've found 3-5 to be most optimal.
Destination Services
Service | Service ID | Service Code |
---|---|---|
Amazon (CA) Wish List | 271 | amazon_ca_wish_list |
Amazon (DE) Wish List | 272 | amazon_de_wish_list |
Amazon (FR) Wish List | 273 | amazon_fr_wish_list |
Amazon (JP) Wish List | 274 | amazon_jp_wish_list |
Amazon (UK) Wish List | 270 | amazon_uk_wish_list |
Amazon (US) Wish List | 200 | amazon_us_wish_list |
Amazon Kindle It | 971 | kindle_it |
Amazon Universal Registry | 296 | amazon_universal_registry |
AOL Mail | 55 | aol_mail |
Baidu | 995 | baidu |
Bitly | 208 | bit_ly |
Blogger Post | 219 | blogger_post |
Box | 240 | box_net |
Buffer | 308 | buffer |
Delicious | 2 | delicious |
Digg | 3 | digg |
Diigo | 24 | diigo |
Diigolet | 227 | diigolet |
Email This | 313 | email_this |
Evernote | 191 | evernote |
5 | ||
Facebook Messenger | 305 | facebook_messenger |
Fancy | 954 | fancy |
Fark | 62 | fark |
951 | ||
Google Apps Mail | 260 | google_apps_mail |
Google Bookmarks | 74 | google_bookmarks |
Google Classroom | 990 | google_classroom |
Google Mail | 52 | google_mail |
Hacker News | 202 | yc_hacker_news |
HootSuite | 261 | hootsuite |
Houzz | 957 | houzz |
Instapaper | 18 | instapaper |
Kik | 997 | kik |
Line | 996 | line_me |
88 | ||
201 | ||
Meneame | 33 | meneame |
MeWe | 1013 | mewe |
Microsoft OneNote | 973 | onenote |
Mix | 999 | mix |
Mixi | 970 | mixi |
Odnoklassniki | 967 | odnoklassniki |
Outlook | 53 | hotmail |
Parler | 1014 | parler |
Pinboard.in | 256 | pinboard_in |
309 | ||
Plurk | 218 | plurk |
239 | ||
998 | ||
PrintFriendly | 236 | printfriendly |
Read Later | 311 | shareaholic_archive |
40 | ||
Sina Weibo | 969 | |
Skype | 989 | skype |
SMS | 975 | sms |
Snapchat | 1003 | snapchat |
Soup.io | 217 | soup_io |
Stumpedia | 192 | stumpedia |
Symphony | 972 | symphony |
Techmeme | 204 | techmeme |
Telegram | 1000 | telegram |
TinyURL | 223 | tinyurl |
Trello | 1008 | trello |
Tumblr | 78 | tumblr |
7 | ||
TypePad Post | 220 | typepad_post |
Viadeo | 92 | viadeo |
Viber | 1007 | viber |
VK | 953 | vk |
Wanelo | 952 | wanelo |
We Heart It | 212 | we_heart_it |
1009 | ||
974 | ||
WordPress Blog | 230 | wordpress_blog |
Wykop | 285 | wykop |
968 | ||
Yahoo! Mail | 54 | yahoo_mail |
Yammer | 253 | yammer |
Yummly | 956 | yummly |
Feedback
If you believe you have found a bug, or you’d like to request additional functionality, or you release something using this API, we’d love to hear from you.