Send Post Time Spent Signal
curl --request POST \
--url https://api.linkupapi.com/v1/posts/time-spent \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"post_url": "<string>",
"duration": 123,
"duration_start_time": 123,
"login_token": "<string>",
"country": "<string>"
}
'import requests
url = "https://api.linkupapi.com/v1/posts/time-spent"
payload = {
"post_url": "<string>",
"duration": 123,
"duration_start_time": 123,
"login_token": "<string>",
"country": "<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>',
duration: 123,
duration_start_time: 123,
login_token: '<string>',
country: '<string>'
})
};
fetch('https://api.linkupapi.com/v1/posts/time-spent', 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/time-spent",
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>',
'duration' => 123,
'duration_start_time' => 123,
'login_token' => '<string>',
'country' => '<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/time-spent"
payload := strings.NewReader("{\n \"post_url\": \"<string>\",\n \"duration\": 123,\n \"duration_start_time\": 123,\n \"login_token\": \"<string>\",\n \"country\": \"<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/time-spent")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"post_url\": \"<string>\",\n \"duration\": 123,\n \"duration_start_time\": 123,\n \"login_token\": \"<string>\",\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/v1/posts/time-spent")
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 \"duration\": 123,\n \"duration_start_time\": 123,\n \"login_token\": \"<string>\",\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Time spent signal sent successfully"
}
{
"status": "error",
"message": "duration must be a positive integer (milliseconds)"
}
{
"status": "error",
"message": "Invalid post URL format"
}
{
"status": "error",
"message": "Invalid or expired LinkedIn authentication cookie"
}
Content & Posts
Send Post Time Spent Signal
Send time spent signal for a LinkedIn post to track engagement duration
POST
/
v1
/
posts
/
time-spent
Send Post Time Spent Signal
curl --request POST \
--url https://api.linkupapi.com/v1/posts/time-spent \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"post_url": "<string>",
"duration": 123,
"duration_start_time": 123,
"login_token": "<string>",
"country": "<string>"
}
'import requests
url = "https://api.linkupapi.com/v1/posts/time-spent"
payload = {
"post_url": "<string>",
"duration": 123,
"duration_start_time": 123,
"login_token": "<string>",
"country": "<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>',
duration: 123,
duration_start_time: 123,
login_token: '<string>',
country: '<string>'
})
};
fetch('https://api.linkupapi.com/v1/posts/time-spent', 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/time-spent",
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>',
'duration' => 123,
'duration_start_time' => 123,
'login_token' => '<string>',
'country' => '<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/time-spent"
payload := strings.NewReader("{\n \"post_url\": \"<string>\",\n \"duration\": 123,\n \"duration_start_time\": 123,\n \"login_token\": \"<string>\",\n \"country\": \"<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/time-spent")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"post_url\": \"<string>\",\n \"duration\": 123,\n \"duration_start_time\": 123,\n \"login_token\": \"<string>\",\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/v1/posts/time-spent")
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 \"duration\": 123,\n \"duration_start_time\": 123,\n \"login_token\": \"<string>\",\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Time spent signal sent successfully"
}
{
"status": "error",
"message": "duration must be a positive integer (milliseconds)"
}
{
"status": "error",
"message": "Invalid post URL format"
}
{
"status": "error",
"message": "Invalid or expired LinkedIn authentication cookie"
}
Send a time spent signal to LinkedIn indicating how long a user spent viewing a specific post. This helps with engagement tracking and analytics.
This endpoint costs 1 credit per request. Ignore this if you’re on per-seat pricing: usage is unlimited.
Header Parameters
string
required
Your API key
Body Parameters
string
required
URL of the LinkedIn post to send time spent signal for
integer
required
Duration in milliseconds that the user spent viewing the post. Must be a positive integer.
integer
Optional start time in milliseconds when the user began viewing the post
string
required
LinkedIn authentication cookie obtained from the login/verify process
string
default:"FR"
Country code for proxy selection. Available: (US, UK, FR, DE, NL, IT, IL, CA, BR, ES, IN)
Response
string
Request status (success/error)
string
Detailed status message about the time spent signal request
{
"status": "success",
"message": "Time spent signal sent successfully"
}
{
"status": "error",
"message": "duration must be a positive integer (milliseconds)"
}
{
"status": "error",
"message": "Invalid post URL format"
}
{
"status": "error",
"message": "Invalid or expired LinkedIn authentication cookie"
}
Notes
Duration Requirements
- Duration must be provided in milliseconds
- Must be a positive integer value
- Represents the actual time spent viewing the post
Optional Parameters
duration_start_time: Can be used to specify when the viewing session began- If provided, must be an integer in milliseconds
Post URL Support
- Supports multiple LinkedIn post URL formats
- Must be a valid LinkedIn post that is accessible with the provided login token
- The API automatically extracts the activity ID from the URL
Error Handling
- Invalid Cookie: Returned when the login token is expired or invalid
- Invalid Post URL: Returned when the post URL format is incorrect or the activity ID cannot be extracted
- Invalid Parameters: Returned when required parameters are missing or have invalid values
- Insufficient Credits: Returned when the API key doesn’t have enough credits
Engagement Tracking
- Signals are sent to LinkedIn’s analytics system
- The signal is associated with the user identity from the login token
Rate Limits
- Consider implementing appropriate delays between requests
Was this page helpful?