curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook
const url = "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook";
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer API_KEY'
}
});
import requests
url = 'https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook'
headers = {'Authorization': 'Bearer API_KEY'}
response = requests.get(url, headers=headers)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer API_KEY'));
$response = curl_exec($ch);
curl_close($ch);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace HistorySocialIdGETRequest_csharp
{
class HistorySocialId
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, err := client.Do(req)
require 'net/http'
require 'uri'
uri = URI.parse("https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook")
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
[
{
"commentsCount": 0,
"created": "2024-01-25T23:01:23Z",
"from": {
"name": "Ayrshare",
"id": "18930271191"
},
"id": "18930271191_39392923",
"mediaUrls": [
{
"media": {
"image": {
"height": 720,
"src": "https://scontent-lga3-2.xx.fbcdn.net/v/...",
"width": 405
},
"source": "https://video-lga3-2.xx.fbcdn.net/o1/..."
},
"title": "🔥 Sneaker time!"
}
],
"messageTags": [
{
"id": "434786466522",
"name": "#sneakerswap365",
"offset": 242,
"length": 15
}
],
"post": "🔥 Sneaker Time for all!",
"postUrl": "https://www.facebook.com/reel/72681340799/",
"lastUpdated": "2024-01-25T23:29:58.014Z",
"nextUpdate": "2024-01-25T23:40:58.014Z"
}
]
{
"action": "get",
"status": "error",
"code": 221,
"message": "The ID was not found. Please verify the id, API or Profile Keys, and required parameters.",
"id": "7268134079",
"lastUpdated": "2024-01-25T23:45:14.311Z",
"nextUpdate": "2024-01-25T23:56:14.311Z"
}
History
按 Social ID 查询帖子历史
获取并非通过 Ayrshare 发布的帖子的历史记录。
GET
/
history
/
:socialId
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook
const url = "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook";
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer API_KEY'
}
});
import requests
url = 'https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook'
headers = {'Authorization': 'Bearer API_KEY'}
response = requests.get(url, headers=headers)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer API_KEY'));
$response = curl_exec($ch);
curl_close($ch);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace HistorySocialIdGETRequest_csharp
{
class HistorySocialId
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, err := client.Do(req)
require 'net/http'
require 'uri'
uri = URI.parse("https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook")
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
[
{
"commentsCount": 0,
"created": "2024-01-25T23:01:23Z",
"from": {
"name": "Ayrshare",
"id": "18930271191"
},
"id": "18930271191_39392923",
"mediaUrls": [
{
"media": {
"image": {
"height": 720,
"src": "https://scontent-lga3-2.xx.fbcdn.net/v/...",
"width": 405
},
"source": "https://video-lga3-2.xx.fbcdn.net/o1/..."
},
"title": "🔥 Sneaker time!"
}
],
"messageTags": [
{
"id": "434786466522",
"name": "#sneakerswap365",
"offset": 242,
"length": 15
}
],
"post": "🔥 Sneaker Time for all!",
"postUrl": "https://www.facebook.com/reel/72681340799/",
"lastUpdated": "2024-01-25T23:29:58.014Z",
"nextUpdate": "2024-01-25T23:40:58.014Z"
}
]
{
"action": "get",
"status": "error",
"code": 221,
"message": "The ID was not found. Please verify the id, API or Profile Keys, and required parameters.",
"id": "7268134079",
"lastUpdated": "2024-01-25T23:45:14.311Z",
"nextUpdate": "2024-01-25T23:56:14.311Z"
}
通过提供底层 Social post ID,获取并非通过 Ayrshare 发布的帖子的历史记录。Social Post ID 在 post 接口响应的
postIds 字段中返回,或来自获取全部历史接口的 id 字段,或来自帖子 URL 中的 ID,例如这条 Facebook 帖子。
已关联的账户必须是该帖子的所有者,才能获取其历史记录。
支持的平台:Facebook、Instagram、LinkedIn、Threads、TikTok、Twitter 和 YouTube,对应的 platform 取值为:facebook、instagram、linkedin、threads、tiktok、twitter、youtube。
请求头参数
路径参数
帖子的 Social Post ID。
Facebook Social Post ID
104923907983682_108329000309742 的另一个示例
请参见 /post 接口 的 Response 200。查询参数
始终为
true取值:
facebook、instagram、linkedin、threads、tiktok、twitter、youtubecurl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook
const url = "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook";
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer API_KEY'
}
});
import requests
url = 'https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook'
headers = {'Authorization': 'Bearer API_KEY'}
response = requests.get(url, headers=headers)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer API_KEY'));
$response = curl_exec($ch);
curl_close($ch);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace HistorySocialIdGETRequest_csharp
{
class HistorySocialId
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, err := client.Do(req)
require 'net/http'
require 'uri'
uri = URI.parse("https://api.ayrshare.com/api/history/104923907983682_108329000309742?searchPlatformId=true&platform=facebook")
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
[
{
"commentsCount": 0,
"created": "2024-01-25T23:01:23Z",
"from": {
"name": "Ayrshare",
"id": "18930271191"
},
"id": "18930271191_39392923",
"mediaUrls": [
{
"media": {
"image": {
"height": 720,
"src": "https://scontent-lga3-2.xx.fbcdn.net/v/...",
"width": 405
},
"source": "https://video-lga3-2.xx.fbcdn.net/o1/..."
},
"title": "🔥 Sneaker time!"
}
],
"messageTags": [
{
"id": "434786466522",
"name": "#sneakerswap365",
"offset": 242,
"length": 15
}
],
"post": "🔥 Sneaker Time for all!",
"postUrl": "https://www.facebook.com/reel/72681340799/",
"lastUpdated": "2024-01-25T23:29:58.014Z",
"nextUpdate": "2024-01-25T23:40:58.014Z"
}
]
{
"action": "get",
"status": "error",
"code": 221,
"message": "The ID was not found. Please verify the id, API or Profile Keys, and required parameters.",
"id": "7268134079",
"lastUpdated": "2024-01-25T23:45:14.311Z",
"nextUpdate": "2024-01-25T23:56:14.311Z"
}
⌘I
