{
// Facebook Social Post ID
"id": "104923907983682_108329000309742",
"platforms": [
// Select only one platform at a time:
// facebook, instagram, youtube, threads, tiktok, or twitter
"facebook"
],
"searchPlatformId": true // Required
}
{
// Array of Social Post IDs (max 100)
"postIds": ["1979851549871354062", "2011793803951137234"],
"platforms": [
// Select only one platform at a time:
// facebook, instagram, youtube, threads, tiktok, or twitter
"twitter"
],
"searchPlatformId": true // Required
}
{
/**
The response is the same as Analytics on a Post.
Please see that endpoint for details.
Note: Some metrics are not available for posts not owned by the authorized account.
For example: X does not return non-public metrics or organic metrics for Tweets not sent by the authorized user.
*/
}
{
"twitter": [
{
"id": "1313589441919827982", // Twitter Social Post ID
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"entities": {
"urls": [
{
"start": 77,
"end": 96,
"url": "https://t.co/abc123",
"expandedUrl": "https://www.ayrshare.com/docs",
"displayUrl": "ayrshare.com/docs",
"unwoundUrl": "https://www.ayrshare.com/docs"
}
],
"hashtags": [
{
"start": 97,
"end": 112,
"tag": "SocialMediaAPI"
}
],
"mentions": [
{
"start": 113,
"end": 122,
"username": "ayrshare"
}
]
},
"name": "Wonder World",
"post": "Just launched our social media campaign using Ayrshare! Check out the API at https://t.co/abc123 #SocialMediaAPI @ayrshare",
"publicMetrics": {
"retweetCount": 0,
"quoteCount": 0,
"likeCount": 0,
"replyCount": 0,
"bookmarkCount": 0,
"impressionCount": 23
},
"nonPublicMetrics": {
"userProfileClicks": 1,
"engagements": 1,
"impressionCount": 5
},
"organicMetrics": {
"likeCount": 0,
"impressionCount": 5,
"replyCount": 0,
"retweetCount": 0,
"userProfileClicks": 1
},
"username": "wondrous"
},
"lastUpdated": "2022-04-23T18:44:29.778Z",
"nextUpdate": "2022-04-23T19:19:29.778Z"
},
{
"id": "1313589441919827999", // Twitter Social Post ID
"postUrl": "https://www.twitter.com/myaccount/1313589441919827999",
"analytics": {
"created": "2022-09-08T14:30:00.000Z",
"name": "Wonder World",
"post": "Another great day for social media automation!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"nonPublicMetrics": {
"userProfileClicks": 8,
"engagements": 12,
"impressionCount": 145
},
"organicMetrics": {
"likeCount": 15,
"impressionCount": 145,
"replyCount": 3,
"retweetCount": 5,
"userProfileClicks": 8
},
"username": "wondrous"
},
"lastUpdated": "2022-04-23T18:44:29.778Z",
"nextUpdate": "2022-04-23T19:19:29.778Z"
}
],
"status": "success",
"code": 200
}
{
"twitter": [
{
"id": "1313589441919827982",
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"name": "Wonder World",
"post": "Just launched our social media campaign!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"username": "wondrous",
"backfilledFrom": "2026-04-08T14:30:00.000Z"
},
"lastUpdated": "2026-04-09T10:15:00.000Z",
"nextUpdate": "2026-04-09T10:26:00.000Z"
}
],
"status": "success",
"code": 200
}
{
"twitter": [
{
"id": "1313589441919827982",
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"name": "Wonder World",
"post": "Just launched our social media campaign!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"username": "wondrous",
"recoveredFrom": "2026-04-08T14:30:00.000Z"
},
"lastUpdated": "2026-04-09T10:15:00.000Z",
"nextUpdate": "2026-04-09T10:26:00.000Z"
}
],
"status": "success",
"code": 200
}
{
"lastUpdated": "2023-12-08T03:40:31.185Z",
"nextUpdate": "2023-12-08T03:51:31.185Z",
"youtube": {
"action": "post",
"status": "error",
"code": 186,
"message": "Post ID not found. Please verify the top level ID returned from the /post endpoint is being sent, the Profile Key is included if applicable, and the post at the social network has not been deleted. If you are trying to retrieve a post originating outside of Ayrshare, please use the /rest-api/endpoints/analytics#analytics-by-social-id",
"id": "dtuu-jDp4381"
}
}
Analytics
依 Social ID 取得貼文分析
使用 Social Post ID 取得貼文的即時分析
POST
/
analytics
/
post
{
// Facebook Social Post ID
"id": "104923907983682_108329000309742",
"platforms": [
// Select only one platform at a time:
// facebook, instagram, youtube, threads, tiktok, or twitter
"facebook"
],
"searchPlatformId": true // Required
}
{
// Array of Social Post IDs (max 100)
"postIds": ["1979851549871354062", "2011793803951137234"],
"platforms": [
// Select only one platform at a time:
// facebook, instagram, youtube, threads, tiktok, or twitter
"twitter"
],
"searchPlatformId": true // Required
}
{
/**
The response is the same as Analytics on a Post.
Please see that endpoint for details.
Note: Some metrics are not available for posts not owned by the authorized account.
For example: X does not return non-public metrics or organic metrics for Tweets not sent by the authorized user.
*/
}
{
"twitter": [
{
"id": "1313589441919827982", // Twitter Social Post ID
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"entities": {
"urls": [
{
"start": 77,
"end": 96,
"url": "https://t.co/abc123",
"expandedUrl": "https://www.ayrshare.com/docs",
"displayUrl": "ayrshare.com/docs",
"unwoundUrl": "https://www.ayrshare.com/docs"
}
],
"hashtags": [
{
"start": 97,
"end": 112,
"tag": "SocialMediaAPI"
}
],
"mentions": [
{
"start": 113,
"end": 122,
"username": "ayrshare"
}
]
},
"name": "Wonder World",
"post": "Just launched our social media campaign using Ayrshare! Check out the API at https://t.co/abc123 #SocialMediaAPI @ayrshare",
"publicMetrics": {
"retweetCount": 0,
"quoteCount": 0,
"likeCount": 0,
"replyCount": 0,
"bookmarkCount": 0,
"impressionCount": 23
},
"nonPublicMetrics": {
"userProfileClicks": 1,
"engagements": 1,
"impressionCount": 5
},
"organicMetrics": {
"likeCount": 0,
"impressionCount": 5,
"replyCount": 0,
"retweetCount": 0,
"userProfileClicks": 1
},
"username": "wondrous"
},
"lastUpdated": "2022-04-23T18:44:29.778Z",
"nextUpdate": "2022-04-23T19:19:29.778Z"
},
{
"id": "1313589441919827999", // Twitter Social Post ID
"postUrl": "https://www.twitter.com/myaccount/1313589441919827999",
"analytics": {
"created": "2022-09-08T14:30:00.000Z",
"name": "Wonder World",
"post": "Another great day for social media automation!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"nonPublicMetrics": {
"userProfileClicks": 8,
"engagements": 12,
"impressionCount": 145
},
"organicMetrics": {
"likeCount": 15,
"impressionCount": 145,
"replyCount": 3,
"retweetCount": 5,
"userProfileClicks": 8
},
"username": "wondrous"
},
"lastUpdated": "2022-04-23T18:44:29.778Z",
"nextUpdate": "2022-04-23T19:19:29.778Z"
}
],
"status": "success",
"code": 200
}
{
"twitter": [
{
"id": "1313589441919827982",
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"name": "Wonder World",
"post": "Just launched our social media campaign!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"username": "wondrous",
"backfilledFrom": "2026-04-08T14:30:00.000Z"
},
"lastUpdated": "2026-04-09T10:15:00.000Z",
"nextUpdate": "2026-04-09T10:26:00.000Z"
}
],
"status": "success",
"code": 200
}
{
"twitter": [
{
"id": "1313589441919827982",
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"name": "Wonder World",
"post": "Just launched our social media campaign!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"username": "wondrous",
"recoveredFrom": "2026-04-08T14:30:00.000Z"
},
"lastUpdated": "2026-04-09T10:15:00.000Z",
"nextUpdate": "2026-04-09T10:26:00.000Z"
}
],
"status": "success",
"code": 200
}
{
"lastUpdated": "2023-12-08T03:40:31.185Z",
"nextUpdate": "2023-12-08T03:51:31.185Z",
"youtube": {
"action": "post",
"status": "error",
"code": 186,
"message": "Post ID not found. Please verify the top level ID returned from the /post endpoint is being sent, the Profile Key is included if applicable, and the post at the social network has not been deleted. If you are trying to retrieve a post originating outside of Ayrshare, please use the /rest-api/endpoints/analytics#analytics-by-social-id",
"id": "dtuu-jDp4381"
}
}
提供底層的 Social Post ID,即可取得非透過 Ayrshare 發送之貼文的分析。
此 ID 會回傳在 /post 端點的
postIds 欄位中。
要取得分析資料,已連結的帳號必須是該貼文的擁有者(例外:YouTube;請見下方說明)。支援的平台:Facebook、Instagram、LinkedIn、Threads、TikTok、Twitter 與 YouTube。
- 呼叫方式與貼文分析端點相同。主要差異在於使用社群網路回傳的 post id,而不是 Ayrshare ID。同時需加上
searchPlatformId: true參數,告知端點你是以 Social Post ID 進行查詢。 - 使用取得全部貼文歷史端點,可取回非透過 Ayrshare 發送的貼文,這些貼文的 ID 位於
id欄位。 - 建議僅對非透過 Ayrshare 發送的貼文使用此端點。對於透過 Ayrshare 發送的貼文,請使用分析端點。
- 在使用者帳號由個人帳號轉為商業帳號之前所發布的 Instagram 貼文,其分析資料有限。
- 若你透過 social id 方法取得不屬於自己頻道的 YouTube 貼文分析,API 會回傳關於該內容的描述性中繼資料,但所有數值指標都會顯示為零。描述性資訊(例如標題、描述、標籤、頻道名稱、隱私狀態、縮圖 URL)會正確填入,提供影片內容的上下文;然而所有數值型表現指標,包括觀看、按讚、留言、分享、訂閱者變化、觀看時間與播放清單新增,都會回傳為零。
- 當你對 X/Twitter Thread 使用
postIds時,Thread 中每則 Tweet 的 Social Post ID 都必須個別提供;查詢父貼文並不會自動包含 Thread 中的其他 Tweet。
標頭參數
主體參數
必須提供
id 或 postIds 其一。對單一貼文使用 id;若要在單一請求中取得多則貼文的分析,請使用 postIds。由 /post 端點回傳的 Social Post ID。這是
postIds 陣列中個別社群網路的 id 欄位。id 與 postIds 至少必須提供其一。Social Post ID 陣列,可在單一請求中取得多則貼文的分析。最多允許 100 個 ID。
id 與 postIds 至少必須提供其一。{
"postIds": ["1979851549871354062", "2011793803951137234"]
}
要取得分析的平台字串陣列。僅允許一個值。可用值:
{
"platforms": ["facebook", "instagram", "linkedin", "threads",
"tiktok", "twitter", "youtube"]
}
設為
true 以依 Social Post ID 進行查詢。{
// Facebook Social Post ID
"id": "104923907983682_108329000309742",
"platforms": [
// Select only one platform at a time:
// facebook, instagram, youtube, threads, tiktok, or twitter
"facebook"
],
"searchPlatformId": true // Required
}
{
// Array of Social Post IDs (max 100)
"postIds": ["1979851549871354062", "2011793803951137234"],
"platforms": [
// Select only one platform at a time:
// facebook, instagram, youtube, threads, tiktok, or twitter
"twitter"
],
"searchPlatformId": true // Required
}
當累積指標(例如按讚、留言、觀看數)暫時無法從社群網路取得時,API 會自動以已儲存的資料回填。每個平台的
analytics 物件可能會出現兩個選填欄位:backfilledFrom(string,ISO 8601)— 當有一個以上的累積指標是以儲存資料替代時出現。時間戳表示儲存資料的最後更新時間。recoveredFrom(string,ISO 8601)— 當整個分析回應因為 API 完全失敗而從儲存資料還原時出現。時間戳表示儲存資料的最後更新時間。
{
/**
The response is the same as Analytics on a Post.
Please see that endpoint for details.
Note: Some metrics are not available for posts not owned by the authorized account.
For example: X does not return non-public metrics or organic metrics for Tweets not sent by the authorized user.
*/
}
{
"twitter": [
{
"id": "1313589441919827982", // Twitter Social Post ID
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"entities": {
"urls": [
{
"start": 77,
"end": 96,
"url": "https://t.co/abc123",
"expandedUrl": "https://www.ayrshare.com/docs",
"displayUrl": "ayrshare.com/docs",
"unwoundUrl": "https://www.ayrshare.com/docs"
}
],
"hashtags": [
{
"start": 97,
"end": 112,
"tag": "SocialMediaAPI"
}
],
"mentions": [
{
"start": 113,
"end": 122,
"username": "ayrshare"
}
]
},
"name": "Wonder World",
"post": "Just launched our social media campaign using Ayrshare! Check out the API at https://t.co/abc123 #SocialMediaAPI @ayrshare",
"publicMetrics": {
"retweetCount": 0,
"quoteCount": 0,
"likeCount": 0,
"replyCount": 0,
"bookmarkCount": 0,
"impressionCount": 23
},
"nonPublicMetrics": {
"userProfileClicks": 1,
"engagements": 1,
"impressionCount": 5
},
"organicMetrics": {
"likeCount": 0,
"impressionCount": 5,
"replyCount": 0,
"retweetCount": 0,
"userProfileClicks": 1
},
"username": "wondrous"
},
"lastUpdated": "2022-04-23T18:44:29.778Z",
"nextUpdate": "2022-04-23T19:19:29.778Z"
},
{
"id": "1313589441919827999", // Twitter Social Post ID
"postUrl": "https://www.twitter.com/myaccount/1313589441919827999",
"analytics": {
"created": "2022-09-08T14:30:00.000Z",
"name": "Wonder World",
"post": "Another great day for social media automation!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"nonPublicMetrics": {
"userProfileClicks": 8,
"engagements": 12,
"impressionCount": 145
},
"organicMetrics": {
"likeCount": 15,
"impressionCount": 145,
"replyCount": 3,
"retweetCount": 5,
"userProfileClicks": 8
},
"username": "wondrous"
},
"lastUpdated": "2022-04-23T18:44:29.778Z",
"nextUpdate": "2022-04-23T19:19:29.778Z"
}
],
"status": "success",
"code": 200
}
{
"twitter": [
{
"id": "1313589441919827982",
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"name": "Wonder World",
"post": "Just launched our social media campaign!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"username": "wondrous",
"backfilledFrom": "2026-04-08T14:30:00.000Z"
},
"lastUpdated": "2026-04-09T10:15:00.000Z",
"nextUpdate": "2026-04-09T10:26:00.000Z"
}
],
"status": "success",
"code": 200
}
{
"twitter": [
{
"id": "1313589441919827982",
"postUrl": "https://www.twitter.com/myaccount/1313589441919827982",
"analytics": {
"created": "2022-09-07T22:12:10.000Z",
"name": "Wonder World",
"post": "Just launched our social media campaign!",
"publicMetrics": {
"retweetCount": 5,
"quoteCount": 2,
"likeCount": 15,
"replyCount": 3,
"bookmarkCount": 1,
"impressionCount": 150
},
"username": "wondrous",
"recoveredFrom": "2026-04-08T14:30:00.000Z"
},
"lastUpdated": "2026-04-09T10:15:00.000Z",
"nextUpdate": "2026-04-09T10:26:00.000Z"
}
],
"status": "success",
"code": 200
}
{
"lastUpdated": "2023-12-08T03:40:31.185Z",
"nextUpdate": "2023-12-08T03:51:31.185Z",
"youtube": {
"action": "post",
"status": "error",
"code": 186,
"message": "Post ID not found. Please verify the top level ID returned from the /post endpoint is being sent, the Profile Key is included if applicable, and the post at the social network has not been deleted. If you are trying to retrieve a post originating outside of Ayrshare, please use the /rest-api/endpoints/analytics#analytics-by-social-id",
"id": "dtuu-jDp4381"
}
}
⌘I
