0

I am trying to fetch companies updates with this API https://developer.linkedin.com/docs/company-pages#company_updates

I use Node.js with linkedin-js package module wrapper. I found that I only got 5 posts from this company (id=3487133). But it shown in page, that it got more than 5 updates. How can I get all its posts updates ? Thanks.

Here is my code

var linkedin_client = require('linkedin-js')(appid, appsecret, url_callback)


var cid = 3487133;
var param = {
  token: {
    oauth_token_secret: <token_secret>,
    oauth_token: <token>
  },
  count: 50
}

//post
linkedin_client.apiCall('GET', '/companies/' + cid + '/updates', param, function(error, result) {
  console.log(result)
});
ans4175
  • 432
  • 1
  • 9
  • 23

1 Answers1

0

There is nothing wrong with your code.

From https://developer.linkedin.com/docs/company-pages#company_updates you can find that

Only the most recent 50 updates for events of type status-update will be returned. For all other event types, the request will return all the updates within the past 20 days, or 250 total updates - whichever comes first.

Using Linkedin console (https://api.linkedin.com/v1/companies/3487133/updates) fo getting the updates for your company, its giving the same 5 posts. Rest of the posts in your page are 20 days + older.

Rifaj
  • 1,024
  • 12
  • 21
  • but i want to fetch all 50 posts at max. Why it won't fetched ? So it just return posts 20 days back ? – ans4175 Apr 23 '15 at 09:09
  • Linkedin API won't provide posts which are 20 days older. You'll only get newer posts till 20 days everytime you query. – Rifaj Apr 23 '15 at 10:54