API Overview
Powerful APIs that enable you to send social media posts effortlessly. For developers and businesses of all sizes.

Ayrshare's REST API

The REST API allows programmatic access to the functionality of Ayrshare, such as posting and deleting status updates to multiple social network simultaneously and managing your media images. Current social networks supported are Facebook Pages and Groups, Twitter, LinkedIn, Instagram, YouTube, Google My Business, Reddit, and Telegram.

Key Functionality

  • Authorized access based on your secret API Key (obtained at ayrshare.com).
  • Publish posts immediately or scheduled future posts on linked social networks.
  • Send posts on a predetermined automated schedule.
  • Post images and videos.
  • Delete posts on linked social networks.
  • Analytics on post engagement, likes, shares, and more.
  • Get and add comments to posts.
  • Auto shorten links in posts or shorten specific links.
  • TweetStorms for longer Tweets using Twitter Threads.
  • Add specific Unsplash images or randomly select an Unsplash image based on a search term.
  • Automatically add hashtags to your posts based on the most relevant key words.
  • Get history of posts and their status, even post that did't go through Ayrshare.
  • Add or delete an RSS feeds for automated posts.
  • Upload media (photos and videos) to media gallery to be used in posts.

Business Plan

As a business plan member, you can manage multiple user/client profiles for your platform.
  • Allow your users to connect their social media accounts.
  • Post to multiple user profiles with one API call.
  • Create and delete user profiles via the API.
  • Advanced User Analytics and Webhooks.
Learn more about the Business Plan.

Watch How to Use the API

If you're building in Node.js, check out this video on how to connect and post to Twitter and Facebook.

Authorization

Ayrshare authenticates API requests via an Authorization token passed in the HTTP header. Please be sure to send Bearer with the API Key.
HTTP Header Format: Authorization: Bearer API_KEY
cURL
Node.js
Python
PHP
Go
1
curl -H "Authorization: Bearer API_KEY" https://app.ayrshare.com
Copied!
1
headers: {"Authorization": "Bearer API_KEY"}
Copied!
1
headers = {'Authorization': 'Bearer API_KEY'}
Copied!
1
'headers' => ['Authorization' => 'Bearer API_KEY']
Copied!
1
req.Header.Add("Authorization", "Bearer API_KEY")
Copied!
Obtain your secret API key in the web interface dashboard under API Key.
For example, if your API Key is 2MPXPKQ-S03M5LS-GR5RX5G-AZCK8EA
Your header should include:
Authorization: Bearer 2MPXPKQ-S03M5LS-GR5RX5G-AZCK8EA

Content-Type

Data should always be passed as Content-Type: "application/json"
cURL
Node.js
Python
PHP
Go
1
curl -H "Content-Type: application/json" https://app.ayrshare.com
Copied!
1
headers: {"Content-Type": "application/json"}
Copied!
1
headers = {'Content-Type': 'application/json'}
Copied!
1
'headers' => ['Content-Type' => 'application/json']
Copied!
1
req.Header.Add("Content-Type", "application/json")
Copied!

Accept-Encoding

Optional: Add an Accept-Encoding header to compress the response with Accept-Encoding: "deflate, gzip". Please be sure you can properly uncompress the response.
cURL
Node.js
Python
PHP
Go
1
curl -H "Accept-Encoding: deflate, gzip" https://app.ayrshare.com
Copied!
1
headers: {"Accept-Encoding": "deflate, gzip"}
Copied!
1
headers = {'Accept-Encoding': 'deflate, gzip'}
Copied!
1
'headers' => ['Accept-Encoding' => 'deflate, gzip']
Copied!
1
req.Header.Add("Accept-Encoding", "deflate, gzip")
Copied!

Error Codes

Errors will return with standard HTTP status codes.
For more information:
Detailed Errors are in the REST API response specific for each type of call.
For more information:

Postman

You can use Postman to test your REST API calls.

Packages

We have both Node.js & Python packages and Bubble.io and Airtable guides available to make the RESTful calls easier.