Use the Universal Share API to share content to 100+ supported destinations.

100% free to use, reliable, fast. Used by millions every day.

Universal Share API

Get More Traffic

You've already got an audience that loves your content, product or service. Profit from helping them tell the world about it. The Universal Share API will enable your visitors to share articles, comments, purchases or other activities from your site to their friends on multiple social networks. This API is free to use (premium upgrades 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.

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 Required service=7 (lookup codes)
link Link Required link=http://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=http://www.yoursite.com/logo.png
short_link Shortened Link Optional short_link=http://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 Optional (available for PRO users only) 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}
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=The%20Hottest%20VC%20No%20One%20Has%20Ever%20Heard%20Of&link=http://www.robgo.org/post/376467064/the-hottest-vc-no-one-has-ever-heard-of&shortener=bitly&source=Shareaholic&" target="_blank">Post to Facebook</a>

Give it a try: Post to Facebook

Notes:

  • link, short_link, title, and notes 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, http://example.com?query=parameter is invalid, and instead should be formatted as http://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 the short_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
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. If you do not set the shortener and shortener_key parameters, the API will use your saved cloud settings linked to your API Key automatically.

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:

  • Twitter
  • 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 Service Codes

Popular Services:

Service Service Code ID
Facebook 5
Twitter 7
Pinterest 309
LinkedIn 88
Google Bookmarks 74
Google Mail 52
PrintFriendly 236
WhatsApp 974
WeChat 1009

Lookup codes for 100+ other services →

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.

As featured on