LinkedIn Company Posts API: How to Access Company Posts
Learn how to use the Fresh LinkedIn Scraper API to retrieve company posts data from LinkedIn companies without OAuth authentication.

LinkedIn Company Posts API: How to Access Company Posts
Accessing LinkedIn company posts programmatically can provide valuable insights for competitive analysis, content strategy, and market research. In this guide, we'll explore how to use the Fresh LinkedIn Scraper API to retrieve comprehensive company post data without complex OAuth authentication.
Table of Contents
- Why Access LinkedIn Company Posts Data?
- The Fresh LinkedIn Scraper API
- How to Get LinkedIn Company Posts Data
- Understanding the API Response
- Code Examples
- Best Practices
Why Access LinkedIn Company Posts Data?
LinkedIn hosts millions of company posts that provide valuable business intelligence. Programmatic access to this data offers numerous benefits:
- Competitive Intelligence: Monitor competitor content strategies and posting patterns
- Content Strategy: Analyze successful post types and engagement metrics in your industry
- Market Research: Track industry trends and company announcements
- Brand Monitoring: Keep track of mentions and discussions about your company or industry
- Lead Generation: Identify companies posting about relevant topics or opportunities
The Fresh LinkedIn Scraper API
The Fresh LinkedIn Scraper API on RapidAPI provides a simple way to access LinkedIn company posts data without:
- Complex OAuth authentication
- LinkedIn developer program approval
- Rate limiting concerns of direct scraping
- Terms of service violations
How to Get LinkedIn Company Posts Data
To retrieve posts from a specific company, you'll use the company posts endpoint with a company ID.
API Endpoint
GET https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/posts
Request Parameters
Parameter | Required | Description |
---|---|---|
company_id |
Yes | LinkedIn company ID (e.g., "10649600") |
sort_by |
No | Sort post by top or recent. ("top", "recent") |
page |
No | Page number for pagination (default: 1) |
Required Headers
x-rapidapi-host: fresh-linkedin-scraper-api.p.rapidapi.com
x-rapidapi-key: YOUR_RAPID_API_KEY
Example Request
curl --request GET \
--url 'https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/posts?company_id=10649600' \
--header 'x-rapidapi-host: fresh-linkedin-scraper-api.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPID_API_KEY'
Understanding the API Response
The API returns a comprehensive JSON object with company posts data. Let's examine the key parts of the response:
Response Overview
{
"success": true,
"message": "success",
"process_time": 618,
"data": [
// Array of company posts
],
"cost": 1,
"page": 1,
"total": 150,
"has_more": true
}
Individual Company Post
Each post in the response contains comprehensive post information:
{
"success": true,
"message": "success",
"process_time": 752,
"cost": 1,
"page": 1,
"total": 107,
"has_more": true,
"data": [
{
"id": "6995772975836737536",
"text": "RapidAPI is now Rapid. You read that correct! We are thrilled to rollout our refreshed Rapid brand, including a new name, logo (is it an \"R\", an octopus or both) and new colors that match our exciting growth as we expand our focus on delivering the next-generation platform to power the API economy. We are rapidly expanding the types of software, services and support we provide to our developer community and we're thrilled you are here to join us for the ride. Check out our blog from our CEO #growth #community #developer #brand Iddo Gino on more about what this rebrand means for the company, our employees and you. https://lnkd.in/dTmnxxit",
"content": {
"images": null,
"video": null,
"document": null,
"article": {
"title": "Introducing Our New Brand: Rapid",
"subtitle": "rapidapi.com",
"article_url": "https://rapidapi.com/blog/rapid-api-brand-refresh/",
"image": [
{
"width": 800,
"height": 444,
"url": "https://media.licdn.com/dms/image/sync/v2/C4E27AQFGKQn86XM1qw/articleshare-shrink_800/articleshare-shrink_800/0/1720582532852?e=1744012800&v=beta&t=IYogLeP3gnQIaey7ycnHkqHm3p5aJYBEmmMp4BPLIQU",
"expires_at": 1744012800000
},
{
"width": 1280,
"height": 711,
"url": "https://media.licdn.com/dms/image/sync/v2/C4E27AQFGKQn86XM1qw/articleshare-shrink_1280_800/articleshare-shrink_1280_800/0/1720582532852?e=1744012800&v=beta&t=ihH28avCmEGbI3JfB9DhpJ0Z5NLak5L3bK6A2kQEF0w",
"expires_at": 1744012800000
},
{
"width": 160,
"height": 88,
"url": "https://media.licdn.com/dms/image/sync/v2/C4E27AQFGKQn86XM1qw/articleshare-shrink_160/articleshare-shrink_160/0/1720582532852?e=1744012800&v=beta&t=MQIvXEdD-sW_NlFVO_ecuvpGP1r2tFOVz6lbRBGsY_c",
"expires_at": 1744012800000
},
{
"width": 480,
"height": 266,
"url": "https://media.licdn.com/dms/image/sync/v2/C4E27AQFGKQn86XM1qw/articleshare-shrink_480/articleshare-shrink_480/0/1720582532852?e=1744012800&v=beta&t=pX-SgieMtjwOR3jM8UR0IEVLnCZFg_o6of4776zPMbE",
"expires_at": 1744012800000
}
]
},
"celebration": null,
"poll": null,
"event": null
},
"activity": {
"num_likes": 159,
"num_comments": 10,
"num_shares": 20,
"reaction_counts": [
{
"count": 135,
"type": "LIKE"
},
{
"count": 15,
"type": "PRAISE"
},
{
"count": 9,
"type": "EMPATHY"
}
]
},
"author": {
"id": "10649600",
"url": "https://www.linkedin.com/company/rapidapi/",
"name": "Rapid",
"follower_count": 24383,
"avatar": [
{
"width": 200,
"height": 200,
"url": "https://media.licdn.com/dms/image/v2/D560BAQHnqRt58Ae7ig/company-logo_200_200/company-logo_200_200/0/1731507876313/rapidapi_logo?e=1749081600&v=beta&t=YGqYWDGZrRukb8R_vawcfMSySySBX_fdHh5renY2mD4",
"expires_at": 1749081600000
},
{
"width": 100,
"height": 100,
"url": "https://media.licdn.com/dms/image/v2/D560BAQHnqRt58Ae7ig/company-logo_100_100/company-logo_100_100/0/1731507876313/rapidapi_logo?e=1749081600&v=beta&t=Z8xtb2oMEJc2UiCvBah0uiefkDuPqEnHsaQYabzS82o",
"expires_at": 1749081600000
},
{
"width": 400,
"height": 400,
"url": "https://media.licdn.com/dms/image/v2/D560BAQHnqRt58Ae7ig/company-logo_400_400/company-logo_400_400/0/1731507876313/rapidapi_logo?e=1749081600&v=beta&t=ohr6N4R_CuHgPMNg6Wy3fRndPWOzW2mcYmDyQ3pWF38",
"expires_at": 1749081600000
}
],
"account_type": "company"
},
"created_at": "2023-03-31T07:48:50.088Z",
"url": "https://www.linkedin.com/feed/update/urn:li:activity:6995772975836737536",
"share_urn": "urn:li:share:6995772975106932736"
}
]
}
Code Examples
Here are implementation examples in popular programming languages:
JavaScript/Node.js
const axios = require("axios");
const options = {
method: "GET",
url: "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/posts",
params: {
company_id: "10649600",
page: "1",
},
headers: {
"x-rapidapi-host": "fresh-linkedin-scraper-api.p.rapidapi.com",
"x-rapidapi-key": "YOUR_RAPID_API_KEY",
},
};
async function getCompanyPosts() {
try {
const response = await axios.request(options);
console.log(response.data);
return response.data;
} catch (error) {
console.error(error);
}
}
getCompanyPosts();
Python
import requests
url = "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/posts"
querystring = {
"company_id": "10649600",
"page": "1"
}
headers = {
"x-rapidapi-host": "fresh-linkedin-scraper-api.p.rapidapi.com",
"x-rapidapi-key": "YOUR_RAPID_API_KEY"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.json())
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/posts?company_id=10649600&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-host: fresh-linkedin-scraper-api.p.rapidapi.com",
"x-rapidapi-key: YOUR_RAPID_API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Best Practices
When using the LinkedIn Company Posts API, follow these best practices:
1. Implement Pagination for Complete Results
Company posts data is paginated, so retrieve all pages for complete results:
async function getAllCompanyPosts(companyId) {
let allPosts = [];
let currentPage = 1;
let hasMore = true;
while (hasMore) {
const options = {
method: "GET",
url: "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/posts",
params: {
company_id: companyId,
page: currentPage.toString(),
},
headers: {
"x-rapidapi-host": "fresh-linkedin-scraper-api.p.rapidapi.com",
"x-rapidapi-key": "YOUR_RAPID_API_KEY",
},
};
const response = await axios.request(options);
allPosts = [...allPosts, ...response.data.data];
hasMore = response.data.has_more;
currentPage++;
// Optional: Add delay to avoid rate limiting
await new Promise((resolve) => setTimeout(resolve, 1000));
}
return allPosts;
}
2. Analyze Engagement Metrics
Transform the API response to analyze post performance:
function analyzePostEngagement(postsData) {
const analysis = {
total_posts: postsData.length,
avg_likes: 0,
avg_comments: 0,
avg_shares: 0,
top_performing_posts: [],
};
if (postsData.length > 0) {
const totalLikes = postsData.reduce(
(sum, post) => sum + (post.engagement?.likes_count || 0),
0
);
const totalComments = postsData.reduce(
(sum, post) => sum + (post.engagement?.comments_count || 0),
0
);
const totalShares = postsData.reduce(
(sum, post) => sum + (post.engagement?.shares_count || 0),
0
);
analysis.avg_likes = totalLikes / postsData.length;
analysis.avg_comments = totalComments / postsData.length;
analysis.avg_shares = totalShares / postsData.length;
// Find top performing posts
analysis.top_performing_posts = postsData
.sort(
(a, b) =>
(b.engagement?.total_engagement || 0) -
(a.engagement?.total_engagement || 0)
)
.slice(0, 5);
}
return analysis;
}
3. Implement Caching
Company posts data doesn't change very frequently. Implement caching to reduce API calls:
const NodeCache = require("node-cache");
const cache = new NodeCache({ stdTTL: 3600 }); // Cache for 1 hour
async function getCompanyPostsWithCache(companyId, page) {
const cacheKey = `posts_${companyId}_${page}`;
// Check if data exists in cache
const cachedData = cache.get(cacheKey);
if (cachedData) {
return cachedData;
}
// Fetch new data
const response = await axios.request({
// API request options...
params: {
company_id: companyId,
page: page,
},
});
// Store in cache
cache.set(cacheKey, response.data);
return response.data;
}
4. Filter Posts by Content Type
Categorize posts based on their content and media:
function categorizePostsByType(posts) {
const categories = {
text_only: [],
with_images: [],
with_videos: [],
job_posts: [],
announcements: [],
};
posts.forEach((post) => {
if (post.media?.videos?.length > 0) {
categories.with_videos.push(post);
} else if (post.media?.images?.length > 0) {
categories.with_images.push(post);
} else {
categories.text_only.push(post);
}
// Categorize by content keywords
const text = post.text?.toLowerCase() || "";
if (
text.includes("hiring") ||
text.includes("job") ||
text.includes("career")
) {
categories.job_posts.push(post);
}
if (
text.includes("announce") ||
text.includes("excited") ||
text.includes("launch")
) {
categories.announcements.push(post);
}
});
return categories;
}
By following this guide, you'll be able to effectively access and utilize LinkedIn company posts data through the Fresh LinkedIn Scraper API, enabling powerful competitive analysis, content strategy optimization, and market research applications without the complexity of LinkedIn's official API.