Skip to content
Examples

Update Settings

Configure Facebook Ad Library Scraper settings

The v1 API, for batchesSquids, tasks and runs: many calls on a schedule, delivered where you work. For one call that answers in seconds, use the API v2.
POSThttps://api.lobstr.io/v1/squids/{squid_hash}

Configure your Facebook Ad Library Scraper squid settings.

Headers

Authorizationstringheaderrequired

Your API authentication token. Value: Token YOUR_API_KEY

Content-Typestringheaderrequired

Must be application/json. Value: application/json

Squid Parameters

Parameter Type Default Description
rows integer — Number of rows returned per API page
country string ALL Country ads are served in, as a 2-letter ISO code
ad_status string all all, active, or inactive
ad_type string all all or political_and_issue_ads
media_type string all image, video, meme, image_and_meme, none, or all
platforms string — Comma-separated Meta platforms: facebook, instagram, audience_network, messenger
languages string — Comma-separated creative languages as ISO 639-1 codes
date_from string — Only collect ads running on or after this date (YYYY-MM-DD)
date_to string — Only collect ads running on or before this date (YYYY-MM-DD)
sort_by string total_impressions total_impressions or recent
ad_details boolean false Open each ad's transparency detail to add payer, beneficiary, EU targeting data
max_results integer — Max ads collected per URL
max_unique_results_per_run integer — Max unique ads across all tasks in the run

Setting ad_details: true enables additional detail fields in results.

Code Examples

curl -X POST https://api.lobstr.io/v1/squids/f667dfc7398156ba2359836105184825 \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "ad_status": "active",
    "sort_by": "recent",
    "max_results": 200,
    "ad_details": true
  }'

Response

201
{"params": {"country": "US", "ad_status": "active", "ad_type": "all", "sort_by": "recent", "max_results": 200, "ad_details": true}}