API Overview

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

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, Twitter, LinkedIn, Instagram, YouTube, 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.

  • Post images and videos.

  • Delete posts on linked social networks.

  • Auto shorten links in posts or shorten specific links.

  • 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.

  • Send posts on a predetermined automated schedule.

  • Get history of posts and their status.

  • Add or delete an RSS feed for automated posted (all new feed items).

  • Upload media (photos and videos) to media gallery to be used in posts.

Business Plan

As a business member, you can manage multiple account profiles for your business or clients.

  • Post to multiple profile accounts with one API call.

  • Create and delete profiles via the API.

  • Allow your users to connect their social media accounts.

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
cURL
curl -H "Authorization: Bearer API_KEY" https://app.ayrshare.com
Node.js
headers: {"Authorization": "Bearer API_KEY"}
Python
headers = {'Authorization': 'Bearer API_KEY'}
PHP
'headers' => ['Authorization' => 'Bearer API_KEY']
Go
req.Header.Add("Authorization", "Bearer API_KEY")

Obtain your secret API key in the web interface dashboard under API Key.

Content-Type

Data should always be passed as Content-Type: "application/json"

cURL
Node.js
Python
PHP
Go
cURL
curl -H "Content-Type: application/json" https://app.ayrshare.com
Node.js
headers: {"Content-Type": "application/json"}
Python
headers = {'Content-Type': 'application/json'}
PHP
'headers' => ['Content-Type' => 'application/json']
Go
req.Header.Add("Content-Type", "application/json; charset=UTF-8")

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 & Hoppscotch

You can use Postman or Hoppscotch 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.