Export LinkedIn Posts Statistics

Export LinkedIn Posts Statistics
28. Dec 2020
1 minute read

It turns out LinkedIn doesn’t have an easy way to export data on your published posts (views, likes, comments and yada). (yet!)

LinkedIn posts page

LinkedIn posts page

With below steps, you can export your data:

  1. Goto https://www.linkedin.com/in/[YOUR-NAME-HERE]/detail/recent-activity/shares/
  2. Scroll to the bottom of the page, and keep scrolling till you reach the posts you want to export
  3. Open Chrome devtools (Ctrl+Shift+I) and goto console tab. (or any browser)
  4. Run below javascript code
let data = Array.from(document.querySelectorAll('#voyager-feed>.occludable-update.ember-view')).map(div => {
  if (!div.querySelector('[data-urn]')) return
  const urn = div.querySelector('[data-urn]').dataset.urn
  const url = `https://www.linkedin.com/feed/update/${urn}/`
  const date = div.querySelector('span.feed-shared-actor__sub-description span.visually-hidden').textContent
  const text = div.querySelector('div.feed-shared-update-v2__description-wrapper span[dir]').textContent
  const numbr = e => (e)?+e.textContent.trim().split(' ')[0].replace(/,/g, ''):0
  const reactions = numbr(div.querySelector('.social-details-social-counts__reactions-count'))
  const comments = numbr(div.querySelector('.social-details-social-counts__comments'))
  const views = numbr(div.querySelector('.analytics-entry-point strong'))
  let link = div.querySelector('.feed-shared-article__link-container>a')
  link = (link)?link.getAttribute('href'):''
  return { url, date, text, reactions, comments, views, link }
}).filter(d => d)

// copies data as JSON into your clipboard
copy(data)
  • Data is now copied to your clipboard. Paste it in notepad editor to save the data.
  • Use any JSON to CSV convertors if you need to do spreadsheet analysis.

You now have raw data (url, date, text, reactions, comments, views, link) of your LinkedIn posts.

table

LinkedIn only shows approximate published date.