# Biblioteca de Anúncios — how to use (mcp.ai)

Discover who is advertising on Instagram and Facebook about a topic, and read each ad's copy, call to action and landing page. Public data from Meta's ad library, hosted by the platform, no credentials required.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_ad_library?ms=1788152100000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `ad_library_company_ads`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/ad_library`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/ad_library/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/ad_library/company/ads` — List every ad one specific advertiser is running, given its `page_id` (get it from ad_library_search_advertisers). Use it to map a single competitor's whole campaign: which offers, which copy, which l
  - body: { page_id: string, country?: string, limit?: integer, cursor?: string, page_ids?: string[] }
- `POST https://api.mcp.ai/api/ad_library/search/ads` — Find ads a competitor (or any company) is currently running on Instagram and Facebook for a keyword, using Meta's public ad library. Returns each ad's advertiser, copy, headline, call to action, landi
  - body: { query: string, country?: string, limit?: integer, cursor?: string }
- `POST https://api.mcp.ai/api/ad_library/search/advertisers` — Look up advertisers by company name and get their page id, category, follower/like counts and Instagram handle when available. Use it to turn a company name into the `page_id` that ad_library_company_
  - body: { query: string, limit?: integer }

## Example prompts
- "Who is advertising about "meal delivery" on Instagram in the US?"
- "List the ads Duolingo is running right now"
- "Compare the ad copy of competitors advertising "project management software""

## More
- Page: https://mcp.ai/ad_library
- Agent spec (llms.txt): https://mcp.ai/ad_library/llms.txt
- Postman collection: https://mcp.ai/ad_library/postman.json
