| name | scrape-ads |
| description | Scrape Facebook Ad Library for a brand. Extract videos, images, transcripts, and ad metadata. Use when user provides a Facebook Ad Library URL or asks to scrape ads. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_evaluate, mcp__playwright__browser_click, mcp__playwright__browser_wait_for |
Facebook Ad Library Scraper
Scrapes ads from Facebook's Ad Library, downloads media, and enriches with transcripts/descriptions.
Quick Workflow
1. Navigate to Ad Library URL
mcp__playwright__browser_navigate({ url: "https://www.facebook.com/ads/library/..." })
2. Extract Media URLs
Use mcp__playwright__browser_evaluate to run:
Array.from(document.querySelectorAll('video')).map(v => v.src || v.querySelector('source')?.src)
Array.from(document.querySelectorAll('img')).filter(img =>
img.src.includes('scontent') && img.width > 200
).map(img => img.src)
Scroll down and repeat to load more ads.
3. Create Brand Folder & Download
mkdir -p {brand}/videos {brand}/images
curl -L -o "{brand}/videos/{brand}-video-1.mp4" "{video-url}"
curl -L -o "{brand}/images/{brand}-image-1.jpg" "{image-url}"
4. Enrich Data
Videos with audio:
ffprobe -v error -select_streams a -show_entries stream=codec_type -of csv=p=0 video.mp4
ffmpeg -y -i video.mp4 -ar 16000 -ac 1 /tmp/audio.wav
whisper /tmp/audio.wav --model base --output_format txt --output_dir /tmp/transcripts/
Images: Use vision capability to describe visual content, message, and style.
5. Create ads-data.json
Structure with:
- Brand info and source URL
- Summary counts
- Array of ads with type, mediaFile, transcript/description, format category
- Ad format categorization
- Key messages extracted
Requirements
- Browser MCP (Playwright)
- ffmpeg
- whisper (
brew install openai-whisper)
- curl
Reference
See reference.md in this skill folder for detailed documentation, ad format categories, and complete data structure examples.