LinkedIn API返回数据不一致:like count统计异常问题问询
Let’s walk through why you might be getting a like-count of 0 from that LinkedIn API endpoint even though the actual post has likes, and how to fix it:
Common Causes & Fixes
Mismatched or Invalid Update Key
Double-check yourupdate-keyparameter — for company posts, it should follow the structureUPDATE-<company-id>-<post-id>. Your example (UPDATE-c4822304-6378756278751109120) looks structurally valid, but confirm the post ID matches exactly what’s visible in the post’s URL or LinkedIn’s UI. Even a single character typo here can lead to empty or incorrect stats.Insufficient Access Token Scopes
LinkedIn’s API requires specific scopes to pull post statistics. Make sure your access token has these enabled:r_organization_social(required for reading company social data)rw_organization_admin(optional, but useful for admin-specific stats)
You can verify your token’s scopes by decoding it with a JWT tool or checking your OAuth authorization flow. Missing scopes often return incomplete/zeroed data instead of an explicit error message.
Date Range & Time Granularity Misalignment
Your request usestime-granularity=dayandstart-timestamp=1517443200000(Jan 31, 2018). If the post was published outside this exact day, the daily stats for that timestamp will show 0. Try removing thestart-timestamptemporarily to fetch all available historical stats for the post, or adjust the timestamp to match the post’s actual publication date.Deprecated API Version
A critical point: the/v1/companies/...endpoint you’re using is from LinkedIn’s sunset V1 API, which was deprecated years ago. V1 endpoints often return incomplete data or stop working entirely now. You should migrate to the supported V2 equivalent endpoint, which uses URNs for identifiers:https://api.linkedin.com/v2/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:4822304&shares=List(urn:li:share:6378756278751109120)&timeIntervals=(timeGranularityType:DAY,start:1517443200000)Data Sync Delay
LinkedIn’s API can have a 15-30 minute delay between when a post gets likes and when those stats are available via the API. If the post was recently updated, wait a bit and retry the request. Also, clear any local caching for API responses to ensure you’re pulling fresh data.
Quick Validation Checks
- Test the same access token with a different post (one you know has confirmed likes). If that returns correct stats, the issue is specific to the original post’s update key or date range.
- Use LinkedIn’s internal API Console (if you have access) to re-run the request — this helps rule out formatting issues or token validity problems.
内容的提问来源于stack exchange,提问作者Kranthi Krishna

