Search posts
GET
/v1/post-search
$0.0400 per request
Search LinkedIn posts by keywords, author, date range, and more.
Search LinkedIn posts by keywords, author, date range, and more.
Try it
Runs against the sandbox, so it is free and needs no API key. The response shape is identical to the live endpoint.
GET
Sandbox · free
/v1/post-search
Parameters
Billed equivalent
With a real key this call costs at Starter, less your tier discount.
Response
msQuery parameters
| Parameter | Example | Description |
|---|---|---|
authorsCompany
|
— | List of LinkedIn companies where authors of posts work (comma-separated) |
authorsCompanyId
|
— | List of LinkedIn company IDs where authors of posts work (comma-separated) |
company
|
— | Filter posts by this company URL or URLs (comma-separated). Note: LinkedIn returns fewer results per company when using post search. To extract all posts by a company, use the /linkedin/company-posts endpoint |
companyId
|
— | Filter posts by company ID or IDs (comma-separated). It's faster to search by ID. Note: LinkedIn returns fewer results per company when using post search. To extract all posts by a company, use the /linkedin/company-posts endpoint |
group
|
https://www.linkedin.com/groups/1898033/ | Group LinkedIn URL or Group ID |
page
|
1 | Page number for pagination |
paginationToken
|
— | Required if it was returned by the previous page. Otherwise the page will always be 1 (on LinkedIn side). Doesn't apply for all queries, usually profile posts return this token |
postedLimit
|
— | Filter posts by maximum posted date. Supported values: '24h', 'week', 'month' |
profile
|
— | Filter posts by author's profile URL (comma-separated). Note: LinkedIn returns fewer results per profile when using post search. To extract all posts by a profile, use the /linkedin/profile-posts endpoint |
profileId
|
— | Filter posts by author's profile ID or IDs (comma-separated). It's faster to search by ID. Note: LinkedIn returns fewer results per profile when using post search. To extract all posts by a profile, use the /linkedin/profile-posts endpoint |
search
|
— | Keywords to search for in posts |
sortBy
|
— | Sort by field. Supported values: 'relevance', 'date' |
Code
curl 'https://api.enricho.io/v1/post-search?group=https%3A%2F%2Fwww.linkedin.com%2Fgroups%2F1898033%2F' \
-H 'X-API-Key: YOUR_API_KEY'
import requests
response = requests.get(
"https://api.enricho.io/v1/post-search",
headers={"X-API-Key": "YOUR_API_KEY"},
params={
'group': 'https://www.linkedin.com/groups/1898033/',
},
timeout=30,
)
response.raise_for_status()
# Every response reports what it cost and what is left.
print(response.headers["X-Request-Cost"], response.headers["X-Balance-Remaining"])
print(response.json())
const params = new URLSearchParams({
"group": "https://www.linkedin.com/groups/1898033/"
});
const response = await fetch(`https://api.enricho.io/v1/post-search?${params}`, {
headers: { 'X-API-Key': 'YOUR_API_KEY' },
});
if (!response.ok) {
throw new Error(`${response.status}: ${(await response.json()).error.message}`);
}
console.log(response.headers.get('X-Request-Cost'));
console.log(await response.json());
$client = new GuzzleHttp\Client();
$response = $client->get('https://api.enricho.io/v1/post-search', [
'headers' => ['X-API-Key' => 'YOUR_API_KEY'],
'query' => [
'group' => 'https://www.linkedin.com/groups/1898033/',
],
'timeout' => 30,
]);
echo $response->getHeaderLine('X-Request-Cost');
$data = json_decode((string) $response->getBody(), true);
Example response
{
"pagination": null,
"elements": null,
"error": "No valid target provided",
"status": 400,
"query": []
}
Error response
Full list of codes on the errors page.
{
"error": {
"code": "insufficient_balance",
"message": "Your balance is too low for this request.",
"docs": "https://enricho.io/docs/errors#insufficient_balance"
}
}