How to Get Access to LinkedIn API for Company Post Engagement Data?

0

 


Getting LinkedIn company post engagement data (likes, comments, shares) is not straightforward, because LinkedIn tightly restricts access to this data.

Below is a complete, practical, no-confusion guide—covering:

  • Official API access (correct way)

  • Approval process (what actually happens)

  • Working code examples 

  • Realistic alternatives 


1. Reality Check (Very Important)

You CANNOT access company post engagement data with basic API access.

You need:

  • Marketing Developer Platform (MDP) access

  • Approval for organization-level APIs

Without approval, endpoints for:

  • Company posts

  • Likes

  • Comments

  • Shares will NOT work.


2. Correct Process to Get Access

Step 1: Create App

Go to:

  • LinkedIn Developer Portal

Create app under your company page.


Step 2: Request Products

You must request:

🔹 Required Product

  • Marketing Developer Platform

This unlocks:

  • Organization posts

  • Social engagement APIs


Step 3: Request Permissions (Scopes)

You need:

r_organization_social
rw_organization_admin
r_organization_admin

Optional:

w_organization_social

Step 4: Submit for Review

LinkedIn will ask:

  • Use case (VERY IMPORTANT)

  • Business justification

  • Screenshots / demo

  • How you will use data

Example justification:

We are building a social analytics dashboard for internal company use
to track engagement metrics (likes, comments, shares) on our LinkedIn posts.
Data will not be redistributed externally.

3. Approval Reality

  • Approval is manual

  • Takes days to weeks

  • Many requests are rejected

 LinkedIn prefers:

  • Official partners

  • Marketing platforms

  • Agencies


 4. APIs You Will Use (After Approval)

4.1 Get Company URN

GET https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=your-company

Response:

{
  "elements": [
    {
      "id": 12345678
    }
  ]
}

URN:

urn:li:organization:12345678

4.2 Get Company Posts

GET https://api.linkedin.com/v2/shares?q=owners&owners=urn:li:organization:12345678

4.3 Get Engagement Stats

GET https://api.linkedin.com/v2/socialActions/{shareURN}

Example:

GET https://api.linkedin.com/v2/socialActions/urn:li:share:123456789

Response:

{
  "likesSummary": {
    "totalLikes": 120
  },
  "commentsSummary": {
    "totalComments": 45
  }
}

5. Complete Python Example

import requests

ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"

headers = {
    "Authorization": f"Bearer {ACCESS_TOKEN}",
    "X-Restli-Protocol-Version": "2.0.0"
}

# Step 1: Get posts
org_id = "urn:li:organization:12345678"

url = f"https://api.linkedin.com/v2/shares?q=owners&owners={org_id}"
response = requests.get(url, headers=headers)

posts = response.json()["elements"]

for post in posts:
    share_urn = post["id"]

    # Step 2: Get engagement
    stats_url = f"https://api.linkedin.com/v2/socialActions/{share_urn}"
    stats = requests.get(stats_url, headers=headers).json()

    print("Post:", share_urn)
    print("Likes:", stats.get("likesSummary", {}).get("totalLikes"))
    print("Comments:", stats.get("commentsSummary", {}).get("totalComments"))
    print("------")
 
 

 6. OAuth 2.0 Authentication Flow

You must implement OAuth:

Step 1: Authorization URL

https://www.linkedin.com/oauth/v2/authorization

Params:

response_type=code
client_id=YOUR_CLIENT_ID
redirect_uri=YOUR_REDIRECT_URI
scope=r_organization_social

Step 2: Get Access Token

POST https://www.linkedin.com/oauth/v2/accessToken

 7. If You Are NOT Approved

👉 This is where most developers get stuck.

You will face:

  • 403 Unauthorized

  • Missing permissions

  • Empty responses


 8. Alternative Approaches (Realistic Options)

Option 1: Use Official Partners

Tools like:

  • Hootsuite

  • Sprout Social

(They already have LinkedIn approval)


Option 2: Web Scraping (NOT Recommended)

  • Violates LinkedIn ToS

  • Risk of IP ban / legal issues


Option 3: Manual Export

From LinkedIn Page Admin:

  • Analytics → Export data

Good for:

  • Reports

  • Internal dashboards


Option 4: Use Zapier / Integrations

  • Limited automation

  • No deep analytics


9. Best Strategy (Practical Advice)

If you're an individual developer:

Chances of approval = LOW

Better approach:

  • Build system API-ready

  • Use mock/sample data

  • Apply later with:

    • Business website

    • Real product demo


10. Data You Can Access Without Approval

Basic APIs allow:

  • Profile data

  • Limited sharing

But NOT:

  • Company analytics

  • Engagement metrics


Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !