Get Comments
curl --request POST \
--url https://api.linkupapi.com/v1/posts/extract-comments \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"post_url": "<string>",
"total_results": 123,
"start_page": 123,
"end_page": 123,
"country": "<string>",
"login_token": "<string>"
}
'import requests
url = "https://api.linkupapi.com/v1/posts/extract-comments"
payload = {
"post_url": "<string>",
"total_results": 123,
"start_page": 123,
"end_page": 123,
"country": "<string>",
"login_token": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
post_url: '<string>',
total_results: 123,
start_page: 123,
end_page: 123,
country: '<string>',
login_token: '<string>'
})
};
fetch('https://api.linkupapi.com/v1/posts/extract-comments', 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.linkupapi.com/v1/posts/extract-comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'post_url' => '<string>',
'total_results' => 123,
'start_page' => 123,
'end_page' => 123,
'country' => '<string>',
'login_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.linkupapi.com/v1/posts/extract-comments"
payload := strings.NewReader("{\n \"post_url\": \"<string>\",\n \"total_results\": 123,\n \"start_page\": 123,\n \"end_page\": 123,\n \"country\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.linkupapi.com/v1/posts/extract-comments")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"post_url\": \"<string>\",\n \"total_results\": 123,\n \"start_page\": 123,\n \"end_page\": 123,\n \"country\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/v1/posts/extract-comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"post_url\": \"<string>\",\n \"total_results\": 123,\n \"start_page\": 123,\n \"end_page\": 123,\n \"country\": \"<string>\",\n \"login_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"total_results": 2,
"total_available_results": 683,
"comments": [
{
"comment_urn": "urn:li:comment:(activity:7322605642718851072,7324246006802386944)",
"tracking_id": "baQdBHtet4m5Rp7zeDWuDA==",
"comment_text": "Sales",
"created_time": 1746236325933,
"commenter": {
"name": "Roberto H Luna",
"profile_urn": "urn:li:fsd_profile:ACoAAD9M79wBDEJoZuzFPHLMtdCMgmry9-AKriQ",
"linkedin_url": "https://www.linkedin.com/in/robertohluna",
"occupation": "I Build AI Agent Platforms & Workflows, That Automate Brands, Funnels & Operations | CEO @ Lunivate | Founder of Accelerants & OS Accelerator"
}
},
{
"comment_urn": "urn:li:comment:(activity:7322605642718851072,7324015073939673089)",
"tracking_id": "qNArBJWZ5m0UjtlJx0n6Yg==",
"comment_text": "Sales",
"created_time": 1746181267248,
"commenter": {
"name": "Sasa Chereja",
"profile_urn": "urn:li:fsd_profile:ACoAABqXJy0BiMsYYFf8kgjaTrhfhiSZ990fm3s",
"linkedin_url": "https://www.linkedin.com/in/sasachereja",
"occupation": "Scale Your Brand with High-Impact Video Content (600M+ Views Delivered)"
}
}
],
"pagination": {
"start_page": 1,
"end_page": 1,
"results_per_page": 50,
"pages_fetched": 1
}
}
}
Content & Posts
Get Comments
Retrieve comments on a specific LinkedIn post
POST
/
v1
/
posts
/
extract-comments
Get Comments
curl --request POST \
--url https://api.linkupapi.com/v1/posts/extract-comments \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"post_url": "<string>",
"total_results": 123,
"start_page": 123,
"end_page": 123,
"country": "<string>",
"login_token": "<string>"
}
'import requests
url = "https://api.linkupapi.com/v1/posts/extract-comments"
payload = {
"post_url": "<string>",
"total_results": 123,
"start_page": 123,
"end_page": 123,
"country": "<string>",
"login_token": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
post_url: '<string>',
total_results: 123,
start_page: 123,
end_page: 123,
country: '<string>',
login_token: '<string>'
})
};
fetch('https://api.linkupapi.com/v1/posts/extract-comments', 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.linkupapi.com/v1/posts/extract-comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'post_url' => '<string>',
'total_results' => 123,
'start_page' => 123,
'end_page' => 123,
'country' => '<string>',
'login_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.linkupapi.com/v1/posts/extract-comments"
payload := strings.NewReader("{\n \"post_url\": \"<string>\",\n \"total_results\": 123,\n \"start_page\": 123,\n \"end_page\": 123,\n \"country\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.linkupapi.com/v1/posts/extract-comments")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"post_url\": \"<string>\",\n \"total_results\": 123,\n \"start_page\": 123,\n \"end_page\": 123,\n \"country\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/v1/posts/extract-comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"post_url\": \"<string>\",\n \"total_results\": 123,\n \"start_page\": 123,\n \"end_page\": 123,\n \"country\": \"<string>\",\n \"login_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"total_results": 2,
"total_available_results": 683,
"comments": [
{
"comment_urn": "urn:li:comment:(activity:7322605642718851072,7324246006802386944)",
"tracking_id": "baQdBHtet4m5Rp7zeDWuDA==",
"comment_text": "Sales",
"created_time": 1746236325933,
"commenter": {
"name": "Roberto H Luna",
"profile_urn": "urn:li:fsd_profile:ACoAAD9M79wBDEJoZuzFPHLMtdCMgmry9-AKriQ",
"linkedin_url": "https://www.linkedin.com/in/robertohluna",
"occupation": "I Build AI Agent Platforms & Workflows, That Automate Brands, Funnels & Operations | CEO @ Lunivate | Founder of Accelerants & OS Accelerator"
}
},
{
"comment_urn": "urn:li:comment:(activity:7322605642718851072,7324015073939673089)",
"tracking_id": "qNArBJWZ5m0UjtlJx0n6Yg==",
"comment_text": "Sales",
"created_time": 1746181267248,
"commenter": {
"name": "Sasa Chereja",
"profile_urn": "urn:li:fsd_profile:ACoAABqXJy0BiMsYYFf8kgjaTrhfhiSZ990fm3s",
"linkedin_url": "https://www.linkedin.com/in/sasachereja",
"occupation": "Scale Your Brand with High-Impact Video Content (600M+ Views Delivered)"
}
}
],
"pagination": {
"start_page": 1,
"end_page": 1,
"results_per_page": 50,
"pages_fetched": 1
}
}
}
Get a detailed list of comments on a LinkedIn post, including information about who commented and the comment content.
Credit Usage: 1 credit per 10 results (or fraction thereof). For example:
- 1-10 results = 1 credit
- 11-20 results = 2 credits
- 300 results = 30 credits
Header Parameters
string
required
Your API key
Body Parameters
string
required
URL of the LinkedIn post to extract comments from (supports feed/update and /posts/ formats)
integer
default:"10"
Number of comments to retrieve (used when not in pagination mode)
integer
First page to fetch when using pagination mode (default: 1)
integer
Last page to fetch when using pagination mode (default: same as start_page)
string
default:"FR"
Country code for proxy selection. Available: (US, UK, FR, DE, NL, IT, IL, CA, BR, ES, IN)
string
required
LinkedIn authentication cookie obtained from the login/verify process
Response
string
Request status (success/error)
object
Show Properties
Show Properties
integer
Number of comments returned in this response
integer
Total number of comments available on the post
array
Show Comment Object
Show Comment Object
string
The content of the comment
string
When the comment was made
{
"status": "success",
"data": {
"total_results": 2,
"total_available_results": 683,
"comments": [
{
"comment_urn": "urn:li:comment:(activity:7322605642718851072,7324246006802386944)",
"tracking_id": "baQdBHtet4m5Rp7zeDWuDA==",
"comment_text": "Sales",
"created_time": 1746236325933,
"commenter": {
"name": "Roberto H Luna",
"profile_urn": "urn:li:fsd_profile:ACoAAD9M79wBDEJoZuzFPHLMtdCMgmry9-AKriQ",
"linkedin_url": "https://www.linkedin.com/in/robertohluna",
"occupation": "I Build AI Agent Platforms & Workflows, That Automate Brands, Funnels & Operations | CEO @ Lunivate | Founder of Accelerants & OS Accelerator"
}
},
{
"comment_urn": "urn:li:comment:(activity:7322605642718851072,7324015073939673089)",
"tracking_id": "qNArBJWZ5m0UjtlJx0n6Yg==",
"comment_text": "Sales",
"created_time": 1746181267248,
"commenter": {
"name": "Sasa Chereja",
"profile_urn": "urn:li:fsd_profile:ACoAABqXJy0BiMsYYFf8kgjaTrhfhiSZ990fm3s",
"linkedin_url": "https://www.linkedin.com/in/sasachereja",
"occupation": "Scale Your Brand with High-Impact Video Content (600M+ Views Delivered)"
}
}
],
"pagination": {
"start_page": 1,
"end_page": 1,
"results_per_page": 50,
"pages_fetched": 1
}
}
}
Notes
- The API supports two post URL formats:
- Feed updates:
https://www.linkedin.com/feed/update/urn:li:activity:... - share url:
https://www.linkedin.com/posts/..
- Feed updates:
- Results are paginated with a maximum of 50 comments per page
- The profile picture URL may be null if not available or if the user has no profile picture
- Connection degree shows your network relationship with the commenter (1st, 2nd, or 3rd degree connection)
- Pagination Mode vs. Total Results Mode:
- Total Results Mode: Use the
total_resultsparameter to specify how many comments you want (default) - Pagination Mode: Use
start_pageandend_pageparameters to fetch specific pages of results - Credit usage in pagination mode is based on the number of pages fetched (1 credit per page)
- When using pagination mode,
total_resultsparameter is ignored
- Total Results Mode: Use the
- The
total_available_resultsfield shows the total number of comments available on the post - Some comment information may be limited based on:
- Your connection level with the commenter
- The commenter’s privacy settings
- The post’s visibility settings
- Rate limits apply to comment retrieval requests
Was this page helpful?