Get Post Analytics with Linkedin API v2

十年热恋 提交于 2019-12-12 14:52:44

问题


Recently, I am working on Linkedin API v2 and I have some problems with

  • Get posts of a certain company
  • Get analytics of a certain post

I was able to get company statistics by using https://api.linkedin.com/v2/organizationPageStatistics?q=organization&organization={organization URN}

But I can't find any API to get the above info.

Please help me to resolve above problem. Thanks in advance for any advices.


回答1:


Actually linkedin doesn't provide such API like facebook or twitter. They still lack the APIs for detailed situations. You need to scrap data from linkedin to get further information other than those of standard linkedin API.




回答2:


You can use the Share API

you can retrieve the posts of a company with the Find Shares by Owner:

GET https://api.linkedin.com/v2/shares?q=owners&owners={URN}&sharesPerOwner=100

{
    "activity": "urn:li:activity:12345657",
    "content": {
        "contentEntities": [
            {
                "entity": "urn:li:article:0",
                "entityLocation": "https://www.example.com/content.html",
                "thumbnails": [
                    {
                        "imageSpecificContent": {},
                        "resolvedUrl": "https://www.example.com/image.jpg"
                    }
                ]
            }
        ],
        "description": "content description",
        "title": "Test Share with Content"
    },
    "created": {
        "actor": "urn:li:person:A8xe03Qt10",
        "time": 1471967236000
    },
    "distribution": {
        "linkedInDistributionTarget": {}
    },
    "id": "6173878065928642560",
    "lastModified": {
        "actor": "urn:li:person:A8xe03Qt10",
        "time": 1471967237000
    },
    "owner": "urn:li:organization:1000",
    "text": {
        "text": "Test Share!"
    } }

And about the analytics you can use the Retrieve a Summary of Social Actions API:

GET https://api.linkedin.com/v2/socialActions/{shareUrn|ugcPostUrn|commentUrn}

{
    "commentsSummary": {
        "totalFirstLevelComments": 4,
        "aggregatedTotalComments": 9
    },
    "$URN": "urn:li:activity:6296748651834277888",
    "likesSummary": {
        "likedByCurrentUser": false,
        "totalLikes": 226
    }
}

Hope this help



来源:https://stackoverflow.com/questions/58601459/get-post-analytics-with-linkedin-api-v2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!