How to list Facebook ads for a company by page ID
List a company's active Meta Ad Library ads by page ID or company name, including creative text, format, platforms, run dates, and cursor pagination
On this page
You need 60 active Facebook ads from three rival pages, collected before a campaign planning meeting and placed in one comparison table. Pull each company's ads by page ID, then compare creative formats, run dates and platforms. The table feeds a decision on which message and media mix to test next
No run has been executed for this guide. The worksheet below is a design, not a result
What the audit table should contain
Build one row per ad with these columns: pageName, id, text, displayFormat, platforms, startDate, endDate, active, ctaText, linkUrl and adCount. Values here are placeholders showing the shape
| pageName | id | text | displayFormat | platforms | startDate | endDate | active | ctaText | linkUrl | adCount |
|---|---|---|---|---|---|---|---|---|---|---|
| (rival page) | (archive id) | (ad body) | (format) | (platform list) | YYYY-MM-DD | YYYY-MM-DD | true or false | (button label) | (destination) | (count or null) |
Convert startDate and endDate from epoch seconds to dates before the meeting. The comparison article at compare competitor ads covers the next analysis step after the table is built
Inputs and the page ID step
anyapi.facebook.company_ads takes either pageId or companyName; the contract requires one of the two. The pageId comes from the company's Ad Library page URL. Example pageId: 104958162837. Replace it with your own
Optional inputs include country, language, mediaType, sortBy, startDate, endDate, status and cursor. status defaults to ACTIVE, and sortBy defaults to impressions. The limit sits on companyName: it is exact-match and case-sensitive against the Meta Ad Library index. An advertiser with no indexed page returns found set to false. A response with found set to false is a successful call, not an error
The page ID route is the one this audit uses. Put the ID in the call and keep the company name as a label in your notes
How to read the output fields
The response has found and data. When found is true, data.ads is an array of ad objects and data.nextCursor is an opaque cursor or null. data.totalResults is the number of ads Facebook reports for the page
For each ad, pageName and id identify the row. text is the ad body. displayFormat is the format field. platforms is an array. startDate and endDate are epoch seconds. active is a boolean. ctaText is the button label. linkUrl is the destination. adCount is the campaign collation count and is null when the source does not report it
Use displayFormat, platforms, startDate, endDate, ctaText and linkUrl to compare the media mix and message. Use active to mark whether the ad is running. Use adCount as a campaign size signal when it is not null. If creatives is not empty, each card has its own title, body, ctaText and linkUrl; the top-level fields describe the ad
When data.nextCursor is not null, pass it back as cursor to get the next page. A response with found set to false and reason set to not_found has no data; record it as no ads for that page
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list active Facebook ads for three rival pages by pageId. Check the current inputs and price of anyapi.facebook.company_ads before running anything. Call the tool once for each pageId. Follow data.nextCursor with cursor until nextCursor is null or you have up to 20 ads for that page. Return a table with pageName, id, text, displayFormat, platforms, startDate, endDate, active, ctaText, linkUrl and adCount. Convert startDate and endDate from epoch seconds to YYYY-MM-DD. Mark rows with no result.
Example pageId 1: 104958162837
PageId 2: replace with the second rival page ID
PageId 3: replace with the third rival page IDThe prompt asks for 20 ads per page, so three pages can reach the 60-row target. The 60 rows do not set the call count; pagination does
Estimated tool cost
The price block lists anyapi.facebook.company_ads, which is called through POST /v1/runs with toolId anyapi.facebook.company_ads, read through the Purrkey catalog on November 13, 2026. The price is up to $0.0012 per call. The unit is max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. Totals below are ceilings. Model fees for the agent are not counted
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| One page of company ads | calls x max price | $0.0012 per call | 1 call | $0.0012 |
| Five cursor pages | calls x max price | $0.0012 per call | 5 calls | $0.006 |
| Three rivals, five pages each | calls x max price | $0.0012 per call | 15 calls | $0.018 |
The first page for one rival is one call. If each rival needs five cursor pages, the audit uses 15 calls and at most $0.018. A response with found set to false is a successful call, so it counts as a call
Start with one rival page
Run one page ID first and inspect data.ads, data.nextCursor and data.totalResults before adding the other two. The tool page is Facebook company ads
Get started by giving this to your agent
- Claude Code
- Codex
- Gemini CLI
- Cursor
- GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Facebook.FAQ
How do I list Facebook ads for a company by page ID?
Call anyapi.facebook.company_ads with the company's Ad Library pageId, then read data.ads and follow data.nextCursor with cursor to get more pages. The page ID comes from the company's Ad Library page URL.
What inputs does anyapi.facebook.company_ads take?
It requires either pageId or companyName, and optional inputs include country, language, mediaType, sortBy, startDate, endDate, status and cursor. status defaults to ACTIVE and sortBy defaults to impressions.
What does found false mean for Facebook company ads?
found:false with reason:not_found means the source states the target does not exist or returned nothing for it. The contract says this is a successful call, not an error.
How much does it cost to list ads for three rival pages?
At up to $0.0012 per call, one page per rival is 3 calls and at most $0.0036. Five cursor pages per rival is 15 calls and at most $0.018.
What do nextCursor and totalResults mean?
data.nextCursor is an opaque cursor for the next page, or null when the lane has no more. data.totalResults is the number of ads Facebook reports for the page.
Why does companyName return found false?
companyName is an exact-match, case-sensitive search against the Meta Ad Library index. An advertiser with no indexed page returns found:false.
What fields go in the audit table?
Use pageName, id, text, displayFormat, platforms, startDate, endDate, active, ctaText, linkUrl and adCount. Convert the epoch-second dates to YYYY-MM-DD for the meeting.
Next step
Try this with Facebook
The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.