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, Reddit, and Telegram.

Key functionality includes:

  • Authorized access based on your secret API Key (obtained at ayrshare.com).

  • Publish posts immediately or scheduled future posts on linked social networks.

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

  • Get history of posts and their status.

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

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

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

Authentication

Ayrshare authenticates API requests via an Authorization token in passed the HTTP header.

HTTP Header Format: Authorization: Bearer [API Key]

cURL
Node.js
Python
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]'}
Go
req.Header.Add("Authorization", "Bearer [API_KEY]")

Obtain your secret API key in the web interface.

Content-Type

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

cURL
Node.js
Python
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'}
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

You can use Postman to test your REST API calls.

Be sure to set your Authorization: Bearer [API Key] value in the header.