Get Post Engagement
curl --request GET \
--url https://api.fetchin.io/api/v1/post/engagement \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fetchin.io/api/v1/post/engagement"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fetchin.io/api/v1/post/engagement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fetchin.io/api/v1/post/engagement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fetchin.io/api/v1/post/engagement"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fetchin.io/api/v1/post/engagement")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fetchin.io/api/v1/post/engagement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"post": "urn:li:activity:7287782484287606784",
"comments": [
{
"urn": "urn:li:comment:(ugcPost:7287782484287606784,7287957733851484162)",
"text": "Great post!",
"createdAt": "2024-01-22T14:22:07.458Z",
"reactionCount": 5,
"author": {
"type": "profile",
"id": "urn:li:fsd_profile:ACoAABCDEFG",
"name": "Jane Doe",
"headline": "Software Engineer",
"profileUrl": "https://www.linkedin.com/in/janedoe"
},
"replies": []
}
],
"commentsPaginationToken": "MTAtMTcwNjAwMDAwMDAwMA==",
"commentsHasMore": true,
"commentsTotal": 42,
"reactions": [
{
"reactionType": "LIKE",
"actor": {
"urn": "urn:li:fsd_profile:ACoAABBfDXAB9eK9V6vEHbzfQXZ-wcjke_QuT7g",
"type": "profile",
"name": "Kevin Piacentini",
"headline": "Lead Engineer",
"profileUrl": "https://www.linkedin.com/in/kevin-piacentini/",
"profilePictureUrl": "https://media.licdn.com/dms/image/...",
"publicId": "kevin-piacentini",
"profileId": "ACoAABBfDXAB9eK9V6vEHbzfQXZ-wcjke_QuT7g"
}
}
],
"reactionsHasMore": false,
"reactionsTotal": 1
}
{
"error": "Missing postUrlOrUrn parameter",
"code": "MISSING_PARAMETER"
}
{
"error": "Quota exceeded. Upgrade your plan or wait for renewal.",
"code": "QUOTA_EXHAUSTED",
"details": {
"creditsRemaining": 0,
"subscriptionCreditsRemaining": 0,
"paygCreditsRemaining": 0,
"buyCreditsUrl": "https://fetchin.io/credits"
}
}
{
"error": "Unable to find post from url",
"code": "POST_NOT_FOUND"
}
{
"error": "This endpoint costs 2 RPS units but your plan allows 1 request(s) per second. Upgrade your plan to use it.",
"code": "RATE_LIMITED"
}
{
"error": "Service temporarily unable to serve this request. Please retry.",
"code": "SERVICE_UNAVAILABLE"
}
Posts
Get Post Engagement
Fetch a post’s comments and reactions in a single call
GET
/
api
/
v1
/
post
/
engagement
Get Post Engagement
curl --request GET \
--url https://api.fetchin.io/api/v1/post/engagement \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fetchin.io/api/v1/post/engagement"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fetchin.io/api/v1/post/engagement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fetchin.io/api/v1/post/engagement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fetchin.io/api/v1/post/engagement"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fetchin.io/api/v1/post/engagement")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fetchin.io/api/v1/post/engagement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"post": "urn:li:activity:7287782484287606784",
"comments": [
{
"urn": "urn:li:comment:(ugcPost:7287782484287606784,7287957733851484162)",
"text": "Great post!",
"createdAt": "2024-01-22T14:22:07.458Z",
"reactionCount": 5,
"author": {
"type": "profile",
"id": "urn:li:fsd_profile:ACoAABCDEFG",
"name": "Jane Doe",
"headline": "Software Engineer",
"profileUrl": "https://www.linkedin.com/in/janedoe"
},
"replies": []
}
],
"commentsPaginationToken": "MTAtMTcwNjAwMDAwMDAwMA==",
"commentsHasMore": true,
"commentsTotal": 42,
"reactions": [
{
"reactionType": "LIKE",
"actor": {
"urn": "urn:li:fsd_profile:ACoAABBfDXAB9eK9V6vEHbzfQXZ-wcjke_QuT7g",
"type": "profile",
"name": "Kevin Piacentini",
"headline": "Lead Engineer",
"profileUrl": "https://www.linkedin.com/in/kevin-piacentini/",
"profilePictureUrl": "https://media.licdn.com/dms/image/...",
"publicId": "kevin-piacentini",
"profileId": "ACoAABBfDXAB9eK9V6vEHbzfQXZ-wcjke_QuT7g"
}
}
],
"reactionsHasMore": false,
"reactionsTotal": 1
}
{
"error": "Missing postUrlOrUrn parameter",
"code": "MISSING_PARAMETER"
}
{
"error": "Quota exceeded. Upgrade your plan or wait for renewal.",
"code": "QUOTA_EXHAUSTED",
"details": {
"creditsRemaining": 0,
"subscriptionCreditsRemaining": 0,
"paygCreditsRemaining": 0,
"buyCreditsUrl": "https://fetchin.io/credits"
}
}
{
"error": "Unable to find post from url",
"code": "POST_NOT_FOUND"
}
{
"error": "This endpoint costs 2 RPS units but your plan allows 1 request(s) per second. Upgrade your plan to use it.",
"code": "RATE_LIMITED"
}
{
"error": "Service temporarily unable to serve this request. Please retry.",
"code": "SERVICE_UNAVAILABLE"
}
Endpoint
GET /api/v1/post/engagement
/post/comments and /post/reactions
separately when you need both.
This endpoint bills 2 credits from your credit balance and counts as 2
units against your per-second rate limit. It is all-or-nothing: if either
half cannot be fetched, the whole request returns an error and 0 credits are
charged — except a
404 not found, which costs 1 credit like every other
endpoint. Because it costs 2 rate-limit units, your plan’s per-second limit must
be at least 2 to call it.Authentication
X-API-Key: your-api-key-here
Parameters
Professional post URL or URN.Examples:
https://www.linkedin.com/posts/username_some-post-slug-1234567890-abcdurn:li:activity:7287782484287606784urn:li:ugcPost:7287782484287606784
Response
Array of comments (same object shape as Get Post Comments).
Number of top-level comments the source reports for the post (replies not
included) — the
total of Get Post Comments.
Omitted when the source does not report one.Array of reactions (same object shape as Get Post Reactions).
Number of reactions the source reports for the post — the
total of
Get Post Reactions. A complete
walk can end a few short of it. Omitted when the source does not report one.Example Request
curl -X GET "https://api.fetchin.io/api/v1/post/engagement?postUrlOrUrn=urn:li:activity:7287782484287606784" \
-H "X-API-Key: your-api-key-here"
const response = await fetch(
'https://api.fetchin.io/api/v1/post/engagement?postUrlOrUrn=urn:li:activity:7287782484287606784',
{ headers: { 'X-API-Key': 'your-api-key-here' } }
);
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'https://api.fetchin.io/api/v1/post/engagement',
headers={'X-API-Key': 'your-api-key-here'},
params={'postUrlOrUrn': 'urn:li:activity:7287782484287606784'},
)
print(response.json())
Example Response
{
"post": "urn:li:activity:7287782484287606784",
"comments": [
{
"urn": "urn:li:comment:(ugcPost:7287782484287606784,7287957733851484162)",
"text": "Great post!",
"createdAt": "2024-01-22T14:22:07.458Z",
"reactionCount": 5,
"author": {
"type": "profile",
"id": "urn:li:fsd_profile:ACoAABCDEFG",
"name": "Jane Doe",
"headline": "Software Engineer",
"profileUrl": "https://www.linkedin.com/in/janedoe"
},
"replies": []
}
],
"commentsPaginationToken": "MTAtMTcwNjAwMDAwMDAwMA==",
"commentsHasMore": true,
"commentsTotal": 42,
"reactions": [
{
"reactionType": "LIKE",
"actor": {
"urn": "urn:li:fsd_profile:ACoAABBfDXAB9eK9V6vEHbzfQXZ-wcjke_QuT7g",
"type": "profile",
"name": "Kevin Piacentini",
"headline": "Lead Engineer",
"profileUrl": "https://www.linkedin.com/in/kevin-piacentini/",
"profilePictureUrl": "https://media.licdn.com/dms/image/...",
"publicId": "kevin-piacentini",
"profileId": "ACoAABBfDXAB9eK9V6vEHbzfQXZ-wcjke_QuT7g"
}
}
],
"reactionsHasMore": false,
"reactionsTotal": 1
}
{
"error": "Missing postUrlOrUrn parameter",
"code": "MISSING_PARAMETER"
}
{
"error": "Quota exceeded. Upgrade your plan or wait for renewal.",
"code": "QUOTA_EXHAUSTED",
"details": {
"creditsRemaining": 0,
"subscriptionCreditsRemaining": 0,
"paygCreditsRemaining": 0,
"buyCreditsUrl": "https://fetchin.io/credits"
}
}
{
"error": "Unable to find post from url",
"code": "POST_NOT_FOUND"
}
{
"error": "This endpoint costs 2 RPS units but your plan allows 1 request(s) per second. Upgrade your plan to use it.",
"code": "RATE_LIMITED"
}
{
"error": "Service temporarily unable to serve this request. Please retry.",
"code": "SERVICE_UNAVAILABLE"
}
Errors
See Error Handling for the full list of error codes and recommended handling.400—MISSING_PARAMETER,INVALID_URN401—INVALID_API_KEY404—POST_NOT_FOUND402—QUOTA_EXHAUSTED429—RATE_LIMITED(also returned when the endpoint’s 2-unit cost exceeds your per-second limit)500—INTERNAL_ERROR503—SERVICE_UNAVAILABLE
Pagination
The two lists paginate independently:- Comments paginate by token: pass
commentPaginationTokenfrom the previous response, and stop whencommentsHasMoreisfalse. - Reactions paginate by offset: increment
reactionStartbyreactionCount, and stop whenreactionsHasMoreisfalse.
/post/engagement bills 2 credits and 2 rate-limit units, so if you
only need to deep-paginate one of the two lists, use the dedicated
/post/comments or /post/reactions endpoint (1 credit each) instead.
Notes
Billing is all-or-nothing: 2 credits when both lists are returned, 0 credits if
the request errors. There is no partial result. The one failing response that
still costs is a
404 not found, billed 1 credit — see
Quotas.Query Parameters
Response
Combined comments and reactions