Install
openclaw skills install meta-ads-controlUse this skill when the user wants to inspect, report on, create, update, pause, resume, budget, target, upload assets for, or troubleshoot Meta, Facebook, o...
openclaw skills install meta-ads-controlUse this skill for Meta Marketing API work. Prefer the bundled script because it gives structured JSON output, dry-run protection, retries, pagination, batch support, async Insights jobs, targeting search, and asset upload.
python3 scripts/meta_ads.py accounts
python3 scripts/meta_ads.py account
--dry-run,--confirm.PAUSED unless the user explicitly asks to go live immediately.get, list, or request GET.The script reads:
META_ACCESS_TOKEN — required for live API callsMETA_AD_ACCOUNT_ID — optional default account, with or without act_META_API_VERSION — defaults to v25.0META_GRAPH_BASE — defaults to https://graph.facebook.comIf META_ACCESS_TOKEN is missing, help the user set it up first instead of guessing or fabricating API responses.
OpenClaw users can inject these values through skill config. See OpenClaw notes.
Start with the smallest read that answers the question.
python3 scripts/meta_ads.py account --fields id,name,account_status,currency,timezone_name,amount_spent,spend_cap
python3 scripts/meta_ads.py list campaigns --fields id,name,objective,status,effective_status,daily_budget,lifetime_budget
python3 scripts/meta_ads.py list adsets --fields id,name,campaign_id,status,effective_status,daily_budget,lifetime_budget,optimization_goal,bid_strategy
python3 scripts/meta_ads.py list ads --fields id,name,adset_id,campaign_id,status,effective_status,creative
Use batch when you need several small reads at once. Use minimal field sets first.
Use insights. Start with a narrow level and date window. For large windows, many fields, or breakdowns, use --async.
python3 scripts/meta_ads.py insights act_123 --level campaign --date-preset last_7d
python3 scripts/meta_ads.py insights act_123 --level ad --fields ad_id,ad_name,spend,impressions,clicks,ctr,cpc,actions,action_values,purchase_roas --date-preset last_30d --async --fetch-all
If the user asks for conversions or ROAS, include actions and action_values. If the user asks for demographic or placement splits, use --breakdowns. If they ask for action-level splits, include actions and use --action-breakdowns.
Prefer set-status for single-object changes.
python3 scripts/meta_ads.py set-status 120000000000000 PAUSED --dry-run
python3 scripts/meta_ads.py set-status 120000000000000 PAUSED --confirm
For bulk operations, create a JSON batch file and use batch after approval.
Create in order:
Use JSON payload files for any nested params. Start from templates in assets/.
python3 scripts/meta_ads.py create campaign --params-file assets/campaign-create.json --dry-run
python3 scripts/meta_ads.py create campaign --params-file work/campaign.json --confirm
python3 scripts/meta_ads.py create adset --params-file work/adset.json --dry-run
python3 scripts/meta_ads.py create adset --params-file work/adset.json --confirm
python3 scripts/meta_ads.py create adcreative --params-file work/adcreative.json --dry-run
python3 scripts/meta_ads.py create adcreative --params-file work/adcreative.json --confirm
python3 scripts/meta_ads.py create ad --params-file work/ad.json --dry-run
python3 scripts/meta_ads.py create ad --params-file work/ad.json --confirm
If assets are local files, upload them first with upload.
Never invent targeting IDs. Resolve them with targeting search first.
python3 scripts/meta_ads.py targeting-search --type adinterest --q "running"
python3 scripts/meta_ads.py targeting-search --type adgeolocation --q "Munich"
Then place the returned IDs and descriptors into the ad set targeting spec.
Use the low-level request subcommand.
python3 scripts/meta_ads.py request GET /act_123/reachestimate --set targeting_spec=@work/targeting.json
python3 scripts/meta_ads.py request GET /120000000000000/previews --set ad_format=DESKTOP_FEED_STANDARD
For nested values, prefer --params-file or @file.json values over many inline --sets.
python3 scripts/meta_ads.py --help
accounts — list accessible ad accounts from the tokenaccount — read the default or provided accountlist — list campaigns, adsets, ads, creatives, audiences, assets, pixels, and moreget — read a node or node edgecreate — create campaign, adset, adcreative, ad, customaudience, or any supported account edgeupdate — update a node by IDset-status — convenience wrapper for statusinsights — sync or async reportingtargeting-search — resolve targeting descriptorsupload — upload to adimages or advideosbatch — send Graph batch requestsrequest — low-level escape hatch for any Graph path--fetch-all only when the user actually needs all pages.--async for heavy Insights jobs.PAUSED or ARCHIVED over destructive delete operations.python3 scripts/meta_ads.py batch --batch-file assets/batch-read-example.json
python3 scripts/meta_ads.py insights act_123 --level campaign --date-preset last_7d --fields campaign_id,campaign_name,spend,impressions,clicks,ctr,cpc,actions,action_values,purchase_roas
python3 scripts/meta_ads.py get 120000000000000 --fields id,name,status,effective_status,daily_budget,lifetime_budget
python3 scripts/meta_ads.py update 120000000000000 --params-file work/adset-budget.json --dry-run
python3 scripts/meta_ads.py update 120000000000000 --params-file work/adset-budget.json --confirm
python3 scripts/meta_ads.py get 120000000000000 --fields id,name,daily_budget,lifetime_budget,updated_time
python3 scripts/meta_ads.py upload adimages --file creative.jpg --confirm
# Put the returned image_hash into work/adcreative.json
python3 scripts/meta_ads.py create adcreative --params-file work/adcreative.json --confirm
python3 scripts/meta_ads.py create ad --params-file work/ad.json --confirm
assets/evals/evals.json