Get LinkedIn Ad by ID
curl --request GET \
--url https://api.harvestapi.io/linkedin/ad \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.harvestapi.io/linkedin/ad"
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.harvestapi.io/linkedin/ad', 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.harvestapi.io/linkedin/ad",
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.harvestapi.io/linkedin/ad"
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.harvestapi.io/linkedin/ad")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvestapi.io/linkedin/ad")
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{
"id": "<string>",
"variants": [
{
"advertiser": {
"name": "<string>",
"linkedinUrl": "<string>",
"imageUrl": "<string>",
"headline": "<string>"
},
"content": {
"description": "<string>",
"imageUrl": "<string>",
"videoThumbnailUrl": "<string>",
"videoSource": null,
"targetUrl": "<string>",
"headline": "<string>",
"ctaLabel": "<string>",
"slides": [
{
"imageUrl": "<string>",
"targetUrl": "<string>",
"title": "<string>"
}
]
},
"creativeType": "<string>"
}
],
"about": {
"format": "<string>",
"advertiserName": "<string>",
"advertiserUrl": "<string>",
"paidBy": "<string>",
"ranFrom": "<string>",
"ranTo": "<string>"
},
"impressions": {
"total": "<string>",
"byCountry": [
{
"name": "<string>",
"percentage": "<string>"
}
]
},
"targeting": {
"segments": [
{
"name": "<string>",
"includes": [
"<string>"
],
"excludes": [
"<string>"
]
}
],
"parameters": [
{
"name": "<string>",
"targeted": true,
"excluded": true
}
]
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}LinkedIn Ads
Get Ad Details
Retrieve detailed information about a specific LinkedIn Ad using its unique ID.
GET
/
linkedin
/
ad
Get LinkedIn Ad by ID
curl --request GET \
--url https://api.harvestapi.io/linkedin/ad \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.harvestapi.io/linkedin/ad"
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.harvestapi.io/linkedin/ad', 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.harvestapi.io/linkedin/ad",
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.harvestapi.io/linkedin/ad"
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.harvestapi.io/linkedin/ad")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvestapi.io/linkedin/ad")
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{
"id": "<string>",
"variants": [
{
"advertiser": {
"name": "<string>",
"linkedinUrl": "<string>",
"imageUrl": "<string>",
"headline": "<string>"
},
"content": {
"description": "<string>",
"imageUrl": "<string>",
"videoThumbnailUrl": "<string>",
"videoSource": null,
"targetUrl": "<string>",
"headline": "<string>",
"ctaLabel": "<string>",
"slides": [
{
"imageUrl": "<string>",
"targetUrl": "<string>",
"title": "<string>"
}
]
},
"creativeType": "<string>"
}
],
"about": {
"format": "<string>",
"advertiserName": "<string>",
"advertiserUrl": "<string>",
"paidBy": "<string>",
"ranFrom": "<string>",
"ranTo": "<string>"
},
"impressions": {
"total": "<string>",
"byCountry": [
{
"name": "<string>",
"percentage": "<string>"
}
]
},
"targeting": {
"segments": [
{
"name": "<string>",
"includes": [
"<string>"
],
"excludes": [
"<string>"
]
}
],
"parameters": [
{
"name": "<string>",
"targeted": true,
"excluded": true
}
]
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}const params = new URLSearchParams({
url: 'https://www.linkedin.com/ad-library/detail/1104386363',
// adId: '1104386363', // Alternatively, by Ad ID
});
fetch(`https://api.harvestapi.io/linkedin/ad?${params.toString()}`, {
headers: { 'X-API-Key': '<api-key>' },
})
.then((response) => response.json())
.then((data) => console.log(data));
curl --request GET \
--url https://api.harvestapi.io/linkedin/ad?adId=1104386363 \
--header 'X-API-Key: <api-key>'
import requests
url = "https://api.harvestapi.io/linkedin/ad?adId=1104386363"
headers = {"X-API-Key": "<api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
Authorizations
Query Parameters
The unique identifier of the LinkedIn Ad.
The URL of the LinkedIn Ad.
⌘I

