POST /linkedin_ad_search • Credits: 0.2 credit per ad returned
LinkedIn Ad Search finds ads in the public LinkedIn Ad Library. Send a POST request with a keyword, an advertiser name, a country list or a date range. The response holds one page of up to 24 ads with the headline, the image, the advertiser and the detail URL. Each call costs 0.2 credit for every ad in the elements array.
What does LinkedIn Ad Search do?
Every LinkedIn ad is public data. LinkedIn publishes each one in the LinkedIn Ad Library, and LinkedIn Ad Search reads that library through RichAPI. The endpoint accepts a keyword, an advertiser name, a country list, a date range or a full ad library search URL. It returns one page of matched ads in a single synchronous response. Sales teams and product teams use the endpoint to see which ads a competitor runs, and what message each ad carries. To read the creative variants, the impression counts and the targeting of one ad, send the ad detail URL to LinkedIn Ad Details.
Which endpoint does LinkedIn Ad Search use?
Method:
POSTURL:
https://api.richapi.ai/api/v1/linkedin_ad_searchAuthentication:
x-api-keyheaderResponse: Synchronous JSON
Credits: 0.2 credit per ad returned
Page size: Up to 24 ads per page
Pagination: Cursor, through
pagination_token
CAUTION: LinkedIn Ad Search accepts POST only. A GET request returns status 405 with the error linkedin_ad_search only supports POST.
How to send a LinkedIn Ad Search request
Copy your API key from the RichAPI dashboard.
Choose the filters for the ad search.
Put every filter in the JSON request body. Never put a filter in the query string.
Send at least one filter. An empty request body returns no useful match.
Send a
POSTrequest tohttps://api.richapi.ai/api/v1/linkedin_ad_search.Send the API key in the
x-api-keyheader.Read the ads from the
elementsarray of the response.Read
pagination.paginationTokento request the next page.
CAUTION: Each ad in the elements array costs 0.2 credit. A full page of 24 ads costs 4.8 credits.
cURL
curl -X POST https://api.richapi.ai/api/v1/linkedin_ad_search
-H "x-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"keyword": "marketing automation",
"countries": "US",
"date_option": "last-30-days"
}'
Python
import requests
response = requests.post(
"https://api.richapi.ai/api/v1/linkedin_ad_search",
headers={"x-api-key": "YOUR_API_KEY"},
json={
"keyword": "marketing automation",
"countries": "US",
"date_option": "last-30-days",
},
timeout=60,
)
response.raise_for_status()
print(response.json())
Node.js
const response = await fetch("https://api.richapi.ai/api/v1/linkedin_ad_search", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
keyword: "marketing automation",
countries: "US",
date_option: "last-30-days",
}),
});
const data = await response.json();
console.log(data);
What parameters does LinkedIn Ad Search accept?
Every LinkedIn Ad Search parameter goes in the JSON request body. Every parameter is optional, and each one narrows the search.
Parameter | Type | Required | Default | Description |
| string | No |
| Free text to search for in the ad text. |
| string | No |
| The advertiser or company name, for example |
| string | No |
| One country code, or a comma-separated list, for example |
| string | No |
| The date range of the ad. See the value table below. |
| string | No |
| The start date for the |
| string | No |
| The end date for the |
| string | No |
| The token from |
| string | No |
| A full LinkedIn Ad Library search URL. It replaces the individual filters. |
CAUTION: LinkedIn Ad Search rejects an unknown body field with status 400 and the error Unknown input field(s). Use the parameter names in the table above, character for character.
Which values does date_option accept?
The date_option parameter accepts five values. Send one value per request.
Value | Meaning |
| Ads from the last 30 days. |
| Ads from the current calendar month. |
| Ads from the current calendar year. |
| Ads from the previous calendar year. |
| Ads between |
If you send custom-date-range, send start_date and end_date as well.
How do I search with an ad library URL?
The search_url parameter takes a full LinkedIn Ad Library search URL. Build the search in the LinkedIn Ad Library, copy the URL from the browser, then send it as search_url.
{
"search_url": "https://www.linkedin.com/ad-library/search?accountOwner=UX+Pilot+AI&dateOption=custom-date-range&startdate=2026-06-01&enddate=2026-07-31"
}
CAUTION: The search_url parameter replaces the individual filters. Send search_url alone, or send the individual filters alone.
Does LinkedIn Ad Search accept GET?
No. Your request is always a POST request with the body names in the table above.
What does LinkedIn Ad Search return?
The block below is an example response. It shows one ad from a page of 24.
{
"query": {
"keyword": "marketing automation",
"countries": "US",
"date_option": "last-30-days",
"account_owner": "UX Pilot AI"
},
"status": 200,
"elements": [
{
"id": "1440550993",
"content": {
"pageUrl": "https://www.linkedin.com/ad-library/detail/1440550993",
"headline": "Generate wireframes in seconds",
"imageUrl": "https://media.licdn.com/dms/image/v2/D4D10AQHrygtedL9DNQ/image-shrink_1280/0/1743537684174/frame1000002823png",
"description": "Paste your PRD, generate multi-step flows with your actual components, and get screens that look like your product."
},
"advertiser": {
"name": "UX Pilot AI",
"headline": "Promoted",
"imageUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQF14xfiQrSfew/company-logo_100_100/0/1770218938904/uxpilot_ai_logo"
},
"creativeType": "SPONSORED_STATUS_UPDATE"
}
],
"pagination": {
"pageSize": 24,
"pageNumber": null,
"totalPages": 172,
"totalElements": 4128,
"paginationToken": "1460308964-1782143461901",
"previousElements": null
}
}
What does each LinkedIn Ad Search response field mean?
The top level of the LinkedIn Ad Search response holds four fields.
Field | Type | Description |
| object | The echo of the filters that the search used. |
| integer | The HTTP status from the upstream data provider. |
| array | The matched ads on this page. RichAPI bills 0.2 credit for each item. |
| object | The page size, the total match count and the token for the next page. |
Each item in the elements array holds four fields.
Field | Type | Description |
| string | The LinkedIn numeric ad ID. |
| object | The creative of the ad. |
| object | The account that paid for the ad. |
| string | The ad format, for example |
The content object holds four fields.
Field | Type | Description |
| string | The LinkedIn Ad Library detail URL of the ad. Send this URL to LinkedIn Ad Details. |
| string | The headline text of the ad. |
| string | The URL of the ad image. |
| string | The body text of the ad. LinkedIn truncates long text. |
The advertiser object holds three fields.
Field | Type | Description |
| string | The name of the advertiser, as shown on the ad. |
| string | The label under the advertiser name, for example |
| string | The URL of the advertiser logo or photo. |
The pagination object holds six fields.
Field | Type | Description |
| integer | The number of ads per page. The value is 24. |
| integer | The page number. The value is |
| integer | The number of pages that match the filters. |
| integer | The number of ads that match the filters. |
| string | The token for the next page. Send it as |
| integer | The number of ads before this page. The value can be |
How does pagination work in LinkedIn Ad Search?
LinkedIn Ad Search returns up to 24 ads per page, and one call returns one page. The endpoint pages by token, not by page number.
Send the first request with your filters and no
pagination_token.Read
pagination.totalElementsto see the size of the full match set.Read
pagination.paginationTokenfrom the response.Send the same filters again, and add
pagination_tokenwith that token value.Read the new
pagination.paginationTokenfrom each response.Repeat until the
elementsarray is empty.Keep every filter the same across the pages. A changed filter changes the result set.
CAUTION: Every page costs credits. To walk 10 pages of 24 ads, you pay for 240 ads, that is 48 credits. Narrow the filters before you walk many pages.
How do I see which ads a competitor runs?
LinkedIn Ad Search answers the competitive question directly, because the LinkedIn Ad Library is public. Follow these steps.
Set
account_ownerto the competitor company name, for exampleUX Pilot AI.Set
countriesto the markets that you track, for exampleUS,GB.Set
date_optiontolast-30-days.Send the request.
Read
advertiser.namein each item to confirm the advertiser.Read
content.headlineandcontent.descriptionto see the message of each ad.Read
creativeTypeto see the ad format that the competitor buys.Read
pagination.totalElementsto size the whole campaign.Send
content.pageUrlto LinkedIn Ad Details for the audience of one ad.
To compare two competitors, send one request per company name and compare the two elements arrays. To track a message instead of a company, send keyword with the phrase, and leave account_owner empty.
How does LinkedIn Ad Search pair with LinkedIn Ad Details?
LinkedIn Ad Search finds the ads. LinkedIn Ad Details reads one of those ads in full. The two endpoints work as a pair, and the content.pageUrl field joins them.
Item | LinkedIn Ad Search | |
Input | Filters, or one ad library search URL | One ad library detail URL, in |
Ads per call | Up to 24 | 1 |
Purpose | Find the ads of a company or a topic | Read one ad in full |
Fields returned |
|
|
Audience data | No | Yes, in |
Impression data | No | Yes, in |
Cost | 0.2 credit per ad returned | 2 credits per call |
To go from a search to the audience of one ad, follow these steps.
Send a LinkedIn Ad Search request with your filters.
Read
content.pageUrlfor each ad in theelementsarray.Choose the ads that you want to study.
Send each
pageUrlto LinkedIn Ad Details as thead_urlparameter.Read
element.targetingfor the audience segments of the ad.Read
element.impressionsfor the total and the breakdown by country.
The element.targeting field and the element.impressions field can hold null, because LinkedIn does not publish both values for every ad.
CAUTION:LinkedIn Ad Details costs 2 credits per call. One search page of 24 ads costs 4.8 credits, and 5 detail calls cost 10 credits more. The pair costs 14.8 credits, that is $0.296.
How much does LinkedIn Ad Search cost?
LinkedIn Ad Search charges no base fee per call. It charges 0.2 credit for each ad in the elements array. At $0.02 a credit, the rate on the 1,000 and 5,000 credit packs, one ad costs $0.004. Larger packs cost less per credit. A full page of 24 ads costs 4.8 credits, and 4.8 credits cost $0.096.
Ads returned | Pages at 24 per page | Credits | Cost |
24 | 1 | 4.8 | $0.096 |
48 | 2 | 9.6 | $0.192 |
120 | 5 | 24 | $0.48 |
240 | 10 | 48 | $0.96 |
1,200 | 50 | 240 | $4.80 |
2,400 | 100 | 480 | $9.60 |
RichAPI reserves 4.8 credits at the start of each call. That reservation covers one full page of 24 ads. RichAPI then charges for the real number of ads in elements and releases the rest of the reservation. A call that matches no ad returns an empty elements array and costs 0 credits. A failed call costs no credit.
What errors does LinkedIn Ad Search return?
An error response holds an error field with a text message.
Status | Meaning | What to do |
| The request body failed validation, or it holds an unknown field. | Correct the parameter that the message names. |
| The API key is missing, wrong or revoked. | Send your key in the |
| The organization has too few credits for the reservation, or the team reached its monthly spend limit. | Buy credits in the RichAPI dashboard. |
| This API key has no access to this endpoint ( | Call |
| The endpoint name is wrong. | Send the request to |
| The request used a method other than | Send the request again as |
| The rate limit is exceeded. | Wait, then send the request again. For a higher limit, contact support. |
| The API failed. | Send the request again. If the failure repeats, contact support. |
| The upstream data provider failed. | Send the request again after a short wait. |
| The endpoint is down. | Wait, then send the request again. |
| The upstream data provider timed out. | Send the request again after a short wait. |
For a retry loop, wait 1 second, then 2 seconds, then 4 seconds between attempts.
Frequently asked questions
What input does the LinkedIn Ad Search API need?
The LinkedIn Ad Search API needs at least one filter in the JSON request body. The filters are keyword, account_owner, countries, date_option, start_date, end_date and search_url.
How much does the LinkedIn Ad Search API cost?
The LinkedIn Ad Search API costs 0.2 credit for each ad that it returns, and it charges no base fee per call. A full page of 24 ads costs 4.8 credits, which is $0.096 at $0.02 a credit.
How many ads does one LinkedIn Ad Search call return?
One LinkedIn Ad Search call returns up to 24 ads, which is one page. To read the next 24 ads, send the same filters again. Set pagination_token to the pagination.paginationToken value of the previous response.
Does the LinkedIn Ad Search API use GET or POST?
The LinkedIn Ad Search API uses POST, and every parameter goes in the JSON request body. A GET request returns status 405 with the error linkedin_ad_search only supports POST.
How do I find every ad that a competitor runs on LinkedIn?
Send a LinkedIn Ad Search request. Set account_owner to the competitor company name, and set date_option to the period that you track. Read pagination.totalElements for the full count, then page through the results with pagination_token.
How do I see who a LinkedIn ad targets?
LinkedIn Ad Search returns no targeting data. Send content.pageUrl from the search result to LinkedIn Ad Details as the ad_url parameter. Read the element.targeting object of that response.
Does an empty LinkedIn Ad Search result cost credits?
No. A LinkedIn Ad Search call that returns an empty elements array costs 0 credits. RichAPI charges 0.2 credit per returned ad and no base fee per call.
