POST /post_keyword_search • Credits: 0.1 credits per returned post
Post Keyword Search finds public LinkedIn posts that match a keyword. The response holds a content array of posts with the author, the post text, the engagement counts and the share URL. Each returned post costs 0.1 credits, so a full page of 50 posts costs 5 credits.
What does Post Keyword Search do?
A marketing team needs to know who talks about a topic on LinkedIn. Post Keyword Search runs one keyword query across public LinkedIn posts and returns the matches as JSON. Seven filters narrow the search by date, by content type, by author and by company. The data source is LinkedIn. One call returns one page of posts, plus totalElements and totalPages for the whole result set. The other post endpoints start from a known company or a known person. Post Keyword Search starts from a topic and finds the authors for you.
Which endpoint does Post Keyword Search use?
Method:
POSTURL:
https://api.richapi.ai/api/v1/post_keyword_searchAuthentication:
x-api-keyheaderRequest format: JSON request body
Response: Synchronous JSON
Page size: 1 to 50 posts, set by
limitCredits: 0.1 credits per returned post
Post Keyword Search accepts the POST method only. Every parameter goes in the JSON request body. If you send GET, the API returns 405 with the message post_keyword_search only supports POST.
How to send a Post Keyword Search request
Copy your API key from the RichAPI dashboard.
Set
keywordin the JSON request body. This parameter is required.Set
limitto the number of posts per page. The maximum is50.Set
pageto0for the first page. The count starts at 0.Set
sorttoDATE_POSTEDfor the newest posts first.Add any filter parameter from the filter table to narrow the search.
Send a
POSTrequest tohttps://api.richapi.ai/api/v1/post_keyword_search.Send the API key in the
x-api-keyheader.Read the posts from the
contentarray in the response.Read
totalPagesto find how many pages the result set holds.
CAUTION: Set limit on every request. Each returned post costs 0.1 credits, so a full pass over 483 posts costs 48.3 credits.
cURL
curl -X POST https://api.richapi.ai/api/v1/post_keyword_search
-H "x-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"keyword": "artificial intelligence",
"sort": "DATE_POSTED",
"datePosted": "PAST_WEEK",
"page": 0,
"limit": 50
}'
Python
import requests
response = requests.post(
"https://api.richapi.ai/api/v1/post_keyword_search",
headers={"x-api-key": "YOUR_API_KEY"},
json={
"keyword": "artificial intelligence",
"sort": "DATE_POSTED",
"datePosted": "PAST_WEEK",
"page": 0,
"limit": 50,
},
timeout=60,
)
response.raise_for_status()
print(response.json())
Node.js
const response = await fetch("https://api.richapi.ai/api/v1/post_keyword_search", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
keyword: "artificial intelligence",
sort: "DATE_POSTED",
datePosted: "PAST_WEEK",
page: 0,
limit: 50,
}),
});
const data = await response.json();
console.log(data);
What parameters does Post Keyword Search accept?
Post Keyword Search accepts ten parameters. Only keyword is required. The names below are the real request body names.
Parameter | Type | Required | Default | Description |
| string | Yes | none | The search keyword, for example |
| integer | No |
| The page number. The count starts at 0. |
| integer | No |
| The number of posts per page. The accepted range is |
| string | No |
| The sort order. Accepted values: |
| string | No | none | The date filter. Accepted values: |
| string | No | none | The content type filter. Accepted values: |
| array | No |
| Person entity URNs. The API returns only the posts of those people. |
| array | No |
| Company entity URNs. The API returns only the posts of those company pages. |
| array | No |
| Author job titles, for example |
| array | No |
| Author industry values. |
If you omit sort, the API sorts by RELEVANCE. If you omit datePosted or contentType, the search applies no date filter or content filter.
Which parameter name does the Post Keyword Search body reject?
The request body accepts the ten names in the parameter table and no others. If the body holds any other key, the API returns 400 with the message Unknown input field(s): <name>.
One name often causes this failure. The page size parameter is limit. The request body rejects size.
Do not send this name | Send this parameter instead |
|
|
How do I filter LinkedIn posts by date, content type and author?
Post Keyword Search has seven filter parameters. Combine them in one request body to narrow the result set.
Parameter | Type | Accepted values | Effect |
| string |
|
|
| string |
| The API returns only the posts inside that window. |
| string |
| The API returns only the posts with that attachment type. |
| array | Person entity URNs | The API returns only the posts of those people. |
| array | Company entity URNs | The API returns only the posts of those company pages. |
| array | Author job titles | The API returns only the posts of authors with a matched job title. |
| array | Author industry values | The API returns only the posts of authors in those industries. |
The example below finds video posts about developer tools from the past week. The author job title must match Head of Growth.
curl -X POST https://api.richapi.ai/api/v1/post_keyword_search
-H "x-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"keyword": "developer tools",
"datePosted": "PAST_WEEK",
"contentType": "VIDEO",
"authorKeyword": ["Head of Growth"],
"sort": "DATE_POSTED",
"page": 0,
"limit": 50
}'
How does Post Keyword Search pagination work?
Post Keyword Search returns one page per call. Set limit to the page size and page to the page number. The page count starts at 0, so page: 0 returns the first page.
To read the next page, send the same request body again with page set to 1. Keep every other parameter the same, so that the result set and the order stay stable. Read totalPages to find how many pages the result set holds. Read totalElements to find the total number of matched posts. The first and last booleans mark the first page and the last page of the result set.
Each returned post costs 0.1 credits. The page size changes the number of calls, not the total cost.
How do I use Post Keyword Search for social listening?
Post Keyword Search turns a topic into a list of named authors and ranked posts. Follow these steps for a weekly social listening run.
Build one keyword per topic that you track, for example a product name or a category.
Send one request per keyword with
datePostedset toPAST_WEEK.Set
sorttoDATE_POSTEDandlimitto50.Read
content[].commentaryfor each post and match it against your trigger words.Rank the posts by
content[].numReactionsandcontent[].numComments.Read
content[].actor.followerCountto find the authors with the largest audience.Store
content[].urnso that a later run can skip a post that you saw before.Send
content[].shareUrlto your team as the reply target.
To find the people who reacted to a post, send the post URN to the RichAPI Post Activities endpoint. To enrich an author, send the profile URL to the RichAPI Profile Enrichment endpoint.
What does Post Keyword Search return?
The example below shows one post from a page of 10. A full page holds up to limit posts.
{
"content": [
{
"urn": "urn:li:activity:7429959579599532032",
"time": "2 hours ago",
"actor": {
"url": "https://www.linkedin.com/in/priyanathan",
"name": "Priya Nathan",
"profileType": "PERSON",
"followerCount": 15420
},
"content": {
"image": null
},
"shareUrl": "https://www.linkedin.com/posts/priyanathan_artificial-intelligence-activity-7429959579599532032-K4pQ",
"commentary": "We moved our retrieval pipeline to a smaller model this quarter. Latency dropped 40 percent and quality held. Full write-up in the comments.",
"numComments": 16,
"numReactions": 108,
"reactionType": {
"like": 101,
"interest": 2,
"appreciation": 5
}
}
],
"first": true,
"last": false,
"totalPages": 49,
"totalElements": 483,
"numberOfElements": 10
}
Which fields does the Post Keyword Search response hold?
Field | Type | Description |
| array | The matched posts on this page. |
| boolean |
|
| boolean |
|
| integer | The total number of pages in the result set. |
| integer | The total number of matched posts across every page. |
| integer | The number of posts on this page. |
Which fields does each matched post hold?
Each object in the content array holds the fields below.
Field | Type | Description |
| string | The LinkedIn activity URN of the post, for example |
| string | The post text. |
| string | The public LinkedIn URL of the post. |
| string | The relative publication time, for example |
| integer | The total number of reactions on the post. |
| integer | The number of comments on the post. |
| object | The count for each reaction type. |
| integer | The number of |
| integer | The number of |
| integer | The number of |
| object | The author of the post. |
| string | The author name, for example |
| string | The LinkedIn URL of the author. |
| string | The author type, for example |
| integer | The number of followers of the author. |
| object | The media attached to the post. |
| string | The attached image URL. The value is |
How much does Post Keyword Search cost?
Post Keyword Search costs 0.1 credits for each post in the response. One credit costs $0.02 on the 1,000 and 5,000 credit packs, so one post costs $0.002 there. Larger packs cost less per credit.
RichAPI charges 0.1 credits for each post in a 2xx response. A response outside the 200 range costs nothing.
Cost of one call, by page size:
| Posts returned | Credits | Cost |
10 | 10 | 1 | $0.02 |
50 | 50 | 5 | $0.10 |
50 | 0 | 0 | $0.00 |
Cost of many calls, at 50 posts per call:
Calls | Credits | Cost |
1 | 5 | $0.10 |
10 | 50 | $1.00 |
100 | 500 | $10.00 |
1,000 | 5,000 | $100.00 |
Because the price is per post, the page size does not change the cost of a full pass. A result set of 483 posts costs 48.3 credits at every limit value.
| Pages for 483 posts | Credits | Cost |
10 | 49 | 48.3 | $0.97 |
25 | 20 | 48.3 | $0.97 |
50 | 10 | 48.3 | $0.97 |
Is Post Keyword Search billed per call or per result?
Post Keyword Search is billed per result: 0.1 credits for each post on the page that you receive. totalElements does not change the price.
A search that returns one page of 50 posts costs 5 credits. A search that returns one page of 10 posts costs 1 credit. The keyword can match 40 posts or 4 million: only the posts that you receive count.
The totalElements value in the response tells you how many posts match your keyword across all pages. It is a count, not a charge. To read more of that set, send more pages. Each post on them costs 0.1 credits.
Which errors can Post Keyword Search return?
Status | Meaning | What to do |
| The request body failed validation. An unknown body key or a wrong value type causes this failure. | Correct the parameter that the error message names. Use the ten names in the parameter table. |
| The API key is missing or wrong. | Send a valid key in the |
| The organization has no credits left, or the team reached its monthly spend limit. | Buy credits in the RichAPI dashboard. |
| The API key has no access, or Post Keyword Search is not on the plan. | Check the plan and the endpoint access in the RichAPI dashboard. |
| The request used a method other than | Send the request again with the |
| Too many requests. | Read the |
| The API failed. | Send the request again. If the failure repeats, write to [email protected]. |
| The LinkedIn data source failed. | Send the request again. If the failure repeats, write to [email protected]. |
RichAPI charges no credit for any response outside the 200 range.
Frequently asked questions
How much does one Post Keyword Search call cost?
Post Keyword Search costs 0.1 credits per returned post, so a full page of 50 posts costs 5 credits. That is $0.10 on the 1,000 and 5,000 credit packs. Larger packs cost less per credit. The totalElements count in the response does not change the price.
Does Post Keyword Search charge per result or per call?
Post Keyword Search charges 0.1 credits per returned post. It does not bill from totalElements. A call that returns 50 posts costs 5 credits, and a call that returns 1 post costs 0.1 credits.
Is Post Keyword Search a GET or a POST endpoint?
Post Keyword Search is a POST endpoint at https://api.richapi.ai/api/v1/post_keyword_search. Every parameter goes in the JSON request body. A GET request returns 405.
Why does Post Keyword Search return Unknown input field(s): size?
The request body parameter for the page size is limit, not size. The request body rejects size with a 400 error.
How many LinkedIn posts does one Post Keyword Search page return?
One Post Keyword Search page returns up to 50 posts in the content array. Set limit to the page size. Read numberOfElements for the count on the page that you received.
How do I get the second page of Post Keyword Search results?
Send the same request body again with page set to 1. The page count starts at 0, so page: 0 is the first page and page: 1 is the second page.
What does Post Keyword Search cost for zero results?
A Post Keyword Search call that returns zero posts costs 0 credits, because the price is per returned post.
How do I find posts written by one company only?
Set fromCompany to an array of company entity URNs. To read the whole feed of one company page, use the RichAPI LinkedIn Company Posts endpoint. That endpoint costs 0.2 credits per returned post.
What engagement data does Post Keyword Search return?
Each post holds numReactions, numComments and a reactionType object. The reactionType object holds one count per reaction type, for example like, interest and appreciation.
