GET/api/v4/social/posts/{postId}/insights

取得貼文洞察資料與留言

傳回單一已連結管道上單篇已發布貼文的平台原始互動承載資料與留言。

需要 API 金鑰。標頭格式與金鑰輪替請參閱驗證。

參數

路徑

名稱類型必填說明
postIdstring必填Post UUID, the `socialPostId` returned by POST /social/posts.

查詢

名稱類型必填說明預設值
socialConnectedChannelIdstring必填UUID of the connection to read insights for, the `id` of a row from the brand's connections list. Insights are per channel, so this is required even when the post targeted one platform. Note the name: this endpoint takes `socialConnectedChannelId`, while disconnect takes `socialProfileConnectedChannelId` for the same ID.—

回應

200The platform's engagement payload and comments. Both fields are JSON strings whose keys are set by the platform, not by Listings API: parse them before reading.
Response
{  "data": {    "getPostInsightsAndCommentsForSocialChannel": {      "insights": "{\"impressions\": 4820, \"reach\": 3915, \"likes\": 212, \"comments\": 18, \"saved\": 44, \"shares\": 9, \"profile_visits\": 61}",      "comments": "[{\"id\": \"17912345678901234\", \"username\": \"marta.builds\", \"text\": \"That oak finish is beautiful. Do you ship?\", \"like_count\": 3, \"timestamp\": \"2026-10-02T15:12:44+0000\"}, {\"id\": \"17912345678905678\", \"username\": \"eastsidehome\", \"text\": \"Stopping by Saturday!\", \"like_count\": 0, \"timestamp\": \"2026-10-02T18:40:02+0000\"}]"    }  }}
401Unauthenticated, missing or invalid API key.
404No post with that ID on this account, or the connection does not belong to the post's brand (`SY95052`).

傳回平台針對單一管道上單篇已發布貼文所回報的資料:該貼文的互動指標與收到的留言。

使用案例:個別貼文的互動面板。 當客戶在您的使用者介面中開啟已發布的貼文時,請呼叫 GET /social/posts/{postId} 取得管道清單,然後針對每個管道,使用該管道的 id 呼叫此端點 1 次。解析 insights,顯示您能辨識的指標,並忽略其餘指標,這樣平台新增欄位就不會導致您的頁面出錯。

使用案例:找出需要回覆的留言。 針對最近發布的貼文輪詢此端點,並將解析後的 comments 陣列中的新項目轉送至您自己的收件匣。請注意,此端點僅供讀取:回覆留言必須在平台上進行,無法透過 Listings API 完成。

注意事項。

  • socialConnectedChannelId 為必填,其值是來自品牌連線的連線 id,而非平台的 referenceId。洞察資料的範圍一律限於單一管道,因為這些資料來自該平台的 API。
  • 管道必須與貼文屬於同一品牌。將貼文與其他品牌的連線配對時,端點會傳回 SY95052。
  • 只有已發布的貼文才有洞察資料。 若貼文仍處於 SCHEDULED 狀態,或在此管道發布失敗,端點會傳回空的承載資料,而非錯誤,因此在下結論前,請先檢查貼文的 connectedChannels[].status。
  • 指標的更新速度取決於平台,對大多數平台而言,這表示發布後會延遲數分鐘至數小時。請定時輪詢,不要預期 connectedChannels[].status 切換為 SUCCESS 後就能立即取得資料。
  • 留言數量上限取決於平台單頁傳回的數量;此端點不會繼續取得後續分頁。
Request
curl -X GET 'https://listingsapi.com/api/v4/social/posts/<postId>/insights?socialConnectedChannelId=<socialConnectedChannelId>' \  -H "Authorization: API $LISTINGSAPI_KEY"