feed
Feed API Endpoint: Add and delete RSS feeds for automated posting.
Feed API Endpoint
❗Click the › in the endpoint to view details.
Premium or Business plan required.
Add an RSS Feed
POST
https://app.ayrshare.com/api/feed
Add a new RSS feed for automated posting of new articles. Posts will be automatically sent to your linked social accounts: Facebook, Twitter, LinkedIn, and Telegram. Also Instagram and Pinterest if a valid image can be found in the article.
Headers
Request Body
{
"status": "success",
"id": "4HZhptaD5",
"title": "Pulte's Money and Life Thoughts",
"websiteLink": "https://pulte.substack.com",
"rssURL": "https://pulte.substack.com/feed"
}
{
"action": "create",
"status": "error",
"code": 303,
"message": "The feed https://ruthreichl.substack.com/feed already exists.",
"id": "TDW3oMDoI"
}
{
"action": "create",
"status": "error",
"code": 130,
"message": "Something is wrong with the RSS feed URL. Please verify it."
}
Request Examples
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.nytimes.com"}' \
-X POST https://app.ayrshare.com/api/feed
const fetch = require("node-fetch");
const API_KEY = "API_KEY";
const url = "https:///www.nytimes.com";
fetch("https://app.ayrshare.com/api/feed", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({ url }),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'url': 'https://www.nytimes.com'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://app.ayrshare.com/api/feed',
json=payload,
headers=headers)
print(r.json())
<?php
$curl = curl_init();
$data = array (
'url' => 'https://www.nytimes.com'
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.ayrshare.com/api/feed',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Delete RSS Feed
DELETE
https://app.ayrshare.com/api/feed
Delete an RSS Feed that was previously added
Headers
Request Body
{
"status": "success",
"id": "RDFbD_fl5"
}
{
"action": "delete",
"status": "error",
"code": 131,
"message": "Something is wrong deleting the RSS feed URL. Please try again and verify the id."
}
Request Examples
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "4HZhptaD5"}' \
-X DELETE https://app.ayrshare.com/api/feed
const fetch = require("node-fetch");
const API_KEY = "API_KEY";
const id = "4HZhptaD5";
fetch("https://app.ayrshare.com/api/feed", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({ id }),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': '4HZhptaD5'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://app.ayrshare.com/api/feed',
json=payload,
headers=headers)
print(r.json())
<?php
$curl = curl_init();
$data = array (
'id' => '_3yhtyd88'
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.ayrshare.com/api/feed',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Get RSS Feeds
GET
https://app.ayrshare.com/api/feed
Get all registered RSS feeds.
Headers
{
{
"status": "success",
"feeds": [
{
"autoHashtag": false,
"created": "2022-05-16T23:20:03.405Z",
"description": "Social Media APIs that enable you to send social media posts effortlessly",
"id": "_3yhtyd88",
"image": {
"height": "32",
"link": "https://www.ayrshare.com",
"title": "Ayrshare",
"width": "32",
"url": "https://www.ayrshare.com/wp-content/uploads/2020/07/cropped-ayr-icon-2FKLDFB-32x32.png"
},
"link": "https://www.ayrshare.com",
"title": "Ayrshare",
"type": "rss",
"updated": "2022-05-16T23:20:17.124Z",
"url": "https://www.ayrshare.com/feed/",
"useFirstImage": true
}
]
}
Request Examples
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://app.ayrshare.com/api/feed
const fetch = require("node-fetch");
const API_KEY = "API_KEY";
fetch("https://app.ayrshare.com/api/feed", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://app.ayrshare.com/api/feed', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.ayrshare.com/api/feed',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
using System;
using System.Net;
using System.IO;
namespace UserGETRequest_charp
{
class User
{
static void Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://app.ayrshare.com/api/feed";
var httpWebRequest = WebRequest.CreateHttp(url);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Headers.Add("Authorization", "Bearer " + API_KEY);
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var response = streamReader.ReadToEnd();
Console.WriteLine(response);
}
}
}
}
Update RSS Feed
PUT
https://app.ayrshare.com/api/feed
Update an RSS feed.
Headers
Request Body
{
"status": "success",
"id": "vVYX3cgJ7"
}
{
"action": "update",
"status": "error",
"code": 304,
"message": "The feed with id vVYX3cgJ does not exist."
}
Request Examples
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "4HZhptaD5", "useFirstImage": true, "autoHashtag": true}' \
-X PUT https://app.ayrshare.com/api/feed
const fetch = require("node-fetch");
const API_KEY = "API_KEY";
const id = "4HZhptaD5";
fetch("https://app.ayrshare.com/api/feed", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({ id, "useFirstImage": true, "autoHashtag": true }),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.err
import requests
payload = {'id': '4HZhptaD5', 'useFirstImage': True, 'autoHashtag': True}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.put('https://app.ayrshare.com/api/feed',
json=payload,
headers=headers)
print(r.json())
<?php
$curl = curl_init();
$data = array (
'id' => '_3yhtyd88',
'useFirstImage' => false,
'autoHashtag' => true
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.ayrshare.com/api/feed',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Subscribe a Webhook
POST
https://app.ayrshare/com/api/feed/webhook
Subscribe a webhook url that will be called whenever a new RSS items is available. Note: if the webhook is active, new RSS items will not be automatically posted. Deactivate the webhook by posting empty string "" in the url parameter.
Path Parameters
Request Body
{
"status": "success"
}
Return of the webhook data of the RSS article. refId
references the ID in the /user endpoint:
{
"type": "feed",
"refId": "140b8700bd6ade089b242d845e268fb886130c53",
"title": "Title of profile if available",
"data": { ... }
}
Last updated