{
// 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
按社交 ID 查询帖子分析
使用社交帖子 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"
}
}
通过提供底层的社交帖子 ID,可以获取并非通过 Ayrshare 发送的帖子的分析数据。
该 ID 会在 /post 端点 的
postIds 字段中返回。
关联账户必须是该帖子的所有者才能获取分析数据(例外:YouTube;见下文)。支持的平台:Facebook、Instagram、LinkedIn、Threads、TikTok、Twitter 和 YouTube。
- 调用方式与帖子分析端点相同。关键区别在于你使用的是社交网络返回的帖子 ID,而不是 Ayrshare 的 ID。同时需要包含
searchPlatformId: true参数,以通知端点你正在按社交帖子 ID 进行查询。 - 使用获取全部帖子历史端点可以获取在 Ayrshare 外部发布的帖子及其在
id字段中返回的 ID。 - 建议仅对未通过 Ayrshare 发送的帖子使用。对于通过 Ayrshare 发送的帖子,请使用分析端点。
- 对于在用户账户由个人账户切换为商业账户之前发布的 Instagram 帖子,其分析数据有限。
- 如果使用社交 ID 方法获取不属于你频道的 YouTube 帖子的分析数据,API 会返回该内容的描述性元数据,同时所有数值指标显示为零。诸如标题、描述、标签、频道标题、隐私状态和缩略图 URL 等描述性信息会被正确填充,为视频内容提供背景。然而,所有数值型表现指标——包括观看数、点赞数、评论数、分享数、订阅者变化、观看时长和加入播放列表次数——都会返回为零。
- 在为 X/Twitter Threads 使用
postIds时,必须单独提供每条推文的社交帖子 ID,查询父帖子时不会自动包含线程中的推文。
请求头参数
请求体参数
必须提供
id 或 postIds 之一。对于单个帖子使用 id;如果要在一次请求中获取多个帖子的分析数据,请使用 postIds。用于在一次请求中获取多个帖子分析数据的社交帖子 ID 数组。最多允许 100 个 ID。
id 或 postIds 必填其一。{
"postIds": ["1979851549871354062", "2011793803951137234"]
}
用于获取分析的平台字符串数组。仅允许一个值。可选值:
{
"platforms": ["facebook", "instagram", "linkedin", "threads",
"tiktok", "twitter", "youtube"]
}
设置为
true 时按社交帖子 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(字符串,ISO 8601)— 当有一个或多个累计指标被存储数据替换时出现。该时间戳表示存储数据最后更新的时间。recoveredFrom(字符串,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
