POST /api/v1/linkedin/post — 1 credit per request
Look up a public LinkedIn post as a logged-out visitor sees it: its title and text, the author and their follower count, the reaction and comment counts, when it was published, its LinkedIn addresses, and a preview of its comments. Send the post address as a query parameter. Posts only: article addresses are not supported.
Endpoint
Section titled “Endpoint”| Method | Path | Returns |
|---|---|---|
| POST | /api/v1/linkedin/post |
A public LinkedIn post |
Request & Response
Section titled “Request & Response”Request
Section titled “Request”| Name | Where | Type | Required | Description |
|---|---|---|---|---|
url |
query | string (max 300) | Yes | A LinkedIn post address: linkedin.com, www.linkedin.com or a country subdomain such as ca.linkedin.com, in one of the two forms below. The scheme is optional. A trailing slash and any query string are ignored |
| Address form | Where it comes from |
|---|---|
/posts/<name>_<text>-activity-<number>-<code> |
The link LinkedIn gives when you share a post |
/feed/update/urn:li:activity:<number> |
The by-number address |
- Only the activity number (the digits) is kept. It is the identity of the post, so every address of one post is one lookup, one cache entry and one charge, and a share address whose last characters are wrong still finds its post.
- An activity number is 15 to 22 digits and does not start with
0. - Posts only. A
linkedin.com/pulse/...article address is a400, as are profile and company addresses, aurn:li:share:address, a port, and a host other than the ones above. For a person’s profile, use LinkedIn Profile.
Response body
Section titled “Response body”| Field | Type | Description |
|---|---|---|
requestId |
string | Opaque ID for this request (req_…). Quote it when reporting a problem |
activityId |
string | The post’s activity number, resolved from whatever you sent |
status |
string | "success" on every 200 |
coalesced |
boolean | true if this request joined a fetch of the same post that was already under way |
cached |
boolean | true if answered from a fetch of the last 15 minutes. Free if your key already paid for this post |
result |
object | The post, see below |
finishReason |
string | Empty on a freshly fetched answer, absent on a cached one. Ignore it on a 200 |
success |
boolean | true on every 200 |
credits_charged |
integer | What this request cost. 0 for a post your key already paid for |
credits_remaining |
integer | Your balance after this request |
cached_at |
string | UTC time of the cached answer. Present only on a cached answer |
The result object
Section titled “The result object”| Field | Type | Description |
|---|---|---|
activityUrn |
string or null |
The post’s activity address, urn:li:activity:<number> |
contentUrn |
string or null |
The address of the post’s own content, urn:li:share:<number> or urn:li:ugcPost:<number>. Which of the two a post has varies |
url |
string | The post’s public LinkedIn address |
name |
string or null |
The title LinkedIn gives the post: the title of the page it shares, or a video’s caption. null when it has none |
headline |
string or null |
The start of the post’s text, as LinkedIn gives it |
description |
string or null |
The post’s text as plain text, line breaks as \n |
commentCount |
integer or null |
The exact comment count, covering all comments rather than the preview. null when LinkedIn gave none |
likeCount |
integer or null |
The exact reaction count, all kinds together. null when LinkedIn gave none |
datePublished |
string or null |
When the post was published, in UTC to the millisecond. Never estimated from a relative age |
author |
object | Who published the post, a person or a company page: name, url and followers (exact, null when LinkedIn gave none) |
comments |
array | The preview of the post’s comments, in LinkedIn’s order. Empty when none were shown |
moreArticles |
array | Always empty for a post |
Comments
Section titled “Comments”comments is only the preview a logged-out visitor sees: usually about ten comments, with no way to ask for more or for replies. commentCount is the post’s full count and is usually larger.
| Field | Type | Description |
|---|---|---|
author |
string | The commenter’s name |
text |
string | The comment’s text as plain text, on one line |
linkedinUrl |
string or null |
A link to the commenter’s LinkedIn page, a person or a company |
datePublished |
string or null |
The exact source timestamp. null when the source gave none for this comment. Never estimated from publishedTimeAgo |
publishedTimeAgo |
string or null |
How long ago the comment was published, as LinkedIn shows it: 3d, 1y, 2mo, 5h |
urn |
string or null |
The full comment address, urn:li:comment:(urn:li:activity:<post>,<comment>) |
id |
string or null |
The comment’s number, as a string |
reactionCount |
integer or null |
The comment’s reaction count, keeping 0. null when unavailable |
Nothing is estimated. A field LinkedIn did not send is null (a list: []), never 0 or an invented value. Counts are the exact figures from the post’s data, never parsed from rounded text such as 2.3K.
Caching and cost
Section titled “Caching and cost”A fresh answer is shared across keys for 15 minutes (1 hour for a post that does not exist), per post. Only a 200 is charged. Asking again for a post your key already paid for is free while it is cached, and resubmitting after a 503 never charges twice. A 403, 404, 429 and 503 are never charged.
Errors
Section titled “Errors”| Status | When | What to do |
|---|---|---|
400 |
No url, an article, profile or company address, an address that is not a post (urn:li:share: for example), or one on another host |
Fix the request |
401 |
No API key, or an unknown one | Check your key |
402 |
Your balance cannot cover this plus your unfinished lookups | Buy credit |
403 |
LinkedIn refused the request (finishReason http-403, …) |
Not charged. Retry after the Retry-After delay |
404 |
No public post at this address: it does not exist, was deleted, or LinkedIn does not show it to a logged-out visitor (not-found). A private post looks the same as a missing one |
Not charged. Cached for 1 hour |
429 |
Rate limit, too many unfinished lookups, or too many posts from this key that do not exist (30 in 15 minutes by default) | Slow down. Not charged |
503 |
No answer in time, LinkedIn failing, or the service paused after repeated refusals. finishReason exit-walled means LinkedIn showed our service neither this post nor one that is always public, so nothing could be concluded about yours |
Not charged. Resubmit after the Retry-After delay |
curl -X POST "https://api.megomi.my.id/api/v1/linkedin/post?url=https://www.linkedin.com/posts/williamhgates_agriculture-is-where-i-see-ai-making-the-activity-7526039470060613632-4h_6" \ -H "x-api-key: YOUR_API_KEY"const params = new URLSearchParams({ url: "https://www.linkedin.com/posts/williamhgates_agriculture-is-where-i-see-ai-making-the-activity-7526039470060613632-4h_6" });const res = await fetch(`https://api.megomi.my.id/api/v1/linkedin/post?${params}`, { method: "POST", headers: { "x-api-key": process.env.MEGOMI_API_KEY }, signal: AbortSignal.timeout(60_000),});const data = await res.json();import requests
res = requests.post( "https://api.megomi.my.id/api/v1/linkedin/post", params={"url": "https://www.linkedin.com/posts/williamhgates_agriculture-is-where-i-see-ai-making-the-activity-7526039470060613632-4h_6"}, headers={"x-api-key": "YOUR_API_KEY"}, timeout=60,)print(res.json())<?php$url = "https://api.megomi.my.id/api/v1/linkedin/post?" . http_build_query(["url" => "https://www.linkedin.com/posts/williamhgates_agriculture-is-where-i-see-ai-making-the-activity-7526039470060613632-4h_6"]);$ch = curl_init($url);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: YOUR_API_KEY"]);curl_setopt($ch, CURLOPT_TIMEOUT, 60);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);echo curl_exec($ch);q := url.Values{}q.Set("url", "https://www.linkedin.com/posts/williamhgates_agriculture-is-where-i-see-ai-making-the-activity-7526039470060613632-4h_6")req, _ := http.NewRequest("POST", "https://api.megomi.my.id/api/v1/linkedin/post?"+q.Encode(), nil)req.Header.Set("x-api-key", "YOUR_API_KEY")client := &http.Client{Timeout: 60 * time.Second}resp, _ := client.Do(req){ "requestId": "req_9f1kQ3zP7mLxA2dR", "activityId": "7525000000000000001", "status": "success", "coalesced": false, "cached": false, "result": { "activityUrn": "urn:li:activity:7525000000000000001", "contentUrn": "urn:li:share:7525000000000000002", "url": "https://www.linkedin.com/posts/sam-example_a-shared-title-activity-7525000000000000001-ab12", "name": "A Shared Title", "headline": "First line of the post & more.", "commentCount": 5, "likeCount": 315, "datePublished": "2026-11-10T16:12:27.290Z", "description": "First line of the post & more.\nSecond line.", "author": { "name": "Sam Example", "url": "https://www.linkedin.com/in/sam-example", "followers": 12345 }, "comments": [ { "author": "Ana Tester", "text": "Great point about heat.", "linkedinUrl": "https://fr.linkedin.com/in/ana-tester", "datePublished": "2026-11-10T16:38:47.374Z", "publishedTimeAgo": "3d", "urn": "urn:li:comment:(urn:li:activity:7525000000000000001,7525000000000000101)", "id": "7525000000000000101", "reactionCount": 4 }, { "author": "Cy Sample", "text": "A comment the structured data does not list", "linkedinUrl": "https://www.linkedin.com/in/cy-sample", "datePublished": null, "publishedTimeAgo": "2w", "urn": "urn:li:comment:(urn:li:activity:7525000000000000001,7525000000000000103)", "id": "7525000000000000103", "reactionCount": null } ], "moreArticles": [] }, "finishReason": "", "success": true, "credits_charged": 1, "credits_remaining": 249}{ "status": 400, "title": "Bad Request", "detail": "url is required: send a LinkedIn post address"}{ "status": 403, "title": "Forbidden", "detail": "LinkedIn refused the request; you were not charged", "requestId": "req_5mPq1XwK8jVcT4nR", "activityId": "7525000000000000001", "finishReason": "http-403"}{ "status": 404, "title": "Not Found", "detail": "the source reports no such post (deleted, or never existed); you were not charged. This answer is cached for an hour", "requestId": "req_5mPq1XwK8jVcT4nR", "finishReason": "not-found"}{ "status": 503, "title": "Service Unavailable", "detail": "no data fetched within 45s; you were not charged. The lookup is still running: submitting the same request again shortly may return it from cache, and is never charged twice", "requestId": "req_1qLr6PxV8nWtE3sJ", "finishReason": "no-data-fetched"}