Skip to content
Enricho

Post comments

GET /v1/post-comments $0.0400 per request

Get comments of LinkedIn post by post URL.

Get comments of LinkedIn post by post URL.

Try it

Runs against the sandbox, so it is free and needs no API key. The response shape is identical to the live endpoint.

GET /v1/post-comments
Sandbox · free

Parameters

Billed equivalent


                

With a real key this call costs at Starter, less your tier discount.

Response


        

Query parameters

At least one of post is required.

Parameter Example Description
post required https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM URL of the LinkedIn post (required)
page 4097.908013320009 Page number for pagination. Default is 1
paginationToken Required only if sortBy is 'relevance' and page > 1. Use this token from the previous page response.
sortBy Sort comments by field. Supported values: 'relevance', 'date'

Code

curl 'https://api.enricho.io/v1/post-comments?post=https%3A%2F%2Fwww.linkedin.com%2Fposts%2Fmicrosoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7%3Futm_source%3Dshare%26utm_medium%3Dmember_desktop%26rcm%3DACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM' \
  -H 'X-API-Key: YOUR_API_KEY'
import requests

response = requests.get(
    "https://api.enricho.io/v1/post-comments",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={
    'post': 'https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM',
},
    timeout=30,
)

response.raise_for_status()

# Every response reports what it cost and what is left.
print(response.headers["X-Request-Cost"], response.headers["X-Balance-Remaining"])
print(response.json())
const params = new URLSearchParams({
    "post": "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM"
});

const response = await fetch(`https://api.enricho.io/v1/post-comments?${params}`, {
  headers: { 'X-API-Key': 'YOUR_API_KEY' },
});

if (!response.ok) {
  throw new Error(`${response.status}: ${(await response.json()).error.message}`);
}

console.log(response.headers.get('X-Request-Cost'));
console.log(await response.json());
$client = new GuzzleHttp\Client();

$response = $client->get('https://api.enricho.io/v1/post-comments', [
    'headers' => ['X-API-Key' => 'YOUR_API_KEY'],
    'query' => [
        'post' => 'https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM',
    ],
    'timeout' => 30,
]);

echo $response->getHeaderLine('X-Request-Cost');

$data = json_decode((string) $response->getBody(), true);

Example response

{
    "pagination": null,
    "elements": null,
    "error": "Post URL or ID is not valid",
    "status": 400,
    "query": []
}

Error response

Full list of codes on the errors page.

{
    "error": {
        "code": "invalid_params",
        "message": "post-comments requires at least one of: post.",
        "docs": "https://enricho.io/docs/errors#invalid_params",
        "required_one_of": [
            "post"
        ]
    }
}