Research competitor LinkedIn ads before you launch a B2B campaign
Pull a competitor's LinkedIn Ad Library ads as JSON with copy, format and dates, to study messaging and run length before you plan your own campaign.
Before you spend on a B2B campaign you want to know what your competitors already say to your buyers, in which ad format, and for how long they keep an ad running. The LinkedIn Ad Library has the answer, but it is a search page you read one ad at a time. Lovely Router reads it for you. Send Ad Library search URLs, get one JSON object per ad, pay per ad from a prepaid balance. Call it from a script, a spreadsheet job or an AI agent with one API key.
Hand it to your AI agent
Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.
Research competitor LinkedIn ads before you launch a B2B campaign. Use the Lovely Router data tools: each returns JSON and is billed per result.
- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <the inputs (links, keywords or accounts) and how many results you need>How it works
Open the Ad Library and filter
Search the LinkedIn Ad Library for a competitor, or by keyword, and set the filters you want. Copy the address of the results page.
Run the tool with a cap
Send the URL in
startUrlstoPOST /v1/tools/linkedin-ads/run, withresultsLimitfor the cap per URL andmax_resultsfor the whole run. The run holds its maximum cost from your balance.Read the messaging and the timeline
Group the ads by copy and format, and use the dates to see which ones ran for weeks and which were dropped fast.
Get a competitor's LinkedIn ads with one request
LinkedIn Ad Library ads takes a list of Ad Library URLs in startUrls. resultsLimit caps the ads per URL, and one run returns up to 500 ads. The tool also accepts a company page URL, but a search URL is the better input because the company page gives you no control over the filters:
curl https://lovelyrouter.com/v1/tools/linkedin-ads/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"startUrls": [
{
"url": "https://www.linkedin.com/ad-library/search?accountOwner=northwind"
}
],
"resultsLimit": 20
},
"max_results": 20
}'Each ad in the result carries its copy, format and dates. A run still going after 60 seconds returns 202; Run a tool shows how to poll.
What each ad holds
| Field group | What you get |
|---|---|
| Copy | The text of the ad |
| Format | How the ad is built, such as a single image or a video |
| Dates | When the ad ran |
The tool returns what the Ad Library shows for each ad. Ask a model to label the angle of each ad (pain point, proof, offer, event) so you can count which angles a competitor leans on.
Recipes
Run the Ad Library URL for each of five competitors with a cap of 50, then ask a model to group the copy by claim: price, speed, security, integrations. You see which claims are crowded and which are open.
Compare start and end dates. An ad that runs for months is probably earning its keep; one that stops after a week was not. Start your test ideas from the long runners.
Re-run the same search every Monday and diff against last week. New ads with a new format or a new theme usually mean a new product or a new push.
Export the copy and formats of the last 100 ads in your category into one sheet, so the brief starts from what buyers already see.
Search for a keyword such as a conference name and read the dates to see when advertisers start promoting around it.
Prefer plain words? Connect the MCP server and tell Claude Code or Cursor: "Open the LinkedIn Ad Library search for these three competitors, run the linkedin-ads tool on each URL with resultsLimit 40, and give me a table of ad copy, format and start date. Set max_results to 120."
Pair it with other ad and brand sources
LinkedIn ads show what competitors say to professionals. Their other channels and their pages tell the rest:
Ads from the LinkedIn Ad Library for an advertiser or keyword search URL: copy, format, dates.
Ads from the Meta Ad Library for a search URL: creative, copy, start date, advertiser.
An advertiser's ads from the Google Ads Transparency Center: format, text, dates shown, regions.
Recent posts from LinkedIn company pages with engagement counts.
LinkedIn company pages: description, industry, size, headquarters, website, followers.
facebook-adsshows the same competitors' ads on Facebook, so you can compare B2B and broader messaging.google-ads-transparencylists the ads an advertiser runs on Google.linkedin-company-postsshows what the same company posts for free, next to what it pays to promote.linkedin-companyadds industry, size and headquarters, so you know who you are comparing against.
For a wider view of advertising research, see ad intelligence.
What you pay
You pay per ad: starting a run holds its maximum cost, the per-call fee plus the per-ad fee times max_results, and the run settles to what it returned. The rest of the hold goes back to your balance. A run that fails or times out pays only for the ads it delivered, and a run refused at the start costs nothing.
Reading 150 ads is billed as 150 ads. There is no subscription and no monthly minimum: top up from $5, and one balance pays for tools and models. The card above shows today's price; pricing lists every tool.
Frequently asked questions
What can I search for in the Ad Library?+
Anything you can build as an Ad Library search URL: an advertiser, or a keyword search. Paste the URL from your browser into startUrls.
How many ads can one run return?+
Up to 500 per run. resultsLimit sets the cap for each URL, and max_results caps the whole run.
Can I give a company page instead of an Ad Library link?+
Yes, the tool accepts company URLs too. A search URL is the better input, because it lets you set the filters yourself and a company URL does not.
Does it tell me what an ad cost or how many people saw it?+
The tool returns the ad copy, format and dates. It does not list spend or reach.
Do I need a subscription?+
No. You add credit to a prepaid balance and each run draws it down. Failed runs pay only for the results they delivered, and nothing renews automatically.
Studying a whole competitor set? See ad intelligence, and the rest of the tool catalog. Run settings are in Run a tool.