LinkedIn Post Data (Deprecated)
curl --request POST \
--url https://api.datamagnet.co/api/v1/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>"
}
'import requests
url = "https://api.datamagnet.co/api/v1/posts"
payload = { "url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('https://api.datamagnet.co/api/v1/posts', 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.datamagnet.co/api/v1/posts",
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([
'url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.datamagnet.co/api/v1/posts"
payload := strings.NewReader("{\n \"url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.datamagnet.co/api/v1/posts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datamagnet.co/api/v1/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"credit_used": 1,
"message": {
"author": {
"name": "Bill Gates",
"profile_url": "https://www.linkedin.com/in/williamhgates",
"headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
"profile_image": "https://media.licdn.com/...",
"cover_image": "https://media.licdn.com/...",
"followers_count": 37242615,
"posts_count": 1418,
"articles_count": 256
},
"author_linkedin_url": "https://www.linkedin.com/in/williamhgates",
"author_linkedin_id": "williamhgates",
"content": "Post content text...",
"post_type": "post",
"published_date": "Sun, 15 Dec 2024 10:00:00 GMT",
"post_url": "https://www.linkedin.com/posts/williamhgates_...",
"post_id": "7274567890123456789",
"transcript": null,
"meta": {},
"likes": 5420,
"comments_count": 125,
"shares": 0,
"video": {},
"image": {},
"comments": [],
"embedded_links": [],
"hashtags": []
}
}
LinkedIn Post Data (Deprecated)
Deprecated legacy alias for LinkedIn post data. Use the Post Details endpoint instead.
POST
/
api
/
v1
/
posts
LinkedIn Post Data (Deprecated)
curl --request POST \
--url https://api.datamagnet.co/api/v1/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>"
}
'import requests
url = "https://api.datamagnet.co/api/v1/posts"
payload = { "url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('https://api.datamagnet.co/api/v1/posts', 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.datamagnet.co/api/v1/posts",
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([
'url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.datamagnet.co/api/v1/posts"
payload := strings.NewReader("{\n \"url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.datamagnet.co/api/v1/posts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datamagnet.co/api/v1/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"credit_used": 1,
"message": {
"author": {
"name": "Bill Gates",
"profile_url": "https://www.linkedin.com/in/williamhgates",
"headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
"profile_image": "https://media.licdn.com/...",
"cover_image": "https://media.licdn.com/...",
"followers_count": 37242615,
"posts_count": 1418,
"articles_count": 256
},
"author_linkedin_url": "https://www.linkedin.com/in/williamhgates",
"author_linkedin_id": "williamhgates",
"content": "Post content text...",
"post_type": "post",
"published_date": "Sun, 15 Dec 2024 10:00:00 GMT",
"post_url": "https://www.linkedin.com/posts/williamhgates_...",
"post_id": "7274567890123456789",
"transcript": null,
"meta": {},
"likes": 5420,
"comments_count": 125,
"shares": 0,
"video": {},
"image": {},
"comments": [],
"embedded_links": [],
"hashtags": []
}
}
Post (Deprecated)
This endpoint is deprecated. Use Post Details
(
POST /api/v1/post, singular) instead.POST /api/v1/posts (plural) is a legacy alias backed by public-page HTML scraping.
It returns a different, less reliable shape than /post, and its field availability
changes whenever LinkedIn changes its public page markup. It is kept only so existing
integrations do not break.If you are looking for engagement counts and a publish timestamp, /post returns them
as social_count.num_likes / num_comments / num_shares and posted_at.1 credit / successful request.
Post endpoint
Retrieves post data by scraping the public LinkedIn page for a post URL.Required attributes
string
required
The LinkedIn post URL.
Response
{
"credit_used": 1,
"message": {
"author": {
"name": "Bill Gates",
"profile_url": "https://www.linkedin.com/in/williamhgates",
"headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
"profile_image": "https://media.licdn.com/...",
"cover_image": "https://media.licdn.com/...",
"followers_count": 37242615,
"posts_count": 1418,
"articles_count": 256
},
"author_linkedin_url": "https://www.linkedin.com/in/williamhgates",
"author_linkedin_id": "williamhgates",
"content": "Post content text...",
"post_type": "post",
"published_date": "Sun, 15 Dec 2024 10:00:00 GMT",
"post_url": "https://www.linkedin.com/posts/williamhgates_...",
"post_id": "7274567890123456789",
"transcript": null,
"meta": {},
"likes": 5420,
"comments_count": 125,
"shares": 0,
"video": {},
"image": {},
"comments": [],
"embedded_links": [],
"hashtags": []
}
}
The post model
Properties
object
The scraped post payload.
Show Post object
Show Post object
string
The post text.
string
Either
"post" or "video".string | null
An RFC 1123 date string such as
"Sun, 15 Dec 2024 10:00:00 GMT", or null.When the page carries no JSON-LD date, this is reconstructed from LinkedIn’s
relative timestamp ("2d", "1w", "1mo") and is therefore approximate.
For an exact ISO 8601 publish time, use posted_at from
Post Details.string
URL of the post.
string
Numeric post identifier parsed from the URL.
string | null
Video transcript, when the post is a video and LinkedIn exposes one.
object
Open Graph and meta tags scraped from the page.
Author
object
string
Same as
author.profile_url.string
The author’s profile vanity slug.
Engagement
These counters are flat top-level fields on this endpoint.
/post returns the same
information nested under social_count, with a per-reaction-type breakdown.integer
Reaction count shown on the public page.
integer
Comment count shown on the public page.
integer
Always
0. LinkedIn’s public post page does not expose a share count. Use
social_count.num_shares from Post Details.Media and links
object
Image metadata, or
{} when the post has no images.object
Video metadata, or
{} when the post has no video.array
URLs found in the post body.
array
Hashtags used in the post.
array
Only the comments LinkedIn renders on the public page, not the full thread. Use
Post Comments to retrieve every comment.
integer
Number of credits consumed by this request.
Was this page helpful?