You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过LinkedIn API获取企业主页帖子的评论、互动及用户资料?

LinkedIn API: Getting Post Comments, Engagement Data, and Interactive User Profiles

1. Fetching Comments for a Post

Every share from your initial request has an id field (e.g., urn:li:share:123456789). Use this URN to retrieve comments for the post with the comments API:

GET https://api.linkedin.com/v2/comments?q=parent&parent={shareUrn}&count=100
  • Swap {shareUrn} with the actual id value from your share object.
  • Use the start parameter (e.g., &start=100) to paginate through more than 100 comments.
  • The response includes each comment's author URN (actor field), which you’ll use to fetch the user’s profile later.

2. Fetching Engagement Data (Likes & Shares)

Likes/Reactions

To get the list of users who reacted to a post (likes, loves, etc.), use the reactions endpoint:

GET https://api.linkedin.com/v2/reactions?q=entity&entity={shareUrn}&count=100
  • This returns all reactions along with the reacting user’s URN (actor field).
  • For aggregate counts (total likes, shares, comments), check the statistics object in your original share response—look for likeCount, shareCount, and commentCount.

Shares of the Original Post

If you need the actual posts that users shared from your enterprise page, use the shares API with the parentShare parameter:

GET https://api.linkedin.com/v2/shares?q=parentShare&parentShare={shareUrn}&count=100
  • This gives you the shared posts, including the owner URN (the user who shared your content).

3. Fetching User Profiles of Interactors

Once you have a user’s URN (from comments, reactions, or shared posts), fetch their profile data using the people API:

GET https://api.linkedin.com/v2/people/{personUrn}
  • Replace {personUrn} with the user’s URN (e.g., urn:li:person:abc123).
  • With your current Marketing permissions, you can access public profile fields like name, headline, profile picture, and industry. Getting private data (email, contact info) requires additional scopes (like r_emailaddress) and may need LinkedIn’s approval.

4. Permission Check

  • Your existing Marketing permissions (with scopes such as r_organization_social and r_liteprofile) are enough for fetching comments, reactions, shares, and basic user profiles.
  • Advanced account tiers are only required if you need restricted data (detailed contact info), higher rate limits, or advanced analytics. For public engagement data and basic profiles, no upgrade is necessary.

内容的提问来源于stack exchange,提问作者Rafael Elias

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 18:40:32