curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.nytimes.com"}' \
-X POST https://api.ayrshare.com/api/feed
const API_KEY = "API_KEY";
const url = "https:///www.nytimes.com";
fetch("https://api.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://api.ayrshare.com/api/feed',
json=payload,
headers=headers)
print(r.json())
$curl = curl_init();
$data = array (
'url' => 'https://www.nytimes.com'
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.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;
{
"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."
}
Feed
新增 RSS Feed
新增一個 RSS Feed,用於自動發布新的文章
POST
/
feed
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.nytimes.com"}' \
-X POST https://api.ayrshare.com/api/feed
const API_KEY = "API_KEY";
const url = "https:///www.nytimes.com";
fetch("https://api.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://api.ayrshare.com/api/feed',
json=payload,
headers=headers)
print(r.json())
$curl = curl_init();
$data = array (
'url' => 'https://www.nytimes.com'
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.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;
{
"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."
}
新增一個 RSS Feed,用於自動發布新的文章。貼文會自動發送到你已連結的社群帳號:Facebook、LinkedIn 與 Telegram。若文章中能找到有效的圖片,也會發送到 Instagram 與 Pinterest。
Header 參數
Body 參數
欲新增的 RSS Feed 網址。
嘗試取得文章中的第一張或最上方的圖片,並加入貼文中。
根據最相關的關鍵字,自動為貼文文字加入最多 3 個 hashtag。
值:
rss、substack 或 youtube。要發布文章的社群平台。若未提供,則預設為所有已連結的平台。可用平台:
{
"platforms": ["facebook", "instagram",
"linkedin", "pinterest"]
}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.nytimes.com"}' \
-X POST https://api.ayrshare.com/api/feed
const API_KEY = "API_KEY";
const url = "https:///www.nytimes.com";
fetch("https://api.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://api.ayrshare.com/api/feed',
json=payload,
headers=headers)
print(r.json())
$curl = curl_init();
$data = array (
'url' => 'https://www.nytimes.com'
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.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;
{
"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."
}
⌘I
