Perform posts search
Learn how to search for posts on LinkedIn using Unipile API.
Unipile offers two methods tu run a search :
- With filters : you provide any combination of parameters directly in the method body. E.g. : keywords, date_posted, author, etc.
- From URL : you provide the URL of a LinkedIn native search so the filters can be automatically infered.
Note about Search ParametersMany of the search filters on LinkedIn work with IDs that reference parameters, rather than the parameters themselves.
For example, in the
posted_by[member]filter, you cannot directly insertJohn Doe, but instead you should use the corresponding member ID.Use the List Classic Search Parameters endpoint to help you find the IDs of the parameters you need.
Search with filters
To get a list of posts search results with filters, use the Perform Posts Search endpoint with a parameters body.
Note about paginationPagination on this endpoint uses exclusively the
offsetparameter.
const { data } = await linkedInApi.performClassicPostsSearch({
path: {
account_id: "acc_123456789",
},
body: {
keywords: 'Productivity',
posted_by: {
member: ['ACoA1B2C3D4E5F6g7Hi8J9K1L2m3NOpqRSTUvWxYZ']
}
},
});posts = linked_in_api.perform_classic_posts_search(
"acc_123456789",
perform_classic_posts_search_request={
"keywords": "Productivity",
"posted_by": {
"member": ["ACoA1B2C3D4E5F6g7Hi8J9K1L2m3NOpqRSTUvWxYZ"]
},
},
)curl --request POST \
--url https://api.unipile.com/v2/account_id/linkedin/search/posts \
--header 'accept: application/json'
--data '
{
"keywords": "Productivity",
"posted_by": {
member: ["ACoA1B2C3D4E5F6g7Hi8J9K1L2m3NOpqRSTUvWxYZ"]
}
}'Search from URL
For a URL to be considered valid in the context of a posts search, it must match the following pattern : https://www.linkedin.com/search/results/content.
To get a list of posts search results out of a URL, use Perform Classic Search from URL.
const { data } = await linkedInApi.performClassicSearchFromUrl({
path: {
account_id: "acc_123456789",
},
body: {
url: "https://www.linkedin.com/search/results/content?[...]",
},
});posts = linked_in_api.perform_classic_search_from_url(
"acc_123456789",
{"url": "https://www.linkedin.com/search/results/content?[...]"},
)curl --request POST \
--url https://api.unipile.com/v2/account_id/linkedin/search \
--header 'accept: application/json'
--data '
{
"url": "https://www.linkedin.com/search/results/content?[...]"
}'Updated 3 months ago