astro-embed icon indicating copy to clipboard operation
astro-embed copied to clipboard

LinkedIn

Open awhitford opened this issue 10 months ago • 3 comments

I have interest in showcasing LinkedIn posts too.

LinkedIn posts can offer code to Embed this post, like:

<iframe src="https://www.linkedin.com/embed/feed/update/urn:li:ugcPost:7289953683264434176"
height="665" width="504" frameborder="0" allowfullscreen="" title="Embedded post"></iframe>

Could we get LinkedIn support too please?

awhitford avatar Feb 20 '25 05:02 awhitford

Do you know if LinkedIn provides an API to get post data? Couldn’t see one in a quick search, but that’s probably what is needed. Otherwise just using their <iframe> code directly may be the best people can do.

delucis avatar Feb 20 '25 08:02 delucis

I think this might be the API: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api?view=li-lms-2025-01&tabs=http#get-posts-by-urn

awhitford avatar Feb 20 '25 09:02 awhitford

Looks like it might be. It does require authorization though, for example this request for data for the embed you shared above:

curl -X POST 'https://api.linkedin.com/rest/posts/7289953683264434176' -H 'X-Restli-Protocol-Version: 2.0.0' -H 'LinkedIn-Version: 202412' --data ''

Returns:

{"status":401,"serviceErrorCode":65604,"code":"EMPTY_ACCESS_TOKEN","message":"Empty oauth2 access token"}

That does mean I’m personally very unlikely to implement this as I don’t have a LinkedIn account (which would also complicate testing I guess as tests in this repo would need a token). But maybe someone is interested in working on it.

delucis avatar Feb 20 '25 10:02 delucis